X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/75b65e92b21d45e2b09fb12daef169fb214a7acd..9819bb63bec83c13dd40ebb2ffc24df5fcfeda33:/WEB-INF/lib/form/Calendar.class.php diff --git a/WEB-INF/lib/form/Calendar.class.php b/WEB-INF/lib/form/Calendar.class.php index 4c835f62..f160cfa6 100644 --- a/WEB-INF/lib/form/Calendar.class.php +++ b/WEB-INF/lib/form/Calendar.class.php @@ -171,16 +171,18 @@ class Calendar extends FormElement { $stl_cell = ' class="CalendarDay"'; } - // holidays - //if ($this->showHolidays) { - global $user; - if ($user->show_holidays) { - foreach ($this->holidays as $day) { - if($day == $date) { - $stl_cell = ' class="CalendarDayHoliday"'; - $stl_link = ' class="CalendarLinkHoliday"'; - } - } + // Handle holidays. + // Prepare a date to check in DB_DATEFORMAT. + $date_to_check = "$thisyear-"; + if (strlen($thismonth) == 1) $date_to_check .= '0'; + $date_to_check .= "$thismonth-"; + if (strlen($start_date+$j) == 1) $date_to_check .= '0'; + $date_to_check .= $start_date+$j; + + // Check if it falls on a holiday. + if (ttTimeHelper::isHoliday2($date_to_check)) { + $stl_cell = ' class="CalendarDayHoliday"'; + $stl_link = ' class="CalendarLinkHoliday"'; } // selected day @@ -260,7 +262,7 @@ class Calendar extends FormElement { function _getActiveDates($start, $end) { global $user; - $user_id = $user->getActiveUser(); + $user_id = $user->getUser(); $table = ($this->highlight == 'expenses') ? 'tt_expense_items' : 'tt_log';