Work in progress switching to ttUser::isPluginEnabled().
authorNik Okuntseff <support@anuko.com>
Wed, 30 Mar 2016 16:59:35 +0000 (16:59 +0000)
committerNik Okuntseff <support@anuko.com>
Wed, 30 Mar 2016 16:59:35 +0000 (16:59 +0000)
WEB-INF/lib/ttTimeHelper.class.php
WEB-INF/templates/expense_delete.tpl
WEB-INF/templates/expense_edit.tpl
WEB-INF/templates/expenses.tpl
WEB-INF/templates/footer.tpl
WEB-INF/templates/mobile/time.tpl
WEB-INF/templates/mobile/time_edit.tpl
WEB-INF/templates/mobile/timer.tpl
WEB-INF/templates/reports.tpl
user_edit.php

index 83f7968..29b7414 100644 (file)
@@ -615,12 +615,12 @@ class ttTimeHelper {
     $mdb2 = getConnection();
 
     $client_field = null;
-    if (in_array('cl', explode(',', $user->plugins)))
+    if ($user->isPluginEnabled('cl'))
       $client_field = ", c.name as client";
     
     $left_joins = " left join tt_projects p on (l.project_id = p.id)".
       " left join tt_tasks t on (l.task_id = t.id)";
-    if (in_array('cl', explode(',', $user->plugins)))
+    if ($user->isPluginEnabled('cl'))
       $left_joins .= " left join tt_clients c on (l.client_id = c.id)";
 
     $sql = "select l.id as id, TIME_FORMAT(l.start, $sql_time_format) as start,
index fd5dc4e..d6fda79 100644 (file)
@@ -4,7 +4,7 @@
   <td>
   <table border='0' cellpadding='3' cellspacing='1' width="100%">
   <tr>
-{if in_array('cl', explode(',', $user->plugins))}
+{if $user->isPluginEnabled('cl')}
     <td class="tableHeader" align="center">{$i18n.label.client}</td>
 {/if}
 
@@ -15,7 +15,7 @@
     <td class="tableHeader" align="center">{$i18n.label.cost}</td>
   </tr>
   <tr bgcolor="{cycle values="#f5f5f5,#ccccce"}">
-{if in_array('cl', explode(',', $user->plugins))}
+{if $user->isPluginEnabled('cl')}
   <td>{$expense_item.client_name|escape:'html'}</td>
 {/if}
 {if ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
index 5f4a4e4..4c92129 100644 (file)
@@ -76,7 +76,7 @@ function get_date() {
   <tr>
     <td valign="top">
     <table border="0">
-{if in_array('cl', explode(',', $user->plugins))}
+{if $user->isPluginEnabled('cl')}
     <tr>
       <td align="right">{$i18n.label.client} {if in_array('cm', explode(',', $user->plugins))}(*){/if}:</td>
       <td>{$forms.expenseItemForm.client.control}</td>
index cfc1fe6..a64fbc2 100644 (file)
@@ -79,7 +79,7 @@ function get_date() {
           <td>{$forms.expensesForm.onBehalfUser.control}</td>
         </tr>
 {/if}
-{if in_array('cl', explode(',', $user->plugins))}
+{if $user->isPluginEnabled('cl')}
         <tr>
           <td align="right">{$i18n.label.client}{if in_array('cm', explode(',', $user->plugins))} (*){/if}:</td>
           <td>{$forms.expensesForm.client.control}</td>
@@ -121,7 +121,7 @@ function get_date() {
 {if $expense_items}
       <table border="0" cellpadding="3" cellspacing="1" width="100%">
       <tr>
-  {if in_array('cl', explode(',', $user->plugins))}
+  {if $user->isPluginEnabled('cl')}
         <td width="20%" class="tableHeader">{$i18n.label.client}</td>
   {/if}
   {if ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
@@ -133,7 +133,7 @@ function get_date() {
       </tr>
   {foreach $expense_items as $item}
       <tr bgcolor="{cycle values="#f5f5f5,#ccccce"}">
-    {if in_array('cl', explode(',', $user->plugins))}
+    {if $user->isPluginEnabled('cl')}
         <td valign='top'>{$item.client|escape:'html'}</td>
     {/if}
     {if ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
index 3203e5d..6e45a43 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.3459 | 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.3460 | 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 8c11af2..4371be2 100644 (file)
@@ -250,7 +250,7 @@ function get_date() {
   <tr>
     <td valign="top">
     <table border="0">
-{if in_array('cl', explode(',', $user->plugins))}
+{if $user->isPluginEnabled('cl')}
     <tr><td>{$i18n.label.client}:</td></tr>
     <tr><td>{$forms.timeRecordForm.client.control}</td></tr>
 {/if}
index 729d3ce..2dbd746 100644 (file)
@@ -210,7 +210,7 @@ function get_date() {
   <tr>
        <td valign="top">
     <table border="0">
-{if in_array('cl', explode(',', $user->plugins))}
+{if $user->isPluginEnabled('cl')}
     <tr><td>{$i18n.label.client}:</td></tr>
     <tr><td>{$forms.timeRecordForm.client.control}</td></tr>
 {/if}
index bd6bf8b..b32da74 100644 (file)
@@ -217,7 +217,7 @@ startTimer();
   <tr>
     <td valign="top">
     <table border="0">
-{if in_array('cl', explode(',', $user->plugins))}
+{if $user->isPluginEnabled('cl')}
     <tr><td>{$i18n.label.client}:</td></tr>
     <tr><td>{$forms.timerRecordForm.client.control}</td></tr>
 {/if}
index 696142b..b5db6d3 100644 (file)
@@ -167,9 +167,9 @@ function handleCheckboxes() {
   <tr>
     <td valign="top" colspan="2" align="center">
       <table border="0" cellpadding="3">
-{if ((in_array('cl', explode(',', $user->plugins)) && !($user->isClient() && $user->client_id)) || ($custom_fields && $custom_fields->fields[0] && $custom_fields->fields[0]['type'] == CustomFields::TYPE_DROPDOWN))}
+{if (($user->isPluginEnabled('cl') && !($user->isClient() && $user->client_id)) || ($custom_fields && $custom_fields->fields[0] && $custom_fields->fields[0]['type'] == CustomFields::TYPE_DROPDOWN))}
         <tr>
-  {if in_array('cl', explode(',', $user->plugins)) && !($user->isClient() && $user->client_id)}<td><b>{$i18n.label.client}</b></td>{else}<td>&nbsp;</td>{/if}
+  {if $user->isPluginEnabled('cl') && !($user->isClient() && $user->client_id)}<td><b>{$i18n.label.client}</b></td>{else}<td>&nbsp;</td>{/if}
           <td>&nbsp;</td>
   {if ($custom_fields && $custom_fields->fields[0] && $custom_fields->fields[0]['type'] == CustomFields::TYPE_DROPDOWN)}<td><b>{$i18n.label.option}</b></td>{else}<td>&nbsp;</td>{/if}
         </tr>
@@ -236,9 +236,9 @@ function handleCheckboxes() {
         <tr>
           <td colspan="3">
             <table border="0" width="100%">
-{if in_array('cl', explode(',', $user->plugins)) || in_array('iv', explode(',', $user->plugins))}
+{if $user->isPluginEnabled('cl') || in_array('iv', explode(',', $user->plugins))}
               <tr>
-  {if in_array('cl', explode(',', $user->plugins))}
+  {if $user->isPluginEnabled('cl')}
                 <td width="25%"><label>{$forms.reportForm.chclient.control}&nbsp;{$i18n.label.client}</label></td>
   {/if}
   {if ($user->canManageTeam() || $user->isClient()) && in_array('iv', explode(',', $user->plugins))}
index 1d588e8..0dc7afb 100644 (file)
@@ -58,7 +58,7 @@ if (!$ok_to_go) {
   die ($i18n->getKey('error.sys'));
 }
 
-if (in_array('cl', explode(',', $user->plugins)))
+if ($user->isPluginEnabled('cl'))
   $clients = ttTeamHelper::getActiveClients($user->team_id);
 
 $projects = ttTeamHelper::getActiveProjects($user->team_id);
@@ -114,10 +114,10 @@ $form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'email','style'=
 
 $roles[ROLE_USER] = $i18n->getKey('label.user');
 $roles[ROLE_COMANAGER] = $i18n->getKey('form.users.comanager');
-if (in_array('cl', explode(',', $user->plugins)))
+if ($user->isPluginEnabled('cl'))
   $roles[ROLE_CLIENT] = $i18n->getKey('label.client');
 $form->addInput(array('type'=>'combobox','onchange'=>'handleClientControl()','name'=>'role','value'=>$cl_role,'data'=>$roles));
-if (in_array('cl', explode(',', $user->plugins)))
+if ($user->isPluginEnabled('cl'))
   $form->addInput(array('type'=>'combobox','name'=>'client','value'=>$cl_client_id,'data'=>$clients,'datakeys'=>array('id', 'name'),'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
 
 $form->addInput(array('type'=>'combobox','name'=>'status','value'=>$cl_status,