Ongoing refactoring, getting rid of canManageTeam().
authorNik Okuntseff <support@anuko.com>
Sat, 14 Apr 2018 12:16:20 +0000 (12:16 +0000)
committerNik Okuntseff <support@anuko.com>
Sat, 14 Apr 2018 12:16:20 +0000 (12:16 +0000)
WEB-INF/templates/footer.tpl
reports.php

index e1e4c9b..8853f5d 100644 (file)
@@ -12,7 +12,7 @@
       <br>
       <table cellspacing="0" cellpadding="4" width="100%" border="0">
         <tr>
-          <td align="center">&nbsp;Anuko Time Tracker 1.17.88.4263 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.17.88.4264 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
             <a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
             <a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
             <a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>
index 0028e99..11d1434 100644 (file)
@@ -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',