Adjusted week start for subgroups.
authorNik Okuntseff <support@anuko.com>
Sat, 27 Apr 2019 15:55:42 +0000 (15:55 +0000)
committerNik Okuntseff <support@anuko.com>
Sat, 27 Apr 2019 15:55:42 +0000 (15:55 +0000)
WEB-INF/lib/Period.class.php
WEB-INF/lib/form/Calendar.class.php
WEB-INF/lib/form/DateField.class.php
WEB-INF/lib/ttUser.class.php
WEB-INF/templates/footer.tpl
week.php

index 0e901a8..2d2269e 100644 (file)
@@ -69,7 +69,7 @@ class Period {
       $date_point = new DateAndTime(); // Represents current date. TODO: verify this is needed, as this is server time, not browser today.
 
     // TODO: refactoring ongoing down from here. Make code nicer, etc.
-    $weekStartDay = $user->week_start;
+    $weekStartDay = $user->getWeekStart();
 
                $this->startDate = new DateAndTime();
                $this->startDate->setFormat($date_point->getFormat());
index 72da0e4..bd777ea 100644 (file)
@@ -63,7 +63,7 @@ class Calendar extends FormElement {
       
       $this->mMonthNames = $i18n->monthNames;
       $this->mWeekDayShortNames = $i18n->weekdayShortNames;
-      $this->weekStartDay = $user->week_start;
+      $this->weekStartDay = $user->getWeekStart();
     }
 
     function setStyle($style) { $this->style = $style; }
index f1487d0..a197126 100644 (file)
@@ -57,7 +57,7 @@ class DateField extends TextField {
     $this->lCalendarButtons['close'] = $i18n->get('button.close');
 
     $this->mDateFormat = $user->getDateFormat();
-    $this->mWeekStartDay = $user->week_start;
+    $this->mWeekStartDay = $user->getWeekStart();
   }
 
   // set current value taken from session or database
index 16e2d2d..a40a5fd 100644 (file)
@@ -205,6 +205,11 @@ class ttUser {
     return ($this->behalfGroup ? $this->behalfGroup->time_format : $this->time_format);
   }
 
+  // getWeekStart returns week start day for active group.
+  function getWeekStart() {
+    return ($this->behalfGroup ? $this->behalfGroup->week_start : $this->week_start);
+  }
+
   // getTrackingMode returns tracking mode for active group.
   function getTrackingMode() {
     return ($this->behalfGroup ? $this->behalfGroup->tracking_mode : $this->tracking_mode);
index f5fa469..44dea7a 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.19.4.4994 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.19.4.4995 | 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 05d3992..6cb6f28 100644 (file)
--- a/week.php
+++ b/week.php
@@ -70,7 +70,7 @@ if(!$cl_date)
 $_SESSION['date'] = $cl_date;
 
 // Determine selected week start and end dates.
-$weekStartDay = $user->week_start;
+$weekStartDay = $user->getWeekStart();
 $t_arr = localtime($selected_date->getTimestamp());
 $t_arr[5] = $t_arr[5] + 1900;
 if ($t_arr[6] < $weekStartDay)