]> wagnertech.de Git - timetracker.git/commitdiff
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 83f7968e331760e2dc2c5043898ef4318f9f5d20..29b74145f04361e7382c9490993f9c7b90e85a4c 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 fd5dc4eb1d3e1f840c58f22b5df32bc8b1439390..d6fda7947ea1e11fa6583d70fbc4e0b37161fc6c 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 5f4a4e46e21769271486074123de48971d573b1b..4c921299d04f2cad54422e50d36150bf6cea0e67 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 cfc1fe67295b318722aac8d80ff51465dfced186..a64fbc269c21ea18b69ca70988ec370dc8145ba1 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 3203e5deb91f4ad45919808aca02cc4c1ce977dc..6e45a43822a87f72c61416d5a36aad7fbbaa71c9 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 8c11af27027ec1334bfea9912b3d4d3d6a777774..4371be29354e231c11c265533b2d5409283712b1 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 729d3ce9e6cb9ce30af891b443617696edde34a6..2dbd746015512c826cfc7acefa1f01da72a9f901 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 bd6bf8b8ae0c28853cfd739847284710386a9404..b32da743759723e891a872cfbe4a26bd88236215 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 696142bf4b25c88b7e0b094c52e9f5f7df103993..b5db6d3b646f045887604c05a1a7d8cd442b2444 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 1d588e8ef9cb31785cd55a39137a7e040f5fee54..0dc7afb3087a97c768d7b5da2d74061671d30611 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,