Started to replace canManageTeam calls with right checks.
authorNik Okuntseff <support@anuko.com>
Tue, 13 Mar 2018 22:30:55 +0000 (22:30 +0000)
committerNik Okuntseff <support@anuko.com>
Tue, 13 Mar 2018 22:30:55 +0000 (22:30 +0000)
WEB-INF/lib/ttExpenseHelper.class.php
WEB-INF/lib/ttFavReportHelper.class.php
WEB-INF/lib/ttUser.class.php
WEB-INF/templates/footer.tpl

index 533c438..7d63ba4 100644 (file)
@@ -70,7 +70,7 @@ class ttExpenseHelper {
     $invoice_id = $fields['invoice_id'];
 
     $paid_part = '';
-    if ($user->canManageTeam() && $user->isPluginEnabled('ps')) {
+    if ($user->can('manage_invoices') && $user->isPluginEnabled('ps')) {
       $paid_part = $fields['paid'] ? ', paid = 1' : ', paid = 0';
     }
 
index 06b745c..111e9b1 100644 (file)
@@ -171,7 +171,7 @@ class ttFavReportHelper {
 
       // If all users are selected - use a null value (which means "all users").
       $all_users_selected = true;
-      if ($user->canManageTeam()) {
+      if ($user->can('view_reports')) {
         $all = ttTeamHelper::getActiveUsers();
         foreach ($all as $one) {
           if (!in_array($one['id'], $users_in_bean)) {
@@ -260,7 +260,7 @@ class ttFavReportHelper {
         $bean->setAttribute('users', explode(',', $val['users']));
       else {
         // Null users value means "all users". Add them to the bean.
-        if ($user->canManageTeam()) {
+        if ($user->can('view_reports')) {
           $all = ttTeamHelper::getActiveUsers();
           foreach ($all as $one) {
             $all_user_ids[] = $one['id'];
index 2f7ff95..dd42a64 100644 (file)
@@ -154,7 +154,7 @@ class ttUser {
 
   // isAdmin - determines whether current user is admin (has right_administer_site).
   function isAdmin() {
-    return (right_administer_site & $this->role);
+    return $this->can('administer_site');
   }
 
   // isManager - determines whether current user is team manager.
index 364fc34..304b4e2 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.43.4069 | 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.43.4070 | 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>