<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.17.9.3834 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.17.10.3835 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
<a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
<a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
<a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>
setChange("ALTER TABLE `tt_log` ADD `paid` tinyint(4) NULL default '0' AFTER `billable`");
}
- if ($_POST["convert11400to11707"]) {
+ if ($_POST["convert11400to11710"]) {
setChange("ALTER TABLE `tt_teams` DROP `address`");
setChange("ALTER TABLE `tt_fav_reports` ADD `report_spec` text default NULL AFTER `user_id`");
setChange("ALTER TABLE `tt_fav_reports` ADD `paid_status` tinyint(4) default NULL AFTER `invoice`");
setChange("ALTER TABLE `tt_fav_reports` ADD `show_paid` tinyint(4) NOT NULL DEFAULT '0' AFTER `show_invoice`");
setChange("ALTER TABLE `tt_expense_items` ADD `paid` tinyint(4) NULL default '0' AFTER `invoice_id`");
setChange("ALTER TABLE `tt_monthly_quotas` MODIFY `quota` decimal(5,2) NOT NULL");
+ setChange("ALTER TABLE `tt_teams` MODIFY `workday_hours` decimal(5,2) DEFAULT '8.00'");
}
if ($_POST["cleanup"]) {
<h2>DB Install</h2>
<table width="80%" border="1" cellpadding="10" cellspacing="0">
<tr>
- <td width="80%"><b>Create database structure (v1.17.7)</b>
+ <td width="80%"><b>Create database structure (v1.17.10)</b>
<br>(applies only to new installations, do not execute when updating)</br></td><td><input type="submit" name="crstructure" value="Create"></td>
</tr>
</table>
<td><input type="submit" name="convert1600to11400" value="Update"><br></td>
</tr>
<tr valign="top">
- <td>Update database structure (v1.14 to v1.17.7)</td>
- <td><input type="submit" name="convert11400to11707" value="Update"><br></td>
+ <td>Update database structure (v1.14 to v1.17.10)</td>
+ <td><input type="submit" name="convert11400to11710" value="Update"><br></td>
</tr>
</table>
`plugins` varchar(255) default NULL, # a list of enabled plugins for team
`lock_spec` varchar(255) default NULL, # Cron specification for record locking,
# for example: "0 10 * * 1" for "weekly on Mon at 10:00".
- `workday_hours` smallint(6) DEFAULT '8', # number of work hours in a regular day
+ `workday_hours` decimal(5,2) DEFAULT '8.00', # number of work hours in a regular day
`custom_logo` tinyint(4) default '0', # whether to use a custom logo or not
`status` tinyint(4) default '1', # team status
PRIMARY KEY (`id`)
}
// quotaToFloat converts a valid quota value to a float.
- private function quotaToFloat($value) {
+ public function quotaToFloat($value) {
if (preg_match('/^[0-9]{1,3}h?$/', $value )) { // 000 - 999
return (float) $value;
if ($request->isPost()){
// Validate user input.
+ if (!ttTimeHelper::isValidDuration($request->getParameter('workdayHours')))
+ $err->add($i18n->getKey('error.field'), $i18n->getKey('form.quota.workday_hours'));
+
for ($i = 0; $i < count($months); $i++){
$val = $request->getParameter($months[$i]);
if (!$quota->isValidQuota($val))
if ($err->no()) {
// Handle workday hours.
- $hours = (int)$request->getParameter('workdayHours');
+ $hours = $quota->quotaToFloat($request->getParameter('workdayHours'));
if ($hours != $user->workday_hours) {
if (!ttTeamHelper::update($user->team_id, array('name'=>$user->team,'workday_hours'=>$hours)))
$err->add($i18n->getKey('error.db'));
// Get monthly quotas for the entire year.
$monthsData = $quota->get($selectedYear);
+$workdayHours = ttTimeHelper::toAbsDuration($user->workday_hours * 60, true);
$form = new Form('monthlyQuotasForm');
-$form->addInput(array('type'=>'text', 'name'=>'workdayHours', 'value'=>$user->workday_hours, 'style'=>'width:50px'));
+$form->addInput(array('type'=>'text', 'name'=>'workdayHours', 'value'=>$workdayHours, 'style'=>'width:60px'));
$form->addInput(array('type'=>'combobox','name'=>'year','data'=>$years,'datakeys'=>array('id','name'),'value'=>$selectedYear,'onchange'=>'yearChange(this.value);'));
for ($i=0; $i < count($months); $i++) {
$value = "";