From: Nik Okuntseff Date: Sat, 14 Apr 2018 12:40:32 +0000 (+0000) Subject: More progress on replacing canManagerTeam() with rights checks. X-Git-Tag: timetracker_1.19-1~836 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=71d06cc16c8a2a70c69e06ea1bf9140b57e1554d;p=timetracker.git More progress on replacing canManagerTeam() with rights checks. --- diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 8853f5d3..09a969e4 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
- + {if $user->can('manage_invoices')} + {/if} + {if $user->can('manage_invoices')} + {/if} {/if} {if ($user->can('manage_invoices') && $user->isPluginEnabled('ps'))} diff --git a/reports.php b/reports.php index 11d1434d..bc6d8fc0 100644 --- a/reports.php +++ b/reports.php @@ -90,8 +90,8 @@ if ($custom_fields && $custom_fields->fields[0] && $custom_fields->fields[0]['ty } // Add controls for projects and tasks. -if ($user->canManageTeam()) { - $project_list = ttProjectHelper::getProjects(); // Manager and co-managers can run reports on all active and inactive projects. +if ($user->can('view_reports') || $user->can('view_all_reports')) { + $project_list = ttProjectHelper::getProjects(); // All active and inactive projects. } elseif ($user->isClient()) { $project_list = ttProjectHelper::getProjectsForClient(); } else { @@ -124,15 +124,17 @@ $form->addInput(array('type'=>'combobox', 'empty'=>array(''=>$i18n->get('dropdown.all')))); // Add invoiced / not invoiced selector. -$invoice_options = array('1'=>$i18n->get('form.reports.include_invoiced'), - '2'=>$i18n->get('form.reports.include_not_invoiced')); -$form->addInput(array('type'=>'combobox', - 'name'=>'invoice', - 'style'=>'width: 250px;', - 'data'=>$invoice_options, - 'empty'=>array(''=>$i18n->get('dropdown.all')))); +if ($user->can('manage_invoices')) { + $invoice_options = array('1'=>$i18n->get('form.reports.include_invoiced'), + '2'=>$i18n->get('form.reports.include_not_invoiced')); + $form->addInput(array('type'=>'combobox', + 'name'=>'invoice', + 'style'=>'width: 250px;', + 'data'=>$invoice_options, + 'empty'=>array(''=>$i18n->get('dropdown.all')))); +} -if ($user->canManageTeam() && $user->isPluginEnabled('ps')) { +if ($user->can('manage_invoices') && $user->isPluginEnabled('ps')) { $form->addInput(array('type'=>'combobox', 'name'=>'paid_status', 'style'=>'width: 250px;',
 Anuko Time Tracker 1.17.88.4264 | Copyright © Anuko | +  Anuko Time Tracker 1.17.88.4265 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/WEB-INF/templates/reports.tpl b/WEB-INF/templates/reports.tpl index 640a55ca..8aa7f6de 100644 --- a/WEB-INF/templates/reports.tpl +++ b/WEB-INF/templates/reports.tpl @@ -201,13 +201,17 @@ function handleCheckboxes() {
{$i18n.form.time.billable}  {$i18n.label.invoice}
{$forms.reportForm.include_records.control}  {$forms.reportForm.invoice.control}