Removed show holidays config option.
[timetracker.git] / week.php
index af5b9eb..6cb6f28 100644 (file)
--- a/week.php
+++ b/week.php
@@ -57,6 +57,7 @@ if (!$user->behalf_id && !$user->can('track_own_time') && !$user->adjustBehalfId
 }
 // End of access checks.
 
+$showClient = $user->isPluginEnabled('cl');
 $showFiles = $user->isPluginEnabled('at');
 
 // Initialize and store date in session.
@@ -69,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)
@@ -348,7 +349,7 @@ if ($request->isPost()) {
       }
     }
     if ($newEntryPosted) {
-      if ($user->isPluginEnabled('cl') && $user->isPluginEnabled('cm') && !$cl_client)
+      if ($user->isPluginEnabled('cl') && $user->isOptionEnabled('client_required') && !$cl_client)
         $err->add($i18n->get('error.client'));
       if ($custom_fields) {
         if (!ttValidString($cl_cf_1, !$custom_fields->fields[0]['required'])) $err->add($i18n->get('error.field'), $custom_fields->fields[0]['label']);
@@ -509,7 +510,8 @@ $smarty->assign('onload', 'onLoad="fillDropdowns()"');
 $smarty->assign('timestring', $startDate->toString($user->date_format).' - '.$endDate->toString($user->date_format));
 $smarty->assign('time_records', $records);
 $smarty->assign('show_navigation', !$user->getConfigOption('menu_week'));
+$smarty->assign('show_client', $showClient);
 $smarty->assign('show_files', $showFiles);
-$smarty->assign('title', $i18n->get('title.time'));
+$smarty->assign('title', $i18n->get('menu.week'));
 $smarty->assign('content_page_name', 'week.tpl');
 $smarty->display('index.tpl');