X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/ca3b5fef452a65d3c4f134676c8d960d10f3ab05..5d4953bb5ec09e6e79a114c71f53f410c6064f2e:/timesheets.php diff --git a/timesheets.php b/timesheets.php index fb513bee..191f7492 100644 --- a/timesheets.php +++ b/timesheets.php @@ -28,7 +28,7 @@ require_once('initialize.php'); import('form.Form'); -import('ttGroupHelper'); +import('ttTimesheetHelper'); // Access checks. if (!(ttAccessAllowed('view_own_timesheets') || @@ -40,15 +40,26 @@ if (!(ttAccessAllowed('view_own_timesheets') || exit(); } -if (!$user->isPluginEnabled('ts_NEVER_ENABLED')) { // Work in progress... +if (!$user->isPluginEnabled('ts')) { header('Location: feature_disabled.php'); exit(); } // End of access checks. -//$invoices = ttGroupHelper::getActiveInvoices(); +// TODO: determine user properly, using a dropdown. +$user_id = $user->getUser(); + +// TODO: fix this for client access. +$active_timesheets = ttTimesheetHelper::getActiveTimesheets($user_id); +$inactive_timesheets = ttTimesheetHelper::getInactiveTimesheets($user_id); +$show_client = $user->isPluginEnabled('cl') && !$user->isClient(); + +$smarty->assign('active_timesheets', $active_timesheets); +$smarty->assign('inactive_timesheets', $inactive_timesheets); +$smarty->assign('show_client', $show_client); +$smarty->assign('show_submit_status', !$user->isClient()); +$smarty->assign('show_approval_status', !$user->isClient()); -//$smarty->assign('invoices', $invoices); $smarty->assign('title', $i18n->get('title.timesheets')); -$smarty->assign('content_page_name', 'invoices.tpl'); // TODO: fix this, too. +$smarty->assign('content_page_name', 'timesheets.tpl'); $smarty->display('index.tpl');