isPluginEnabled('ts')) { header('Location: feature_disabled.php'); exit(); } $timesheet_id = (int)$request->getParameter('id'); $timesheet = ttTimesheetHelper::getTimesheet($timesheet_id); if (!$timesheet) { header('Location: access_denied.php'); exit(); } // TODO: add other checks here for timesheet being appropriate for user role. // End of access checks. $options = ttTimesheetHelper::getReportOptions($timesheet); $subtotals = ttReportHelper::getSubtotals($options); $totals = ttReportHelper::getTotals($options); $smarty->assign('group_by_header', ttReportHelper::makeGroupByHeader($options)); $smarty->assign('timesheet', $timesheet); $smarty->assign('subtotals', $subtotals); $smarty->assign('totals', $totals); $smarty->assign('title', $i18n->get('title.timesheet')); $smarty->assign('content_page_name', 'timesheet_view.tpl'); $smarty->display('index.tpl');