]> wagnertech.de Git - timetracker.git/commitdiff
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 dd42a64c46e4520e5fb727186e2698b0fba3ab44..f468f5522d3b94b26786eb284c79c37d61ec1a00 100644 (file)
@@ -206,8 +206,9 @@ class ttUser {
   function isDateLocked($date)
   {
     if ($this->isPluginEnabled('lk') && $this->lock_spec) {
   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');
 
       require_once(LIBRARY_DIR.'/tdcron/class.tdcron.php');
       require_once(LIBRARY_DIR.'/tdcron/class.tdcron.entry.php');
index 5243daf4231f2cac8b2cd419ee536e0052ceb0f5..14c03321d6eb987fc2df537d29255e76b78b1b19 100644 (file)
@@ -5,7 +5,7 @@
 <table cellspacing="0" cellpadding="7" border="0" width="720">
   <tr>
     <td valign="top">
 <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>
       <table cellspacing="1" cellpadding="3" border="0" width="100%">
   {if $inactive_clients}
         <tr><td class="sectionHeaderNoBorder">{$i18n.form.clients.active_clients}</td></tr>
index 04ae2bd11e69f574d6b63e3a8a59bcda867fea14..5e9768d12036d4a2cc2b473565f24605678564fb 100644 (file)
@@ -12,7 +12,7 @@
       <br>
       <table cellspacing="0" cellpadding="4" width="100%" border="0">
         <tr>
       <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>
             <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 4e4a4146495e88e7e1e95b694cfa0ec0c967ee74..e0fd8057a5d99beb1644ad71403ddb4fb5590dd9 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>
             &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
             &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->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}
             &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()}
             &middot; <a class="mainMenu" href="clients.php">{$i18n.menu.clients}</a>
     {/if}
     {if $user->isManager()}
index a052027b1015292d6181a096afb7438945660947..c10541faefc090c3ca54ef7fb3597c5abaf75b5d 100644 (file)
@@ -5,7 +5,7 @@
 <table class="mobile-table">
   <tr>
     <td valign="top">
 <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>
       <table class="mobile-table-details">
   {if $inactive_clients}
         <tr><td class="sectionHeaderNoBorder">{$i18n.form.clients.active_clients}</td></tr>