A bit more role revamp related refactoring.
authorNik Okuntseff <support@anuko.com>
Wed, 14 Mar 2018 17:55:26 +0000 (17:55 +0000)
committerNik Okuntseff <support@anuko.com>
Wed, 14 Mar 2018 17:55:26 +0000 (17:55 +0000)
WEB-INF/lib/ttUser.class.php
WEB-INF/templates/clients.tpl
WEB-INF/templates/footer.tpl
WEB-INF/templates/header.tpl
WEB-INF/templates/mobile/clients.tpl

index dd42a64..f468f55 100644 (file)
@@ -206,8 +206,9 @@ class ttUser {
   function isDateLocked($date)
   {
     if ($this->isPluginEnabled('lk') && $this->lock_spec) {
-      // Override for managers.
-      if ($this->canManageTeam()) return false;
+
+      // Override.
+      if ($this->can('override_date_lock')) return false;
 
       require_once(LIBRARY_DIR.'/tdcron/class.tdcron.php');
       require_once(LIBRARY_DIR.'/tdcron/class.tdcron.entry.php');
index 5243daf..14c0332 100644 (file)
@@ -5,7 +5,7 @@
 <table cellspacing="0" cellpadding="7" border="0" width="720">
   <tr>
     <td valign="top">
-{if ($user->canManageTeam())}
+{if $user->can('manage_clients')}
       <table cellspacing="1" cellpadding="3" border="0" width="100%">
   {if $inactive_clients}
         <tr><td class="sectionHeaderNoBorder">{$i18n.form.clients.active_clients}</td></tr>
index 04ae2bd..5e9768d 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.44.4077 | 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.44.4078 | 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 4e4a414..e0fd805 100644 (file)
             &middot; <a class="mainMenu" href="expenses.php">{$i18n.menu.expenses}</a>
     {/if}
             {if !$user->isClient()}&middot; {/if}<a class="mainMenu" href="reports.php">{$i18n.menu.reports}</a>
-    {if ($user->canManageTeam() || $user->isClient()) && $user->isPluginEnabled('iv')}
+    {if $user->isPluginEnabled('iv') && ($user->can('manage_invoices') || $user->can('view_own_invoices'))}
             &middot; <a class="mainMenu" href="invoices.php">{$i18n.title.invoices}</a>
     {/if}
     {if ($user->isPluginEnabled('ch') && !$user->isClient()) && ($smarty.const.MODE_PROJECTS == $user->tracking_mode
     {if !$user->isClient() && ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
             &middot; <a class="mainMenu" href="projects.php">{$i18n.menu.projects}</a>
     {/if}
-    {if $user->canManageTeam() && ($smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
+    {if ($smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode) && $user->can('manage_tasks')}
             &middot; <a class="mainMenu" href="tasks.php">{$i18n.menu.tasks}</a>
     {/if}
     {if !$user->isClient()}
             &middot; <a class="mainMenu" href="users.php">{$i18n.menu.users}</a>
     {/if}
-    {if $user->canManageTeam() && $user->isPluginEnabled('cl')}
+    {if $user->isPluginEnabled('cl') && $user->can('manage_clients')}
             &middot; <a class="mainMenu" href="clients.php">{$i18n.menu.clients}</a>
     {/if}
     {if $user->isManager()}
index a052027..c10541f 100644 (file)
@@ -5,7 +5,7 @@
 <table class="mobile-table">
   <tr>
     <td valign="top">
-{if ($user->canManageTeam())}
+{if $user->can('manage_clients')}
       <table class="mobile-table-details">
   {if $inactive_clients}
         <tr><td class="sectionHeaderNoBorder">{$i18n.form.clients.active_clients}</td></tr>