X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=reports.php;h=fdb2d2ed34e2c86d656f4e91851a4037b007ca95;hb=1e2a1839bd4b4530a43dfcdc3f0582623edd5486;hp=892b117ea0720b665de29e6e121fb6aa34916dd7;hpb=eb300930267977a1caac0355200467e4bdf8b655;p=timetracker.git diff --git a/reports.php b/reports.php index 892b117e..fdb2d2ed 100644 --- a/reports.php +++ b/reports.php @@ -38,7 +38,7 @@ import('ttClientHelper'); import('ttReportHelper'); // Access check. -if (!(ttAccessAllowed('view_own_reports') || ttAccessAllowed('view_reports') || ttAccessAllowed('view_all_reports'))) { +if (!(ttAccessAllowed('view_own_reports') || ttAccessAllowed('view_reports') || ttAccessAllowed('view_all_reports') || ttAccessAllowed('view_client_reports'))) { header('Location: access_denied.php'); exit(); } @@ -179,17 +179,24 @@ if ($showPaidStatus) { } // Add timesheet assignment selector. -$showTimesheet = $user->isPluginEnabled('ts') && - ($user->can('view_own_timesheets') || $user->can('manage_own_timesheets') || - $user->can('view_timesheets') || $user->can('manage_timesheets') || $user->can('approve_timesheets')); -if ($showTimesheet) { +$showTimesheetDropdown = $user->isPluginEnabled('ts') && + ($user->can('view_own_timesheets') || $user->can('view_timesheets') || + $user->can('view_all_timesheets') || ($user->can('view_client_timesheets') && $user->can('view_client_unapproved'))); +if ($showTimesheetDropdown) { $form->addInput(array('type'=>'combobox', 'name'=>'timesheet', 'style'=>'width: 250px;', - 'data'=>array('1'=>$i18n->get('form.reports.include_assigned'),'2'=>$i18n->get('form.reports.include_not_assigned')), + 'data'=>array(TIMESHEET_NOT_ASSIGNED=>$i18n->get('form.reports.include_not_assigned'), + TIMESHEET_ASSIGNED=>$i18n->get('form.reports.include_assigned'), + TIMESHEET_PENDING=>$i18n->get('form.reports.include_pending'), + TIMESHEET_APPROVED=>$i18n->get('form.reports.include_approved'), + TIMESHEET_NOT_APPROVED=>$i18n->get('form.reports.include_not_approved')), 'empty'=>array(''=>$i18n->get('dropdown.all')) )); } +$showTimesheetCheckbox = $user->isPluginEnabled('ts') && + ($user->can('view_own_timesheets') || $user->can('view_timesheets') || + $user->can('view_all_timesheets') || $user->can('view_client_timesheets')); // Add user table. $showUsers = $user->can('view_reports') || $user->can('view_all_reports') || $user->isClient(); @@ -270,11 +277,11 @@ $form->addInput(array('type'=>'checkbox','name'=>'chcost')); $showWorkUnits = $user->isPluginEnabled('wu'); if ($showWorkUnits) $form->addInput(array('type'=>'checkbox','name'=>'chunits')); -if ($showTimesheet) +if ($showTimesheetCheckbox) $form->addInput(array('type'=>'checkbox','name'=>'chtimesheet')); // Add a hidden control for timesheet_user_id (who to generate a timesheet for). -if ($showTimesheet) +if ($showTimesheetCheckbox) $form->addInput(array('type'=>'hidden','name'=>'timesheet_user_id')); // Add group by control. @@ -424,7 +431,8 @@ $smarty->assign('show_billable', $showBillable); $smarty->assign('show_invoice_dropdown', $showInvoiceDropdown); $smarty->assign('show_invoice_checkbox', $showInvoiceCheckbox); $smarty->assign('show_paid_status', $showPaidStatus); -$smarty->assign('show_timesheet', $showTimesheet); +$smarty->assign('show_timesheet_dropdown', $showTimesheetDropdown); +$smarty->assign('show_timesheet_checkbox', $showTimesheetCheckbox); $smarty->assign('show_users', $showUsers); $smarty->assign('show_start', $showStart); $smarty->assign('show_finish', $showFinish);