From bb0efb2361495ba1e24d1214d104600b93d36f7f Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Wed, 14 Mar 2018 17:55:26 +0000 Subject: [PATCH] A bit more role revamp related refactoring. --- WEB-INF/lib/ttUser.class.php | 5 +++-- WEB-INF/templates/clients.tpl | 2 +- WEB-INF/templates/footer.tpl | 2 +- WEB-INF/templates/header.tpl | 6 +++--- WEB-INF/templates/mobile/clients.tpl | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/WEB-INF/lib/ttUser.class.php b/WEB-INF/lib/ttUser.class.php index dd42a64c..f468f552 100644 --- a/WEB-INF/lib/ttUser.class.php +++ b/WEB-INF/lib/ttUser.class.php @@ -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'); diff --git a/WEB-INF/templates/clients.tpl b/WEB-INF/templates/clients.tpl index 5243daf4..14c03321 100644 --- a/WEB-INF/templates/clients.tpl +++ b/WEB-INF/templates/clients.tpl @@ -5,7 +5,7 @@
-{if ($user->canManageTeam())} +{if $user->can('manage_clients')} {if $inactive_clients} diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 04ae2bd1..5e9768d1 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
{$i18n.form.clients.active_clients}
-
 Anuko Time Tracker 1.17.44.4077 | Copyright © Anuko | +  Anuko Time Tracker 1.17.44.4078 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/WEB-INF/templates/header.tpl b/WEB-INF/templates/header.tpl index 4e4a4146..e0fd8057 100644 --- a/WEB-INF/templates/header.tpl +++ b/WEB-INF/templates/header.tpl @@ -102,7 +102,7 @@ · {$i18n.menu.expenses} {/if} {if !$user->isClient()}· {/if}{$i18n.menu.reports} - {if ($user->canManageTeam() || $user->isClient()) && $user->isPluginEnabled('iv')} + {if $user->isPluginEnabled('iv') && ($user->can('manage_invoices') || $user->can('view_own_invoices'))} · {$i18n.title.invoices} {/if} {if ($user->isPluginEnabled('ch') && !$user->isClient()) && ($smarty.const.MODE_PROJECTS == $user->tracking_mode @@ -112,13 +112,13 @@ {if !$user->isClient() && ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)} · {$i18n.menu.projects} {/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')} · {$i18n.menu.tasks} {/if} {if !$user->isClient()} · {$i18n.menu.users} {/if} - {if $user->canManageTeam() && $user->isPluginEnabled('cl')} + {if $user->isPluginEnabled('cl') && $user->can('manage_clients')} · {$i18n.menu.clients} {/if} {if $user->isManager()} diff --git a/WEB-INF/templates/mobile/clients.tpl b/WEB-INF/templates/mobile/clients.tpl index a052027b..c10541fa 100644 --- a/WEB-INF/templates/mobile/clients.tpl +++ b/WEB-INF/templates/mobile/clients.tpl @@ -5,7 +5,7 @@
-{if ($user->canManageTeam())} +{if $user->can('manage_clients')} {if $inactive_clients} -- 2.20.1
{$i18n.form.clients.active_clients}