fwrite($file, "<team currency=\"".$user->currency."\" decimal_mark=\"".$user->decimal_mark."\" lang=\"".$user->lang.
"\" date_format=\"".$user->date_format."\" time_format=\"".$user->time_format."\" week_start=\"".$user->week_start.
"\" tracking_mode=\"".$user->tracking_mode."\" project_required=\"".$user->project_required."\" task_required=\"".$user->task_required.
- "\" record_type=\"".$user->record_type."\" uncompleted_indicators=\"".$user->uncompleted_indicators."\" bcc_email=\"".$user->bcc_email.
- "\" plugins=\"".$user->plugins."\" lock_spec=\"".$user->lock_spec."\" workday_hours=\"".$user->workday_hours.
+ "\" record_type=\"".$user->record_type."\" bcc_email=\"".$user->bcc_email.
+ "\" plugins=\"".$user->plugins."\" lock_spec=\"".$user->lock_spec."\" workday_minutes=\"".$user->workday_minutes.
+ "\" config=\"".$user->config.
"\">\n");
fwrite($file, " <name><![CDATA[".$user->team."]]></name>\n");
fwrite($file, "</team>\n");
$quotas = ttTeamHelper::getMonthlyQuotas($user->team_id);
fwrite($file, "<monthly_quotas>\n");
foreach ($quotas as $quota) {
- fwrite($file, " <monthly_quota year=\"".$quota['year']."\" month=\"".$quota['month']."\" quota=\"".$quota['quota']."\"/>\n");
+ fwrite($file, " <monthly_quota year=\"".$quota['year']."\" month=\"".$quota['month']."\" minutes=\"".$quota['minutes']."\"/>\n");
}
fwrite($file, "</monthly_quotas>\n");
'project_required' => $this->teamData['PROJECT_REQUIRED'],
'task_required' => $this->teamData['TASK_REQUIRED'],
'record_type' => $this->teamData['RECORD_TYPE'],
- 'uncompleted_indicators' => $this->teamData['UNCOMPLETED_INDICATORS'],
'bcc_email' => $this->teamData['BCC_EMAIL'],
'plugins' => $this->teamData['PLUGINS'],
'lock_spec' => $this->teamData['LOCK_SPEC'],
- 'workday_hours' => $this->teamData['WORKDAY_HOURS']));
+ 'workday_minutes' => $this->teamData['WORKDAY_MINUTES'],
+ 'config' => $this->teamData['CONFIG']));
if ($team_id) {
$this->team_id = $team_id;
foreach ($this->users as $key=>$user_item) {
}
if ($name == 'MONTHLY_QUOTA' && $this->canImport) {
- $this->insertMonthlyQuota($this->team_id, $this->currentElement['YEAR'], $this->currentElement['MONTH'], $this->currentElement['QUOTA']);
+ $this->insertMonthlyQuota($this->team_id, $this->currentElement['YEAR'], $this->currentElement['MONTH'], $this->currentElement['MINUTES']);
}
if ($name == 'LOG_ITEM' && $this->canImport) {
}
// insertMonthlyQuota - a helper function to insert a monthly quota.
- private function insertMonthlyQuota($team_id, $year, $month, $quota) {
+ private function insertMonthlyQuota($team_id, $year, $month, $minutes) {
$mdb2 = getConnection();
- $sql = "INSERT INTO tt_monthly_quotas (team_id, year, month, quota) values ($team_id, $year, $month, $quota)";
+ $sql = "INSERT INTO tt_monthly_quotas (team_id, year, month, minutes) values ($team_id, $year, $month, $minutes)";
$affected = $mdb2->exec($sql);
return (!is_a($affected, 'PEAR_Error'));
}
$mdb2 = getConnection();
$result = array();
- $sql = "select year, month, quota from tt_monthly_quotas where team_id = $team_id";
+ $sql = "select year, month, minutes from tt_monthly_quotas where team_id = $team_id";
$res = $mdb2->query($sql);
$result = array();
if (!is_a($res, 'PEAR_Error')) {
$record_type_v = '';
}
- $uncompleted_indicators = $fields['uncompleted_indicators'];
- if ($uncompleted_indicators !== null) {
- $uncompleted_indicators_f = ', uncompleted_indicators';
- $uncompleted_indicators_v = ', ' . (int)$uncompleted_indicators;
- } else {
- $uncompleted_indicators_f = '';
- $uncompleted_indicators_v = '';
- }
-
$bcc_email = $fields['bcc_email'];
if ($bcc_email !== null) {
$bcc_email_f = ', bcc_email';
$lockspec_v = '';
}
- $workday_hours = $fields['workday_hours'];
- if ($workday_hours !== null) {
- $workday_hours_f = ', workday_hours';
- $workday_hours_v = ', ' . (int)$workday_hours;
+ $workday_minutes = $fields['workday_minutes'];
+ if ($workday_minutes !== null) {
+ $workday_minutes_f = ', workday_minutes';
+ $workday_minutes_v = ', ' . (int)$workday_minutes;
+ } else {
+ $workday_minutes_f = '';
+ $workday_minutes_v = '';
+ }
+
+ $config = $fields['config'];
+ if ($config !== null) {
+ $config_f = ', config';
+ $config_v = ', ' . $mdb2->quote($config);
} else {
- $workday_hours_f = '';
- $workday_hours_v = '';
+ $config_f = '';
+ $config_f = '';
}
- $sql = "insert into tt_teams (name, currency $decimal_mark_f, lang $date_format_f $time_format_f $week_start_f $tracking_mode_f $project_required_f $task_required_f $record_type_f $uncompleted_indicators_f $bcc_email_f $plugins_f $lockspec_f $workday_hours_f)
+ $sql = "insert into tt_teams (name, currency $decimal_mark_f, lang $date_format_f $time_format_f $week_start_f $tracking_mode_f $project_required_f $task_required_f $record_type_f $bcc_email_f $plugins_f $lockspec_f $workday_minutes_f $config_f)
values(".$mdb2->quote(trim($fields['name'])).
", ".$mdb2->quote(trim($fields['currency']))." $decimal_mark_v, ".$mdb2->quote($lang).
- "$date_format_v $time_format_v $week_start_v $tracking_mode_v $project_required_v $task_required_v $record_type_v $uncompleted_indicators_v $bcc_email_v $plugins_v $lockspec_v $workday_hours_v)";
+ "$date_format_v $time_format_v $week_start_v $tracking_mode_v $project_required_v $task_required_v $record_type_v $bcc_email_v $plugins_v $lockspec_v $workday_minutes_v $config_v)";
$affected = $mdb2->exec($sql);
if (!is_a($affected, 'PEAR_Error')) {
$tracking_mode_part = '';
$task_required_part = ' , task_required = '.(int) $fields['task_required'];
$record_type_part = '';
- $uncompleted_indicators_part = '';
$bcc_email_part = '';
$plugins_part = '';
$config_part = '';
if (isset($fields['week_start'])) $week_start_part = ', week_start = '.(int) $fields['week_start'];
if (isset($fields['tracking_mode'])) $tracking_mode_part = ', tracking_mode = '.(int) $fields['tracking_mode'];
if (isset($fields['record_type'])) $record_type_part = ', record_type = '.(int) $fields['record_type'];
- if (isset($fields['uncompleted_indicators'])) $uncompleted_indicators_part = ', uncompleted_indicators = '.(int) $fields['uncompleted_indicators'];
if (isset($fields['bcc_email'])) $bcc_email_part = ', bcc_email = '.$mdb2->quote($fields['bcc_email']);
if (isset($fields['plugins'])) $plugins_part = ', plugins = '.$mdb2->quote($fields['plugins']);
if (isset($fields['config'])) $config_part = ', config = '.$mdb2->quote($fields['config']);
$sql = "update tt_teams set $name_part $currency_part $lang_part $decimal_mark_part
$date_format_part $time_format_part $week_start_part $tracking_mode_part $task_required_part $record_type_part
- $uncompleted_indicators_part $bcc_email_part $plugins_part $config_part $lock_spec_part $workday_minutes_part where id = $team_id";
+ $bcc_email_part $plugins_part $config_part $lock_spec_part $workday_minutes_part where id = $team_id";
$affected = $mdb2->exec($sql);
if (is_a($affected, 'PEAR_Error')) return false;
$sql = "SELECT u.id, u.login, u.name, u.team_id, u.role, u.client_id, u.email, t.name as team_name,
t.currency, t.lang, t.decimal_mark, t.date_format, t.time_format, t.week_start,
- t.tracking_mode, t.project_required, t.task_required, t.record_type, t.uncompleted_indicators,
+ t.tracking_mode, t.project_required, t.task_required, t.record_type,
t.bcc_email, t.plugins, t.config, t.lock_spec, t.workday_minutes, t.custom_logo
FROM tt_users u LEFT JOIN tt_teams t ON (u.team_id = t.id) WHERE ";
if ($id)
$this->project_required = $val['project_required'];
$this->task_required = $val['task_required'];
$this->record_type = $val['record_type'];
- // $this->uncompleted_indicators = $val['uncompleted_indicators']; // TODO: remove the field from query and drop the field.
$this->bcc_email = $val['bcc_email'];
$this->team = $val['team_name'];
$this->currency = $val['currency'];
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.17.18.3988 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.17.19.3989 | 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>
{foreach $active_users as $u}
<tr bgcolor="{cycle values="#f5f5f5,#ffffff"}">
<td>
- {if $smarty.const.UNCOMPLETED_INDICATORS == $user->uncompleted_indicators}
+ {if $user->uncompleted_indicators}
<span class="uncompleted-entry{if $u.has_uncompleted_entry} active{/if}"{if $u.has_uncompleted_entry} title="{$i18n.form.users.uncompleted_entry}"{/if}></span>
{/if}
{if $user->isManager()}
{foreach $active_users as $u}
<tr bgcolor="{cycle values="#f5f5f5,#ffffff"}">
<td>
- {if $smarty.const.UNCOMPLETED_INDICATORS == $user->uncompleted_indicators}
+ {if $user->uncompleted_indicators}
<span class="uncompleted-entry{if $u.has_uncompleted_entry} active{/if}"{if $u.has_uncompleted_entry} title="{$i18n.form.users.uncompleted_entry}"{/if}></span>
{/if}
{$u.name|escape}
setChange("ALTER TABLE `tt_log` ADD `paid` tinyint(4) NULL default '0' AFTER `billable`");
}
- if ($_POST["convert11400to11715"]) {
+ if ($_POST["convert11400to11719"]) {
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_teams` DROP `workday_hours`");
setChange("UPDATE `tt_monthly_quotas` SET `minutes` = 60 * `quota`");
setChange("ALTER TABLE `tt_monthly_quotas` DROP `quota`");
+ setChange("ALTER TABLE `tt_teams` DROP `uncompleted_indicators`");
}
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.15)</b>
+ <td width="80%"><b>Create database structure (v1.17.19)</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.15)</td>
- <td><input type="submit" name="convert11400to11715" value="Update"><br></td>
+ <td>Update database structure (v1.14 to v1.17.19)</td>
+ <td><input type="submit" name="convert11400to11719" value="Update"><br></td>
</tr>
</table>
}
// Check if the team is set to show indicators for uncompleted time entries.
-if (UNCOMPLETED_INDICATORS == $user->uncompleted_indicators) {
+if ($user->uncompleted_indicators) {
// Check each active user if they have an uncompleted time entry.
foreach ($active_users as $key => $user) {
$active_users[$key]['has_uncompleted_entry'] = (bool) ttTimeHelper::getUncompleted($user['id']);
`project_required` smallint(2) NOT NULL DEFAULT '0', # whether a project selection is required or optional
`task_required` smallint(2) NOT NULL DEFAULT '0', # whether a task selection is required or optional
`record_type` smallint(2) NOT NULL DEFAULT '0', # time record type ("start and finish", "duration", or both)
- `uncompleted_indicators` smallint(2) NOT NULL DEFAULT '0', # whether to show indicators for users with uncompleted time entries
`bcc_email` varchar(100) default NULL, # bcc email to copy all reports to
`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` decimal(5,2) DEFAULT '8.00', # number of work hours in a regular day
`workday_minutes` smallint(4) DEFAULT '480', # number of work minutes in a regular working day
`custom_logo` tinyint(4) default '0', # whether to use a custom logo or not
`config` text default NULL, # miscellaneous team configuration settings
}
// Check if the team is set to show indicators for uncompleted time entries.
-if (UNCOMPLETED_INDICATORS == $user->uncompleted_indicators) {
+if ($user->uncompleted_indicators) {
// Check each active user if they have an uncompleted time entry.
foreach ($active_users as $key => $user) {
$active_users[$key]['has_uncompleted_entry'] = (bool) ttTimeHelper::getUncompleted($user['id']);