]> wagnertech.de Git - timetracker.git/commitdiff
Made show_holidays configurable as per issue #53.
authorNik Okuntseff <support@anuko.com>
Sun, 11 Feb 2018 00:01:43 +0000 (00:01 +0000)
committerNik Okuntseff <support@anuko.com>
Sun, 11 Feb 2018 00:01:43 +0000 (00:01 +0000)
39 files changed:
WEB-INF/lib/I18n.class.php
WEB-INF/lib/form/Calendar.class.php
WEB-INF/lib/ttTeamHelper.class.php
WEB-INF/lib/ttTimeHelper.class.php
WEB-INF/lib/ttUser.class.php
WEB-INF/resources/ca.lang.php
WEB-INF/resources/cs.lang.php
WEB-INF/resources/da.lang.php
WEB-INF/resources/de.lang.php
WEB-INF/resources/en.lang.php
WEB-INF/resources/es.lang.php
WEB-INF/resources/et.lang.php
WEB-INF/resources/fa.lang.php
WEB-INF/resources/fi.lang.php
WEB-INF/resources/fr.lang.php
WEB-INF/resources/he.lang.php
WEB-INF/resources/hu.lang.php
WEB-INF/resources/it.lang.php
WEB-INF/resources/ja.lang.php
WEB-INF/resources/ko.lang.php
WEB-INF/resources/nl.lang.php
WEB-INF/resources/no.lang.php
WEB-INF/resources/pl.lang.php
WEB-INF/resources/pt-br.lang.php
WEB-INF/resources/pt.lang.php
WEB-INF/resources/ro.lang.php
WEB-INF/resources/ru.lang.php
WEB-INF/resources/sk.lang.php
WEB-INF/resources/sl.lang.php
WEB-INF/resources/sr.lang.php
WEB-INF/resources/sv.lang.php
WEB-INF/resources/tr.lang.php
WEB-INF/resources/zh-cn.lang.php
WEB-INF/resources/zh-tw.lang.php
WEB-INF/templates/footer.tpl
WEB-INF/templates/profile_edit.tpl
dbinstall.php
mysql.sql
profile_edit.php

index fd158f58c778324ecb39678fa7896c3c5b469282..7155edb0c2b2c855bf1cb255a4a55ce100b99910 100644 (file)
@@ -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, ".");
index 1340c987317e12eb52f2ee431621d70b4de1ec4b..555b6e149ac5a9b81cf26ee3ce0f7ded08bc3a16 100644 (file)
@@ -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"';
index 217c07adb2b8599b405556948a589b95e0f70633..b308996382b1fa72b6be4daa1bbf103b3056c39a 100644 (file)
@@ -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;
 
