X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=week.php;h=05d399214d4d8e8677121006859f1a72d3a3442a;hb=ed41335d63e71a11d30e92f4367106e9398adf9d;hp=f18817d7d298e9fcf1b5e922eac43d7932426e0e;hpb=0f6454bb20d223018d0f969ab5e1d46f4ce14b96;p=timetracker.git diff --git a/week.php b/week.php index f18817d7..05d39921 100644 --- a/week.php +++ b/week.php @@ -57,6 +57,9 @@ 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. $cl_date = $request->getParameter('date', @$_SESSION['date']); $selected_date = new DateAndTime(DB_DATEFORMAT, $cl_date); @@ -128,7 +131,7 @@ $_SESSION['note'] = $cl_note; $dayHeaders = ttWeekViewHelper::getDayHeadersForWeek($startDate->toString(DB_DATEFORMAT)); $lockedDays = ttWeekViewHelper::getLockedDaysForWeek($startDate->toString(DB_DATEFORMAT)); // Get already existing records. -$records = ttWeekViewHelper::getRecordsForInterval($user->getUser(), $startDate->toString(DB_DATEFORMAT), $endDate->toString(DB_DATEFORMAT)); +$records = ttWeekViewHelper::getRecordsForInterval($startDate->toString(DB_DATEFORMAT), $endDate->toString(DB_DATEFORMAT), $showFiles); // Build data array for the table. Format is described in ttWeekViewHelper::getDataForWeekView function. if ($records) $dataArray = ttWeekViewHelper::getDataForWeekView($records, $dayHeaders); @@ -346,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']); @@ -506,7 +509,9 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $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('title', $i18n->get('title.time')); +$smarty->assign('show_navigation', !$user->getConfigOption('menu_week')); +$smarty->assign('show_client', $showClient); +$smarty->assign('show_files', $showFiles); +$smarty->assign('title', $i18n->get('menu.week')); $smarty->assign('content_page_name', 'week.tpl'); $smarty->display('index.tpl');