From 813f43a9406fb5adfb8c6e89cd97b06a11da58c9 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Wed, 14 Mar 2018 16:07:50 +0000 Subject: [PATCH] Some more refactoring. --- WEB-INF/lib/ttTeamHelper.class.php | 2 +- WEB-INF/lib/ttTimeHelper.class.php | 2 +- WEB-INF/templates/cf_custom_field_add.tpl | 2 +- WEB-INF/templates/cf_custom_field_delete.tpl | 2 +- WEB-INF/templates/cf_custom_field_edit.tpl | 2 +- WEB-INF/templates/cf_custom_fields.tpl | 2 +- WEB-INF/templates/cf_dropdown_option_add.tpl | 2 +- WEB-INF/templates/cf_dropdown_option_delete.tpl | 2 +- WEB-INF/templates/cf_dropdown_option_edit.tpl | 2 +- WEB-INF/templates/cf_dropdown_options.tpl | 2 +- WEB-INF/templates/expense_edit.tpl | 2 +- WEB-INF/templates/footer.tpl | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/WEB-INF/lib/ttTeamHelper.class.php b/WEB-INF/lib/ttTeamHelper.class.php index 38a2d819..684fa63c 100644 --- a/WEB-INF/lib/ttTeamHelper.class.php +++ b/WEB-INF/lib/ttTeamHelper.class.php @@ -1054,7 +1054,7 @@ class ttTeamHelper { static function enablePlugin($plugin, $enable = true) { global $user; - if (!$user->canManageTeam()) + if (!$user->can('manage_features')) return false; $plugin_array = explode(',', $user->plugins); diff --git a/WEB-INF/lib/ttTimeHelper.class.php b/WEB-INF/lib/ttTimeHelper.class.php index 7cbf4dda..222bcca4 100644 --- a/WEB-INF/lib/ttTimeHelper.class.php +++ b/WEB-INF/lib/ttTimeHelper.class.php @@ -474,7 +474,7 @@ class ttTimeHelper { $billable_part = $fields['billable'] ? ', billable = 1' : ', billable = 0'; } $paid_part = ''; - if ($user->canManageTeam() && $user->isPluginEnabled('ps')) { + if ($user->can('manage_invoices') && $user->isPluginEnabled('ps')) { $paid_part = $fields['paid'] ? ', paid = 1' : ', paid = 0'; } diff --git a/WEB-INF/templates/cf_custom_field_add.tpl b/WEB-INF/templates/cf_custom_field_add.tpl index 04908bbd..442f41bb 100644 --- a/WEB-INF/templates/cf_custom_field_add.tpl +++ b/WEB-INF/templates/cf_custom_field_add.tpl @@ -2,7 +2,7 @@
-{if $user->canManageTeam()} +{if $user->can('manage_custom_fields')} diff --git a/WEB-INF/templates/cf_custom_field_delete.tpl b/WEB-INF/templates/cf_custom_field_delete.tpl index 00ad37ff..fae6d804 100644 --- a/WEB-INF/templates/cf_custom_field_delete.tpl +++ b/WEB-INF/templates/cf_custom_field_delete.tpl @@ -2,7 +2,7 @@
{$i18n.label.thing_name} (*):
-{if $user->canManageTeam()} +{if $user->can('manage_custom_fields')} diff --git a/WEB-INF/templates/cf_custom_field_edit.tpl b/WEB-INF/templates/cf_custom_field_edit.tpl index 5e4d57c4..beabbe7d 100644 --- a/WEB-INF/templates/cf_custom_field_edit.tpl +++ b/WEB-INF/templates/cf_custom_field_edit.tpl @@ -2,7 +2,7 @@
{$field|escape}
-{if $user->canManageTeam()} +{if $user->can('manage_custom_fields')} diff --git a/WEB-INF/templates/cf_custom_fields.tpl b/WEB-INF/templates/cf_custom_fields.tpl index 51e83769..7a1b156b 100644 --- a/WEB-INF/templates/cf_custom_fields.tpl +++ b/WEB-INF/templates/cf_custom_fields.tpl @@ -2,7 +2,7 @@
{$i18n.label.thing_name} (*):
-{if $user->canManageTeam()} +{if $user->can('manage_custom_fields')} diff --git a/WEB-INF/templates/cf_dropdown_option_add.tpl b/WEB-INF/templates/cf_dropdown_option_add.tpl index 5d892d13..bcc1cee7 100644 --- a/WEB-INF/templates/cf_dropdown_option_add.tpl +++ b/WEB-INF/templates/cf_dropdown_option_add.tpl @@ -2,7 +2,7 @@
{$i18n.label.thing_name}
-{if $user->canManageTeam()} +{if $user->can('manage_custom_fields')} diff --git a/WEB-INF/templates/cf_dropdown_option_delete.tpl b/WEB-INF/templates/cf_dropdown_option_delete.tpl index 6a273db0..bec03cc3 100644 --- a/WEB-INF/templates/cf_dropdown_option_delete.tpl +++ b/WEB-INF/templates/cf_dropdown_option_delete.tpl @@ -2,7 +2,7 @@
{$i18n.label.thing_name} (*):
-{if $user->canManageTeam()} +{if $user->can('manage_custom_fields')} diff --git a/WEB-INF/templates/cf_dropdown_option_edit.tpl b/WEB-INF/templates/cf_dropdown_option_edit.tpl index 84deaa22..c2b0bae9 100644 --- a/WEB-INF/templates/cf_dropdown_option_edit.tpl +++ b/WEB-INF/templates/cf_dropdown_option_edit.tpl @@ -2,7 +2,7 @@
{$option|escape}
-{if $user->canManageTeam()} +{if $user->can('manage_custom_fields')} diff --git a/WEB-INF/templates/cf_dropdown_options.tpl b/WEB-INF/templates/cf_dropdown_options.tpl index 2882d92c..ba15a416 100644 --- a/WEB-INF/templates/cf_dropdown_options.tpl +++ b/WEB-INF/templates/cf_dropdown_options.tpl @@ -6,7 +6,7 @@
{$i18n.label.thing_name} (*):
-{if $user->canManageTeam()} +{if $user->can('manage_custom_fields')} diff --git a/WEB-INF/templates/expense_edit.tpl b/WEB-INF/templates/expense_edit.tpl index 39198b88..953f78d5 100644 --- a/WEB-INF/templates/expense_edit.tpl +++ b/WEB-INF/templates/expense_edit.tpl @@ -150,7 +150,7 @@ function recalculateCost() { -{if ($user->canManageTeam() && $user->isPluginEnabled('ps'))} +{if ($user->can('manage_invoices') && $user->isPluginEnabled('ps'))} diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index f7e7f6bf..3807ef1d 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
{$i18n.label.thing_name}{$i18n.label.cost}: {$forms.expenseItemForm.cost.control} {$user->currency|escape}
 
-
 Anuko Time Tracker 1.17.43.4075 | Copyright © Anuko | +  Anuko Time Tracker 1.17.43.4076 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} -- 2.20.1