From: Nik Okuntseff Date: Sat, 27 Apr 2019 15:55:42 +0000 (+0000) Subject: Adjusted week start for subgroups. X-Git-Tag: timetracker_1.19-1~35 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=040c6516659e15f360159859b783e3722e86f370;p=timetracker.git Adjusted week start for subgroups. --- diff --git a/WEB-INF/lib/Period.class.php b/WEB-INF/lib/Period.class.php index 0e901a8d..2d2269e5 100644 --- a/WEB-INF/lib/Period.class.php +++ b/WEB-INF/lib/Period.class.php @@ -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()); diff --git a/WEB-INF/lib/form/Calendar.class.php b/WEB-INF/lib/form/Calendar.class.php index 72da0e42..bd777ea9 100644 --- a/WEB-INF/lib/form/Calendar.class.php +++ b/WEB-INF/lib/form/Calendar.class.php @@ -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; } diff --git a/WEB-INF/lib/form/DateField.class.php b/WEB-INF/lib/form/DateField.class.php index f1487d04..a197126f 100644 --- a/WEB-INF/lib/form/DateField.class.php +++ b/WEB-INF/lib/form/DateField.class.php @@ -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 diff --git a/WEB-INF/lib/ttUser.class.php b/WEB-INF/lib/ttUser.class.php index 16e2d2d1..a40a5fda 100644 --- a/WEB-INF/lib/ttUser.class.php +++ b/WEB-INF/lib/ttUser.class.php @@ -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); diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index f5fa4690..44dea7a7 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.19.4.4994 | Copyright © Anuko | +  Anuko Time Tracker 1.19.4.4995 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/week.php b/week.php index 05d39921..6cb6f28a 100644 --- 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)