From: bonnedav Date: Sat, 24 Mar 2018 21:39:39 +0000 (-0600) Subject: Refactor header to use user rights. (#57) X-Git-Tag: timetracker_1.19-1~948 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=e02d7592b0556895e35f4d028939197c132f6b09;p=timetracker.git Refactor header to use user rights. (#57) * Refactor header to use user rights. * use "manage_own_settings" for porfile link --- diff --git a/WEB-INF/templates/header.tpl b/WEB-INF/templates/header.tpl index 1d662216..9ed099a6 100644 --- a/WEB-INF/templates/header.tpl +++ b/WEB-INF/templates/header.tpl @@ -83,7 +83,9 @@   {$i18n.menu.logout} · - {$i18n.menu.profile} · + {if $user->can('manage_own_settings')} + {$i18n.menu.profile} · + {/if} {$i18n.menu.forum} · {$i18n.menu.help} @@ -95,33 +97,35 @@
  - {if !$user->isClient()} + {if $user->can('track_time') || $user->can('track_own_time')} {$i18n.menu.time} {/if} - {if $user->isPluginEnabled('ex') && !$user->isClient()} + {if $user->isPluginEnabled('ex') && ($user->can('track_expenses') || $user->can('track_own_expenses'))} · {$i18n.menu.expenses} {/if} - {if !$user->isClient()}· {/if}{$i18n.menu.reports} + {if $user->can('view_invoices') || $user->can('view_own_reports')} + · {$i18n.menu.reports} + {/if} {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 + {if ($user->isPluginEnabled('ch') && ($user->can('view_charts') || $user->can('view_own_charts'))) && ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode || $user->isPluginEnabled('cl'))} · {$i18n.menu.charts} {/if} - {if !$user->isClient() && ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)} + {if $user->can('manage_projects') && ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)} · {$i18n.menu.projects} {/if} {if ($smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode) && $user->can('manage_tasks')} · {$i18n.menu.tasks} {/if} - {if !$user->isClient()} + {if $user->can('view_users') || $user->can('manage_users')} · {$i18n.menu.users} {/if} {if $user->isPluginEnabled('cl') && $user->can('manage_clients')} · {$i18n.menu.clients} {/if} - {if $user->isManager()} + {if $user->can('export_data')} · {$i18n.menu.export} {/if}