$this->weekdayNames = $i18n_weekdays;
$this->weekdayShortNames = $i18n_weekdays_short;
- if (defined('SHOW_HOLIDAYS') && isTrue(SHOW_HOLIDAYS)) {
+// if (defined('SHOW_HOLIDAYS') && isTrue(SHOW_HOLIDAYS)) {
$this->holidays = $i18n_holidays;
- }
+// }
foreach ($i18n_key_words as $kword=>$value) {
$pos = strpos($kword, ".");
$this->monthNames = $i18n_months;
$this->weekdayNames = $i18n_weekdays;
$this->weekdayShortNames = $i18n_weekdays_short;
- if (defined('SHOW_HOLIDAYS') && isTrue(SHOW_HOLIDAYS)) {
+// if (defined('SHOW_HOLIDAYS') && isTrue(SHOW_HOLIDAYS)) {
$this->holidays = $i18n_holidays;
- }
+// }
foreach ($i18n_key_words as $kword=>$value) {
if (!$value) continue;
$pos = strpos($kword, ".");
}
// holidays
- if ($this->showHolidays) {
+ //if ($this->showHolidays) {
+ global $user;
+ if ($user->show_holidays) {
foreach ($this->holidays as $day) {
if($day == $date) {
$stl_cell = ' class="CalendarDayHoliday"';
$uncompleted_indicators_part = '';
$bcc_email_part = '';
$plugins_part = '';
+ $config_part = '';
$lock_spec_part = '';
$workday_hours_part = '';
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']);
if (isset($fields['lock_spec'])) $lock_spec_part = ', lock_spec = '.$mdb2->quote($fields['lock_spec']);
if (isset($fields['workday_hours'])) $workday_hours_part = ', workday_hours = '.$mdb2->quote($fields['workday_hours']);
$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 $lock_spec_part $workday_hours_part where id = $team_id";
+ $uncompleted_indicators_part $bcc_email_part $plugins_part $config_part $lock_spec_part $workday_hours_part where id = $team_id";
$affected = $mdb2->exec($sql);
if (is_a($affected, 'PEAR_Error')) return false;
// isHoliday determines if $date falls on a holiday.
static function isHoliday($date) {
+ global $user;
global $i18n;
+
+ if (!$user->show_holidays) return false;
+
// $date is expected as string in DB_DATEFORMAT.
$month = date('m', strtotime($date));
$day = date('d', strtotime($date));
var $date_format = null; // Date format.
var $time_format = null; // Time format.
var $week_start = 0; // Week start day.
+ var $show_holidays = 1; // Whether to show holidays in calendar.
var $tracking_mode = 0; // Tracking mode.
var $project_required = 0; // Whether project selection is required on time entires.
var $task_required = 0; // Whether task selection is required on time entires.
var $bcc_email = null; // Bcc email.
var $currency = null; // Currency.
var $plugins = null; // Comma-separated list of enabled plugins.
+ var $config = null; // Comma-separated list of miscellaneous config options.
var $team = null; // Team name.
var $custom_logo = 0; // Whether to use a custom logo for team.
var $lock_spec = null; // Cron specification for record locking.
$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.bcc_email, t.plugins, t.lock_spec, t.workday_hours, t.custom_logo
+ t.bcc_email, t.plugins, t.config, t.lock_spec, t.workday_hours, t.custom_logo
FROM tt_users u LEFT JOIN tt_teams t ON (u.team_id = t.id) WHERE ";
if ($id)
$sql .= "u.id = $id";
$this->workday_hours = $val['workday_hours'];
$this->custom_logo = $val['custom_logo'];
+ // Set user config options.
+ $this->config = $val['config'];
+ $this->show_holidays = in_array('show_holidays', explode(',', $this->config));
+
// Set "on behalf" id and name.
if (isset($_SESSION['behalf_id'])) {
$this->behalf_id = $_SESSION['behalf_id'];
// TODO: translate the following.
// 'form.profile.12_hours' => '12 hours',
// 'form.profile.24_hours' => '24 hours',
+// 'form.profile.show_holidays' => 'Show holidays',
// 'form.profile.tracking_mode' => 'Tracking mode',
// 'form.profile.mode_time' => 'time',
// 'form.profile.mode_projects' => 'projects',
// TODO: translate the following.
// 'form.profile.12_hours' => '12 hours',
// 'form.profile.24_hours' => '24 hours',
+// 'form.profile.show_holidays' => 'Show holidays',
// 'form.profile.tracking_mode' => 'Tracking mode',
// 'form.profile.mode_time' => 'time',
// 'form.profile.mode_projects' => 'projects',
// Profile form. See example at https://timetracker.anuko.com/profile_edit.php.
'form.profile.12_hours' => '12 timers',
'form.profile.24_hours' => '24 timers',
+// TODO: translate the following.
+// 'form.profile.show_holidays' => 'Show holidays',
'form.profile.tracking_mode' => 'Registrerings tilstand',
'form.profile.mode_time' => 'Tid',
'form.profile.mode_projects' => 'Projekter',
// Profile form. See example at https://timetracker.anuko.com/profile_edit.php.
'form.profile.12_hours' => '12 Stunden',
'form.profile.24_hours' => '24 Stunden',
+// TODO: translate the following.
+// 'form.profile.show_holidays' => 'Show holidays',
'form.profile.tracking_mode' => 'Nachverfolgung',
'form.profile.mode_time' => 'Zeit',
'form.profile.mode_projects' => 'Projekte',
// Profile form. See example at https://timetracker.anuko.com/profile_edit.php.
'form.profile.12_hours' => '12 hours',
'form.profile.24_hours' => '24 hours',
+'form.profile.show_holidays' => 'Show holidays',
'form.profile.tracking_mode' => 'Tracking mode',
'form.profile.mode_time' => 'time',
'form.profile.mode_projects' => 'projects',
'form.profile.12_hours' => '12 horas',
'form.profile.24_hours' => '24 horas',
// TODO: translate the following.
+// 'form.profile.show_holidays' => 'Show holidays',
// 'form.profile.tracking_mode' => 'Tracking mode',
// 'form.profile.mode_time' => 'time',
// 'form.profile.mode_projects' => 'projects',
// TODO: translate the following.
// 'form.profile.12_hours' => '12 hours',
// 'form.profile.24_hours' => '24 hours',
+// 'form.profile.show_holidays' => 'Show holidays',
// 'form.profile.tracking_mode' => 'Tracking mode',
// 'form.profile.mode_time' => 'time',
// 'form.profile.mode_projects' => 'projects',
// Profile form. See example at https://timetracker.anuko.com/profile_edit.php.
'form.profile.12_hours' => '12 ساعت',
'form.profile.24_hours' => '24 ساعت',
+// TODO: translate the following.
+// 'form.profile.show_holidays' => 'Show holidays',
'form.profile.tracking_mode' => 'حالت رهگیری',
'form.profile.mode_time' => 'زمان',
'form.profile.mode_projects' => 'پروژه ها',
// Profile form. See example at https://timetracker.anuko.com/profile_edit.php.
'form.profile.12_hours' => '12-tuntinen',
'form.profile.24_hours' => '24-tuntinen',
+// TODO: translate the following.
+// 'form.profile.show_holidays' => 'Show holidays',
'form.profile.tracking_mode' => 'Seurantamuoto',
'form.profile.mode_time' => 'aika',
'form.profile.mode_projects' => 'projektit',
// Profile form. See example at https://timetracker.anuko.com/profile_edit.php.
'form.profile.12_hours' => '12 heures',
'form.profile.24_hours' => '24 heures',
+// TODO: translate the following.
+// 'form.profile.show_holidays' => 'Show holidays',
'form.profile.tracking_mode' => 'Mode suivi',
'form.profile.mode_time' => 'Heures',
'form.profile.mode_projects' => 'Projets',
// Profile form. See example at https://timetracker.anuko.com/profile_edit.php.
'form.profile.12_hours' => '12 שעות',
'form.profile.24_hours' => '24 שעות',
+// TODO: translate the following.
+// 'form.profile.show_holidays' => 'Show holidays',
'form.profile.tracking_mode' => 'סוג מעקב',
'form.profile.mode_time' => 'זמן',
'form.profile.mode_projects' => 'פרוייקטים',
// TODO: translate the following.
// 'form.profile.12_hours' => '12 hours',
// 'form.profile.24_hours' => '24 hours',
+// 'form.profile.show_holidays' => 'Show holidays',
// 'form.profile.tracking_mode' => 'Tracking mode',
// 'form.profile.mode_time' => 'time',
// 'form.profile.mode_projects' => 'projects',
// TODO: translate the following.
// 'form.profile.12_hours' => '12 hours',
// 'form.profile.24_hours' => '24 hours',
+// 'form.profile.show_holidays' => 'Show holidays',
// 'form.profile.tracking_mode' => 'Tracking mode',
// 'form.profile.mode_time' => 'time',
// 'form.profile.mode_projects' => 'projects',
// TODO: translate the following.
// 'form.profile.12_hours' => '12 hours',
// 'form.profile.24_hours' => '24 hours',
+// 'form.profile.show_holidays' => 'Show holidays',
// 'form.profile.tracking_mode' => 'Tracking mode',
// 'form.profile.mode_time' => 'time',
// 'form.profile.mode_projects' => 'projects',
// TODO: translate the following.
// 'form.profile.12_hours' => '12 hours',
// 'form.profile.24_hours' => '24 hours',
+// 'form.profile.show_holidays' => 'Show holidays',
// 'form.profile.tracking_mode' => 'Tracking mode',
// 'form.profile.mode_time' => 'time',
// 'form.profile.mode_projects' => 'projects',
// Profile form. See example at https://timetracker.anuko.com/profile_edit.php.
'form.profile.12_hours' => '12 uurs',
'form.profile.24_hours' => '24 uurs',
+// TODO: translate the following.
+// 'form.profile.show_holidays' => 'Show holidays',
'form.profile.tracking_mode' => 'Bijhouden',
'form.profile.mode_time' => 'tijd',
'form.profile.mode_projects' => 'projecten',
// TODO: translate the following.
// 'form.profile.12_hours' => '12 hours',
// 'form.profile.24_hours' => '24 hours',
+// 'form.profile.show_holidays' => 'Show holidays',
// 'form.profile.tracking_mode' => 'Tracking mode',
// 'form.profile.mode_time' => 'time',
// 'form.profile.mode_projects' => 'projects',
// Profile form. See example at https://timetracker.anuko.com/profile_edit.php.
'form.profile.12_hours' => '12 godzin',
'form.profile.24_hours' => '24 godziny',
+// TODO: translate the following.
+// 'form.profile.show_holidays' => 'Show holidays',
'form.profile.tracking_mode' => 'Tryb śledzenia',
'form.profile.mode_time' => 'czas',
'form.profile.mode_projects' => 'projekty',
// Profile form. See example at https://timetracker.anuko.com/profile_edit.php.
'form.profile.12_hours' => '12 horas',
'form.profile.24_hours' => '24 horas',
+// TODO: translate the following.
+// 'form.profile.show_holidays' => 'Show holidays',
'form.profile.tracking_mode' => 'Modo de acompanhamento',
'form.profile.mode_time' => 'tempo',
'form.profile.mode_projects' => 'projetos',
// TODO: translate the following.
// 'form.profile.12_hours' => '12 hours',
// 'form.profile.24_hours' => '24 hours',
+// 'form.profile.show_holidays' => 'Show holidays',
// 'form.profile.tracking_mode' => 'Tracking mode',
// 'form.profile.mode_time' => 'time',
// 'form.profile.mode_projects' => 'projects',
// TODO: translate the following.
// 'form.profile.12_hours' => '12 hours',
// 'form.profile.24_hours' => '24 hours',
+// 'form.profile.show_holidays' => 'Show holidays',
// 'form.profile.tracking_mode' => 'Tracking mode',
// 'form.profile.mode_time' => 'time',
// 'form.profile.mode_projects' => 'projects',
// Profile form. See example at https://timetracker.anuko.com/profile_edit.php.
'form.profile.12_hours' => '12 часов',
'form.profile.24_hours' => '24 часа',
+'form.profile.show_holidays' => 'Показывать праздники',
'form.profile.tracking_mode' => 'Режим работы',
'form.profile.mode_time' => 'время',
'form.profile.mode_projects' => 'проекты',
// Profile form. See example at https://timetracker.anuko.com/profile_edit.php.
'form.profile.12_hours' => '12-hodinový',
'form.profile.24_hours' => '24-hodinový',
+// TODO: translate the following.
+// 'form.profile.show_holidays' => 'Show holidays',
'form.profile.tracking_mode' => 'Režim sledovania',
'form.profile.mode_time' => 'čas',
'form.profile.mode_projects' => 'projekty',
// TODO: translate the following.
// 'form.profile.12_hours' => '12 hours',
// 'form.profile.24_hours' => '24 hours',
+// 'form.profile.show_holidays' => 'Show holidays',
// 'form.profile.tracking_mode' => 'Tracking mode',
// 'form.profile.mode_time' => 'time',
// 'form.profile.mode_projects' => 'projects',
// Forma profila. Pogledajte primer na at https://timetracker.anuko.com/profile_edit.php.
'form.profile.12_hours' => '12 časova',
'form.profile.24_hours' => '24 časova',
+// TODO: translate the following.
+// 'form.profile.show_holidays' => 'Show holidays',
'form.profile.tracking_mode' => 'Način evidencije',
'form.profile.mode_time' => 'vreme',
'form.profile.mode_projects' => 'projekti',
// Profile form. See example at https://timetracker.anuko.com/profile_edit.php.
'form.profile.12_hours' => '12-timmars',
'form.profile.24_hours' => '24-timmars',
+// TODO: translate the following.
+// 'form.profile.show_holidays' => 'Show holidays',
'form.profile.tracking_mode' => 'Spårningsmetod',
'form.profile.mode_time' => 'Endast tid',
'form.profile.mode_projects' => 'Projekt',
// TODO: translate the following.
// 'form.profile.12_hours' => '12 hours',
// 'form.profile.24_hours' => '24 hours',
+// 'form.profile.show_holidays' => 'Show holidays',
// 'form.profile.tracking_mode' => 'Tracking mode',
// 'form.profile.mode_time' => 'time',
// 'form.profile.mode_projects' => 'projects',
// TODO: translate the following.
// 'form.profile.12_hours' => '12 hours',
// 'form.profile.24_hours' => '24 hours',
+// 'form.profile.show_holidays' => 'Show holidays',
// 'form.profile.tracking_mode' => 'Tracking mode',
// 'form.profile.mode_time' => 'time',
// 'form.profile.mode_projects' => 'projects',
// TODO: translate the following.
// 'form.profile.12_hours' => '12 hours',
// 'form.profile.24_hours' => '24 hours',
+// 'form.profile.show_holidays' => 'Show holidays',
// 'form.profile.tracking_mode' => 'Tracking mode',
// 'form.profile.mode_time' => 'time',
// 'form.profile.mode_projects' => 'projects',
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.17.13.3973 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.17.14.3974 | 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>
<td align="right" nowrap>{$i18n.label.week_start}:</td>
<td>{$forms.profileForm.start_week.control}</td>
</tr>
+ <tr>
+ <td align="right" nowrap>{$i18n.form.profile.show_holidays}:</td>
+ <td>{$forms.profileForm.show_holidays.control} <a href="https://www.anuko.com/lp/tt_14.htm" target="_blank">{$i18n.label.what_is_it}</a></td>
+ </tr>
<tr>
<td align="right" nowrap>{$i18n.form.profile.tracking_mode}:</td>
<td>{$forms.profileForm.tracking_mode.control} {$forms.profileForm.task_required.control} <span id="task_required_label"><label for="task_required">{$i18n.label.required}</label></span></td></td>
setChange("ALTER TABLE `tt_log` ADD `paid` tinyint(4) NULL default '0' AFTER `billable`");
}
- if ($_POST["convert11400to11710"]) {
+ if ($_POST["convert11400to11714"]) {
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_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'");
+ setChange("ALTER TABLE `tt_teams` ADD `config` text default NULL AFTER `custom_logo`");
+ setChange("ALTER TABLE `tt_monthly_quotas` ADD `minutes` int(11) DEFAULT NULL");
+ setChange("ALTER TABLE `tt_teams` ADD `workday_minutes` smallint(4) DEFAULT '480' AFTER `workday_hours`");
}
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.10)</b>
+ <td width="80%"><b>Create database structure (v1.17.14)</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.10)</td>
- <td><input type="submit" name="convert11400to11710" value="Update"><br></td>
+ <td>Update database structure (v1.14 to v1.17.14)</td>
+ <td><input type="submit" name="convert11400to11714" value="Update"><br></td>
</tr>
</table>
`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
`status` tinyint(4) default '1', # team status
PRIMARY KEY (`id`)
);
`year` smallint(5) UNSIGNED NOT NULL, # quota year
`month` tinyint(3) UNSIGNED NOT NULL, # quota month
`quota` decimal(5,2) NOT NULL, # number of work hours in specified month and year
+ `minutes` int(11) DEFAULT NULL, # quota in minutes in specified month and year
PRIMARY KEY (`team_id`,`year`,`month`)
);
$cl_date_format = $request->getParameter('date_format');
$cl_time_format = $request->getParameter('time_format');
$cl_start_week = $request->getParameter('start_week');
+ $cl_show_holidays = $request->getParameter('show_holidays');
$cl_tracking_mode = $request->getParameter('tracking_mode');
$cl_project_required = $request->getParameter('project_required');
$cl_task_required = $request->getParameter('task_required');
$cl_date_format = $user->date_format;
$cl_time_format = $user->time_format;
$cl_start_week = $user->week_start;
+ $cl_show_holidays = $user->show_holidays;
$cl_tracking_mode = $user->tracking_mode;
$cl_project_required = $user->project_required;
$cl_task_required = $user->task_required;
}
$form->addInput(array('type'=>'combobox','name'=>'start_week','style'=>'width: 150px;','data'=>$week_start_options,'datakeys'=>array('id','name'),'value'=>$cl_start_week));
+ // Show holidays checkbox.
+ $form->addInput(array('type'=>'checkbox','name'=>'show_holidays','value'=>$cl_show_holidays));
+
// Prepare tracking mode choices.
$tracking_mode_options = array();
$tracking_mode_options[MODE_TIME] = $i18n->getKey('form.profile.mode_time');
$plugins = trim($plugins, ',');
+ // Prepare config string. At this time we only handle show_holidays here.
+ if ($cl_show_holidays)
+ $config .= ',show_holidays';
+ $config = trim($config, ',');
+
$update_result = ttTeamHelper::update($user->team_id, array(
'name' => $cl_team,
'currency' => $cl_currency,
'record_type' => $cl_record_type,
'uncompleted_indicators' => $cl_uncompleted_indicators,
'bcc_email' => $cl_bcc_email,
- 'plugins' => $plugins));
+ 'plugins' => $plugins,
+ 'config' => $config));
}
if ($update_result) {
$update_result = ttUserHelper::update($user->id, array(