From: Nik Okuntseff Date: Sun, 11 Feb 2018 00:01:43 +0000 (+0000) Subject: Made show_holidays configurable as per issue #53. X-Git-Tag: timetracker_1.19-1~1142 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=8f7f616dc5fafe49038c6eaff25f6fe6f55ca635;p=timetracker.git Made show_holidays configurable as per issue #53. --- diff --git a/WEB-INF/lib/I18n.class.php b/WEB-INF/lib/I18n.class.php index fd158f58..7155edb0 100644 --- a/WEB-INF/lib/I18n.class.php +++ b/WEB-INF/lib/I18n.class.php @@ -70,9 +70,9 @@ class I18n { $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, "."); @@ -97,9 +97,9 @@ class I18n { $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, "."); diff --git a/WEB-INF/lib/form/Calendar.class.php b/WEB-INF/lib/form/Calendar.class.php index 1340c987..555b6e14 100644 --- a/WEB-INF/lib/form/Calendar.class.php +++ b/WEB-INF/lib/form/Calendar.class.php @@ -172,7 +172,9 @@ class Calendar extends FormElement { } // 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"'; diff --git a/WEB-INF/lib/ttTeamHelper.class.php b/WEB-INF/lib/ttTeamHelper.class.php index 217c07ad..b3089963 100644 --- a/WEB-INF/lib/ttTeamHelper.class.php +++ b/WEB-INF/lib/ttTeamHelper.class.php @@ -803,6 +803,7 @@ class ttTeamHelper { $uncompleted_indicators_part = ''; $bcc_email_part = ''; $plugins_part = ''; + $config_part = ''; $lock_spec_part = ''; $workday_hours_part = ''; @@ -817,12 +818,13 @@ class ttTeamHelper { 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; diff --git a/WEB-INF/lib/ttTimeHelper.class.php b/WEB-INF/lib/ttTimeHelper.class.php index 6b1efe0d..f5c3e938 100644 --- a/WEB-INF/lib/ttTimeHelper.class.php +++ b/WEB-INF/lib/ttTimeHelper.class.php @@ -39,7 +39,11 @@ class ttTimeHelper { // 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)); diff --git a/WEB-INF/lib/ttUser.class.php b/WEB-INF/lib/ttUser.class.php index 565e47ad..f04b4996 100644 --- a/WEB-INF/lib/ttUser.class.php +++ b/WEB-INF/lib/ttUser.class.php @@ -41,6 +41,7 @@ class ttUser { 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. @@ -49,6 +50,7 @@ class ttUser { 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. @@ -67,7 +69,7 @@ class ttUser { $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"; @@ -107,6 +109,10 @@ class ttUser { $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']; diff --git a/WEB-INF/resources/ca.lang.php b/WEB-INF/resources/ca.lang.php index 3dd011aa..e7085ba7 100644 --- a/WEB-INF/resources/ca.lang.php +++ b/WEB-INF/resources/ca.lang.php @@ -476,6 +476,7 @@ $i18n_key_words = array( // 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', diff --git a/WEB-INF/resources/cs.lang.php b/WEB-INF/resources/cs.lang.php index 8639a9ab..ee5a9238 100644 --- a/WEB-INF/resources/cs.lang.php +++ b/WEB-INF/resources/cs.lang.php @@ -491,6 +491,7 @@ $i18n_key_words = array( // 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', diff --git a/WEB-INF/resources/da.lang.php b/WEB-INF/resources/da.lang.php index 1624695e..b3205646 100644 --- a/WEB-INF/resources/da.lang.php +++ b/WEB-INF/resources/da.lang.php @@ -422,6 +422,8 @@ $i18n_key_words = array( // 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', diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index a3d13850..d6958825 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -420,6 +420,8 @@ $i18n_key_words = array( // 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', diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index bcdbd019..1009a0f4 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -417,6 +417,7 @@ $i18n_key_words = array( // 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', diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index 4befd52a..57139b00 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -489,6 +489,7 @@ $i18n_key_words = array( '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', diff --git a/WEB-INF/resources/et.lang.php b/WEB-INF/resources/et.lang.php index ce851642..2ff634e2 100644 --- a/WEB-INF/resources/et.lang.php +++ b/WEB-INF/resources/et.lang.php @@ -487,6 +487,7 @@ $i18n_key_words = array( // 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', diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index 9ec505cf..80193ce7 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -451,6 +451,8 @@ $i18n_key_words = array( // 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' => 'پروژه ها', diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index b1294180..e340d886 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -429,6 +429,8 @@ $i18n_key_words = array( // 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', diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index 23b1d987..d2ca6cd1 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -419,6 +419,8 @@ $i18n_key_words = array( // 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', diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index 526610d5..bd2c5980 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -456,6 +456,8 @@ $i18n_key_words = array( // 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' => 'פרוייקטים', diff --git a/WEB-INF/resources/hu.lang.php b/WEB-INF/resources/hu.lang.php index 217bbcc6..b8ea9539 100644 --- a/WEB-INF/resources/hu.lang.php +++ b/WEB-INF/resources/hu.lang.php @@ -486,6 +486,7 @@ $i18n_key_words = array( // 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', diff --git a/WEB-INF/resources/it.lang.php b/WEB-INF/resources/it.lang.php index 51bb09fa..c2af59cf 100644 --- a/WEB-INF/resources/it.lang.php +++ b/WEB-INF/resources/it.lang.php @@ -483,6 +483,7 @@ $i18n_key_words = array( // 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', diff --git a/WEB-INF/resources/ja.lang.php b/WEB-INF/resources/ja.lang.php index bc25f01f..292d844b 100644 --- a/WEB-INF/resources/ja.lang.php +++ b/WEB-INF/resources/ja.lang.php @@ -476,6 +476,7 @@ $i18n_key_words = array( // 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', diff --git a/WEB-INF/resources/ko.lang.php b/WEB-INF/resources/ko.lang.php index bf5d7633..323607f2 100644 --- a/WEB-INF/resources/ko.lang.php +++ b/WEB-INF/resources/ko.lang.php @@ -478,6 +478,7 @@ $i18n_key_words = array( // 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', diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index ddc13fbc..aabb7ad7 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -418,6 +418,8 @@ $i18n_key_words = array( // 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', diff --git a/WEB-INF/resources/no.lang.php b/WEB-INF/resources/no.lang.php index 533e3285..b8b9bc3b 100644 --- a/WEB-INF/resources/no.lang.php +++ b/WEB-INF/resources/no.lang.php @@ -474,6 +474,7 @@ $i18n_key_words = array( // 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', diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index 2f41e579..ae6126a3 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -432,6 +432,8 @@ $i18n_key_words = array( // 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', diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index 12761d51..df75ffa2 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -427,6 +427,8 @@ $i18n_key_words = array( // 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', diff --git a/WEB-INF/resources/pt.lang.php b/WEB-INF/resources/pt.lang.php index c5ef6fd7..852f1987 100644 --- a/WEB-INF/resources/pt.lang.php +++ b/WEB-INF/resources/pt.lang.php @@ -467,6 +467,7 @@ $i18n_key_words = array( // 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', diff --git a/WEB-INF/resources/ro.lang.php b/WEB-INF/resources/ro.lang.php index 6052a337..7277bcdf 100644 --- a/WEB-INF/resources/ro.lang.php +++ b/WEB-INF/resources/ro.lang.php @@ -484,6 +484,7 @@ $i18n_key_words = array( // 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', diff --git a/WEB-INF/resources/ru.lang.php b/WEB-INF/resources/ru.lang.php index da15dfab..74a7f142 100644 --- a/WEB-INF/resources/ru.lang.php +++ b/WEB-INF/resources/ru.lang.php @@ -415,6 +415,7 @@ $i18n_key_words = array( // 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' => 'проекты', diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index ff4948bd..aa6b48c6 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -448,6 +448,8 @@ $i18n_key_words = array( // 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', diff --git a/WEB-INF/resources/sl.lang.php b/WEB-INF/resources/sl.lang.php index bceace78..c9f69a1e 100644 --- a/WEB-INF/resources/sl.lang.php +++ b/WEB-INF/resources/sl.lang.php @@ -463,6 +463,7 @@ $i18n_key_words = array( // 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', diff --git a/WEB-INF/resources/sr.lang.php b/WEB-INF/resources/sr.lang.php index 4bd5d66a..2d3f82c1 100644 --- a/WEB-INF/resources/sr.lang.php +++ b/WEB-INF/resources/sr.lang.php @@ -430,6 +430,8 @@ $i18n_key_words = array( // 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', diff --git a/WEB-INF/resources/sv.lang.php b/WEB-INF/resources/sv.lang.php index 58695784..ac9cba05 100644 --- a/WEB-INF/resources/sv.lang.php +++ b/WEB-INF/resources/sv.lang.php @@ -427,6 +427,8 @@ $i18n_key_words = array( // 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', diff --git a/WEB-INF/resources/tr.lang.php b/WEB-INF/resources/tr.lang.php index f51d3fde..fe488802 100644 --- a/WEB-INF/resources/tr.lang.php +++ b/WEB-INF/resources/tr.lang.php @@ -495,6 +495,7 @@ $i18n_key_words = array( // 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', diff --git a/WEB-INF/resources/zh-cn.lang.php b/WEB-INF/resources/zh-cn.lang.php index 7d35e157..bc08f8a4 100644 --- a/WEB-INF/resources/zh-cn.lang.php +++ b/WEB-INF/resources/zh-cn.lang.php @@ -463,6 +463,7 @@ $i18n_key_words = array( // 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', diff --git a/WEB-INF/resources/zh-tw.lang.php b/WEB-INF/resources/zh-tw.lang.php index 01b71c3d..09a49e99 100644 --- a/WEB-INF/resources/zh-tw.lang.php +++ b/WEB-INF/resources/zh-tw.lang.php @@ -473,6 +473,7 @@ $i18n_key_words = array( // 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', diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 347a2449..593d07d0 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
- + + + + diff --git a/dbinstall.php b/dbinstall.php index 00b9c382..58467bc1 100755 --- a/dbinstall.php +++ b/dbinstall.php @@ -709,7 +709,7 @@ if ($_POST) { 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`"); @@ -717,6 +717,9 @@ if ($_POST) { 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"]) { @@ -761,7 +764,7 @@ if ($_POST) {

DB Install

 Anuko Time Tracker 1.17.13.3973 | Copyright © Anuko | +  Anuko Time Tracker 1.17.14.3974 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/WEB-INF/templates/profile_edit.tpl b/WEB-INF/templates/profile_edit.tpl index 4967259e..089ecead 100644 --- a/WEB-INF/templates/profile_edit.tpl +++ b/WEB-INF/templates/profile_edit.tpl @@ -160,6 +160,10 @@ function handlePluginCheckboxes() { {$i18n.label.week_start}: {$forms.profileForm.start_week.control}
{$i18n.form.profile.show_holidays}:{$forms.profileForm.show_holidays.control} {$i18n.label.what_is_it}
{$i18n.form.profile.tracking_mode}: {$forms.profileForm.tracking_mode.control} {$forms.profileForm.task_required.control}
-
Create database structure (v1.17.10) + Create database structure (v1.17.14)
(applies only to new installations, do not execute when updating)
@@ -797,8 +800,8 @@ if ($_POST) {
- Update database structure (v1.14 to v1.17.10) -
+ Update database structure (v1.14 to v1.17.14) +
diff --git a/mysql.sql b/mysql.sql index d6e1d2d3..dc07a1dd 100644 --- a/mysql.sql +++ b/mysql.sql @@ -32,7 +32,9 @@ CREATE TABLE `tt_teams` ( `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`) ); @@ -375,6 +377,7 @@ CREATE TABLE `tt_monthly_quotas` ( `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`) ); diff --git a/profile_edit.php b/profile_edit.php index 5839c7e0..eaa9b2ae 100644 --- a/profile_edit.php +++ b/profile_edit.php @@ -57,6 +57,7 @@ if ($request->isPost()) { $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'); @@ -90,6 +91,7 @@ if ($request->isPost()) { $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; @@ -168,6 +170,9 @@ if ($user->canManageTeam()) { } $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'); @@ -278,6 +283,11 @@ if ($request->isPost()) { $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, @@ -292,7 +302,8 @@ if ($request->isPost()) { '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(