Wrote ttPluginEnabled() function.
authorNik Okuntseff <support@anuko.com>
Wed, 30 Mar 2016 15:32:42 +0000 (15:32 +0000)
committerNik Okuntseff <support@anuko.com>
Wed, 30 Mar 2016 15:32:42 +0000 (15:32 +0000)
WEB-INF/lib/common.lib.php
WEB-INF/templates/footer.tpl
time.php

index 124b78f..3644c05 100644 (file)
@@ -340,3 +340,10 @@ function ttAccessCheck($required_rights)
     
   return true;
 }
+
+// ttPluginEnabled is used to check whether a plugin is enabled for user.
+function ttPluginEnabled($plugin)
+{
+  global $user;
+  return in_array($plugin, explode(',', $user->plugins));
+}
index ce53f6d..5a4923c 100644 (file)
@@ -12,7 +12,7 @@
       <br>
       <table cellspacing="0" cellpadding="4" width="100%" border="0">
         <tr>
-          <td align="center">&nbsp;Anuko Time Tracker 1.9.20.3455 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.9.20.3456 | 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>
index ebe6356..d5a28bb 100644 (file)
--- a/time.php
+++ b/time.php
@@ -57,7 +57,7 @@ if(!$cl_date)
 $_SESSION['date'] = $cl_date;
 
 // Use custom fields plugin if it is enabled.
-if (in_array('cf', explode(',', $user->plugins))) {
+if (ttPluginEnabled('cf')) {
   require_once('plugins/CustomFields.class.php');
   $custom_fields = new CustomFields($user->team_id);
   $smarty->assign('custom_fields', $custom_fields);