X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/c1dab04d6ff59c3c8ced5d95b84090dd3bef03e1..4fb3e6fdb5dff1a08126d53fb4e8baec64074da7:/report.php diff --git a/report.php b/report.php index 9f29069d..b82380d7 100644 --- a/report.php +++ b/report.php @@ -27,17 +27,21 @@ // +----------------------------------------------------------------------+ require_once('initialize.php'); +import('ttConfigHelper'); import('form.Form'); import('form.ActionForm'); import('ttReportHelper'); import('ttGroupHelper'); import('ttTimesheetHelper'); -// Access check. +// Access checks. if (!(ttAccessAllowed('view_own_reports') || ttAccessAllowed('view_reports') || ttAccessAllowed('view_all_reports') || ttAccessAllowed('view_client_reports'))) { header('Location: access_denied.php'); exit(); } +// End of access checks. + +$config = new ttConfigHelper($user->getConfig()); if ($user->isPluginEnabled('ap')) { $cl_mark_approved_select_option = $request->getParameter('mark_approved_select_options', ($request->isPost() ? null : @$_SESSION['mark_approved_select_option'])); @@ -284,7 +288,7 @@ if ($report_items) { // Determine column span for note field. $colspan = 1; -if ($bean->getAttribute('chuser')) $colspan++; +if ($user->can('view_reports') || $user->can('view_all_reports') || $user->isClient()) $colspan++; if ($bean->getAttribute('chclient')) $colspan++; if ($bean->getAttribute('chproject')) $colspan++; if ($bean->getAttribute('chtask')) $colspan++; @@ -299,6 +303,7 @@ if ($bean->getAttribute('chpaid')) $colspan++; if ($bean->getAttribute('chip')) $colspan++; if ($bean->getAttribute('chinvoice')) $colspan++; if ($bean->getAttribute('chtimesheet')) $colspan++; +if ($bean->getAttribute('chfiles')) $colspan++; // Assign variables that are used to alternate color of rows for different dates. $smarty->assign('prev_date', ''); @@ -308,6 +313,7 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('report_items', $report_items); $smarty->assign('subtotals', $subtotals); $smarty->assign('totals', $totals); +$smarty->assign('note_on_separate_row', $user->getConfigOption('report_note_on_separate_row')); $smarty->assign('colspan', $colspan); $smarty->assign('bean', $bean); $smarty->assign('title', $i18n->get('title.report').": ".$totals['start_date']." - ".$totals['end_date']);