index 6b1efe0dbc67e3c5875ce6964bf306d4a1ce734d..f5c3e93824376a55e61de02de5aaed3338c09faa 100644 (file)
@@ -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));
index 565e47adcbd77845b5aff47ac042460aac85b4b4..f04b499648bb3ebb56734c1a4f8554b1b09d7d06 100644 (file)
@@ -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'];
index 3dd011aabe4b43ef9127d1f80ed1aa47f00030a3..e7085ba7f3ddfbe26e9cbd2d6c3c59bf6798ed1c 100644 (file)
@@ -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',
index 8639a9ab118c16af361d572dd5879de3c6b051ee..ee5a92389b4d5e2a327df37f5fdce7eea4c8f564 100644 (file)
@@ -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',
index 1624695ef1469f27096e3880c29188367416e661..b3205646c99c3068161a65852148b24f8eb3a8ea 100644 (file)
@@ -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',
index a3d13850c64a6d7bb4ab5c42185e94802af8fd3f..d6958825d1da5b70d636457e6c40e29271b3f454 100644 (file)
@@ -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',
index bcdbd0195e0c819ff3dbbe435b89c974ab813183..1009a0f4a660f24e6ad03ec60d6075a6736095bd 100644 (file)
@@ -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',
index 4befd52a6c21aaa5776432f2ffdaadece6012e69..57139b00892a8e94afcd1d87a75e8f4d54b70aea 100644 (file)
@@ -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',
index ce85164279c30c60c66155be5291065cb8d0f326..2ff634e24451d675ef343a44af564c8b1f687895 100644 (file)
@@ -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',
index 9ec505cfe0e6579f88bddb34e30e87f5873d6ada..80193ce700331d3f198d1b970547ac3a458bd0eb 100644 (file)
@@ -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' => 'پروژه ها',
index b12941804bea53756eec414780c95520b55b8210..e340d886b258470258abadd11cb89feb953f3c7a 100644 (file)
@@ -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',
index 23b1d98714c98426b27a8f5413911d46c4e6dd7b..d2ca6cd1ae1bdcc6403fc4def4e451c1e2bc635f 100644 (file)
@@ -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',
index 526610d56e8b5712fa2aa2be0bd2018ad0d50d13..bd2c59803e50298b7c870af54b938248ad541a07 100644 (file)
@@ -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' => 'פרוייקטים',
index 217bbcc6efddf528212898cfc70ff2b9ddb71fad..b8ea9539ee5810bd0d0c09a0a04b0218c54851b8 100644 (file)
@@ -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',
index 51bb09fab6dce674afa9667cad119bacd16afc18..c2af59cf005fd863e04064f9a3e22a9022dac27f 100644 (file)
@@ -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',
index bc25f01fc97054da56818fd3d1ecf4ae237c5812..292d844bd62eb37fcb649c408c94869bb14df5eb 100644 (file)
@@ -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',
index bf5d7633e2e6abbb17bdb9d689f8b8bd54b88fcb..323607f2b142f5d860e06b2fce96f9985e8cc895 100644 (file)
@@ -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',
index ddc13fbc587baec0780f74112bf2c01559cb4f0e..aabb7ad755425bcd91d339ad14b129652388f365 100644 (file)
@@ -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',
index 533e3285d675d3532560a7760a46335a5386c592..b8b9bc3b13434889360c53757e646dcf2454fdf1 100644 (file)
@@ -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',
index 2f41e579ea8cf292421ea1043f84547a087ac397..ae6126a3f340fed1ce4d3c588dca2609922981dc 100644 (file)
@@ -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',
index 12761d51659b4655fc696b6b12b15c3828138a39..df75ffa2ac514a0dbbf0eb1971fc10159277dc0e 100644 (file)
@@ -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',
index c5ef6fd7530597ccf06ccb5f0ffb3937ed8d5615..852f1987fce5211f416ce927d566b7a953dfad71 100644 (file)
@@ -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',
index 6052a337d3e8fb501081d3ee1d5e4a95a8092a42..7277bcdfe2a4161c28c64bf2a2ff5caf27084143 100644 (file)
@@ -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',
index da15dfab212b0d1c32c4070e57febb8d9da6da33..74a7f14237b25fe78cb527c69a18d8f27e282b25 100644 (file)
@@ -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' => 'проекты',
index ff4948bd3a5cc76f2236c5d5ffb3e4de19932b11..aa6b48c6d97d78f9ed96a4fd1850f25361277323 100644 (file)
@@ -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',
index bceace78d08b0ad6db24d8059b1ed528a53b8321..c9f69a1eaa7b2f5bb5a84803c38650e220fd0550 100644 (file)
@@ -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',
index 4bd5d66a0661aac3cf3010a1df2fc07646b16e33..2d3f82c138e76ab1fec2504287cf8c40cfd20a82 100644 (file)
@@ -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',
index 5869578480a00d50b7e6a3a47befde3ff6d96b94..ac9cba05bcb61fa8ae4d9cd736aa4888286f6ea6 100644 (file)
@@ -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',
index f51d3fde0322e0ea8336cbfabe8df9bbe2cfe75d..fe48880229e0d43bc00de849fc9d473172cc234a 100644 (file)
@@ -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',
index 7d35e157f11fef30e4f1a2639b7933e536e3c43c..bc08f8a44f0b2fceaf7ca0623c77ac35069fb4dd 100644 (file)
@@ -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',
index 01b71c3da5d05849303be04910fddfc858419e24..09a49e9971277dcc614c1dff5e10c42152473472 100644 (file)
@@ -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',
index 347a2449899fab9f57e21b30ef565f3146752ce6..593d07d0f2296a915cd6417ab6acb1edd537cc20 100644 (file)
@@ -12,7 +12,7 @@
       <br>
       <table cellspacing="0" cellpadding="4" width="100%" border="0">
         <tr>
-          <td align="center">&nbsp;Anuko Time Tracker 1.17.13.3973 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.17.14.3974 | Copyright &copy; <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>
index 4967259e0bb8109e4864a661ed14f6b0398c2390..089ecead4a83fe5423f46a0c338c7ec077c8e409 100644 (file)
@@ -160,6 +160,10 @@ function handlePluginCheckboxes() {
             <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>
index 00b9c382d5954716493e2b696615f4d8ff4179c7..58467bc1cf348c98f17d0d0c00cc66e6d587ca9e 100755 (executable)
@@ -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) {
 <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>
@@ -797,8 +800,8 @@ if ($_POST) {
     <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>
 
index d6e1d2d321032c47f39ae04ae135ecd75b9b8fde..dc07a1dde99d65809df9d12c8dabbba93edb6bea 100644 (file)
--- 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`)
 );
 
index 5839c7e0f2c1bebafc57e3fa266d93b9f41226f4..eaa9b2ae3d7716f65152afeac0a0001b39a4a3e6 100644 (file)
@@ -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(