From 53171dda875db008bc0ce6da98115dff6b3232e8 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 14 Apr 2018 12:16:20 +0000 Subject: [PATCH] Ongoing refactoring, getting rid of canManageTeam(). --- WEB-INF/templates/footer.tpl | 2 +- reports.php | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index e1e4c9b5..8853f5d3 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.17.88.4263 | Copyright © Anuko | +  Anuko Time Tracker 1.17.88.4264 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/reports.php b/reports.php index 0028e995..11d1434d 100644 --- a/reports.php +++ b/reports.php @@ -66,10 +66,11 @@ $form->addInput(array('type'=>'submit','name'=>'btn_generate','value'=>$i18n->ge $form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->get('label.delete'),'onclick'=>"return confirm('".$i18n->get('form.reports.confirm_delete')."')")); // Dropdown for clients if the clients plugin is enabled. -if ($user->isPluginEnabled('cl') && !($user->isClient() && $user->client_id)) { - if ($user->canManageTeam() || ($user->isClient() && !$user->client_id)) - $client_list = ttClientHelper::getClients(); - else +if ($user->isPluginEnabled('cl') && !$user->isClient()) { + if ($user->can('view_reports') || $user->can('view_all_reports')) { + $client_list = ttClientHelper::getClients(); // TODO: improve getClients for "view_reports" + // by filtering out not relevant clients. + } else $client_list = ttClientHelper::getClientsForUser(); $form->addInput(array('type'=>'combobox', 'name'=>'client', -- 2.20.1