From 05b0f8e4762b8a2ca2002a8f7545b7ff68cc3925 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Wed, 30 Mar 2016 19:09:24 +0000 Subject: [PATCH] Refactoring, finished replacing with ttUser::isPluginEnabled(). --- WEB-INF/lib/ttReportHelper.class.php | 4 ++-- WEB-INF/templates/footer.tpl | 2 +- invoice_view.php | 2 +- mobile/time.php | 2 +- mobile/time_edit.php | 2 +- mobile/timer.php | 2 +- report.php | 2 +- reports.php | 2 +- time_edit.php | 2 +- tofile.php | 2 +- topdf.php | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/WEB-INF/lib/ttReportHelper.class.php b/WEB-INF/lib/ttReportHelper.class.php index b4557f14..ae90374c 100644 --- a/WEB-INF/lib/ttReportHelper.class.php +++ b/WEB-INF/lib/ttReportHelper.class.php @@ -1055,7 +1055,7 @@ class ttReportHelper { $totals = ttReportHelper::getTotals($bean); // Use custom fields plugin if it is enabled. - if (in_array('cf', explode(',', $user->plugins))) + if ($user->isPluginEnabled('cf')) $custom_fields = new CustomFields($user->team_id); // Define some styles to use in email. @@ -1313,7 +1313,7 @@ class ttReportHelper { $totals = ttReportHelper::getFavTotals($report); // Use custom fields plugin if it is enabled. - if (in_array('cf', explode(',', $user->plugins))) + if ($user->isPluginEnabled('cf')) $custom_fields = new CustomFields($user->team_id); // Define some styles to use in email. diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index b55bc06a..0c671c4e 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.9.20.3461 | Copyright © Anuko | +  Anuko Time Tracker 1.9.20.3462 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/invoice_view.php b/invoice_view.php index a40d9b67..2bb98763 100644 --- a/invoice_view.php +++ b/invoice_view.php @@ -52,7 +52,7 @@ $tax = 0; foreach($invoice_items as $item) $subtotal += $item['cost']; if ($tax_percent) { - $tax_expenses = in_array('et', explode(',', $user->plugins)); + $tax_expenses = $user->isPluginEnabled('et'); foreach($invoice_items as $item) { if ($item['type'] == 2 && !$tax_expenses) continue; diff --git a/mobile/time.php b/mobile/time.php index b7a26b64..8b20cac8 100644 --- a/mobile/time.php +++ b/mobile/time.php @@ -54,7 +54,7 @@ $prev_date = date('Y-m-d', strtotime('-1 day', strtotime($cl_date))); $next_date = date('Y-m-d', strtotime('+1 day', strtotime($cl_date))); // Use custom fields plugin if it is enabled. -if (in_array('cf', explode(',', $user->plugins))) { +if ($user->isPluginEnabled('cf')) { require_once('../plugins/CustomFields.class.php'); $custom_fields = new CustomFields($user->team_id); $smarty->assign('custom_fields', $custom_fields); diff --git a/mobile/time_edit.php b/mobile/time_edit.php index f2083ee4..052ec1f1 100644 --- a/mobile/time_edit.php +++ b/mobile/time_edit.php @@ -41,7 +41,7 @@ if (!ttAccessCheck(right_data_entry)) { } // Use custom fields plugin if it is enabled. -if (in_array('cf', explode(',', $user->plugins))) { +if ($user->isPluginEnabled('cf')) { require_once('../plugins/CustomFields.class.php'); $custom_fields = new CustomFields($user->team_id); $smarty->assign('custom_fields', $custom_fields); diff --git a/mobile/timer.php b/mobile/timer.php index 949d585c..1ccc7893 100644 --- a/mobile/timer.php +++ b/mobile/timer.php @@ -51,7 +51,7 @@ $_SESSION['date'] = $cl_date; // TODO: for time page we may limit the day to today only. // Use custom fields plugin if it is enabled. -if (in_array('cf', explode(',', $user->plugins))) { +if ($user->isPluginEnabled('cf')) { require_once('../plugins/CustomFields.class.php'); $custom_fields = new CustomFields($user->team_id); $smarty->assign('custom_fields', $custom_fields); diff --git a/report.php b/report.php index dd4b9be3..a18ff1f1 100644 --- a/report.php +++ b/report.php @@ -39,7 +39,7 @@ if (!ttAccessCheck(right_view_reports)) { } // Use custom fields plugin if it is enabled. -if (in_array('cf', explode(',', $user->plugins))) { +if ($user->isPluginEnabled('cf')) { require_once('plugins/CustomFields.class.php'); $custom_fields = new CustomFields($user->team_id); $smarty->assign('custom_fields', $custom_fields); diff --git a/reports.php b/reports.php index 4947e4d9..add2b43f 100644 --- a/reports.php +++ b/reports.php @@ -43,7 +43,7 @@ if (!ttAccessCheck(right_view_reports)) { } // Use custom fields plugin if it is enabled. -if (in_array('cf', explode(',', $user->plugins))) { +if ($user->isPluginEnabled('cf')) { require_once('plugins/CustomFields.class.php'); $custom_fields = new CustomFields($user->team_id); $smarty->assign('custom_fields', $custom_fields); diff --git a/time_edit.php b/time_edit.php index 18638b07..a3421a8d 100644 --- a/time_edit.php +++ b/time_edit.php @@ -41,7 +41,7 @@ if (!ttAccessCheck(right_data_entry)) { } // Use custom fields plugin if it is enabled. -if (in_array('cf', explode(',', $user->plugins))) { +if ($user->isPluginEnabled('cf')) { require_once('plugins/CustomFields.class.php'); $custom_fields = new CustomFields($user->team_id); $smarty->assign('custom_fields', $custom_fields); diff --git a/tofile.php b/tofile.php index 26d1cbae..299b4a10 100644 --- a/tofile.php +++ b/tofile.php @@ -38,7 +38,7 @@ if (!ttAccessCheck(right_view_reports)) { } // Use custom fields plugin if it is enabled. -if (in_array('cf', explode(',', $user->plugins))) { +if ($user->isPluginEnabled('cf')) { require_once('plugins/CustomFields.class.php'); $custom_fields = new CustomFields($user->team_id); } diff --git a/topdf.php b/topdf.php index 0126bc61..d017299b 100644 --- a/topdf.php +++ b/topdf.php @@ -49,7 +49,7 @@ if (!ttAccessCheck(right_view_reports)) { } // Use custom fields plugin if it is enabled. -if (in_array('cf', explode(',', $user->plugins))) { +if ($user->isPluginEnabled('cf')) { require_once('plugins/CustomFields.class.php'); $custom_fields = new CustomFields($user->team_id); } -- 2.20.1