A bit more refactoring for subgroups.
authorNik Okuntseff <support@anuko.com>
Wed, 5 Dec 2018 17:29:56 +0000 (17:29 +0000)
committerNik Okuntseff <support@anuko.com>
Wed, 5 Dec 2018 17:29:56 +0000 (17:29 +0000)
WEB-INF/templates/expenses.tpl
WEB-INF/templates/footer.tpl
expenses.php

index 17b8c8f..4eea0b8 100644 (file)
@@ -129,7 +129,7 @@ function recalculateCost() {
           <td>{$forms.expensesForm.client.control}</td>
         </tr>
 {/if}
-{if ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
+{if $show_project}
         <tr>
           <td align="right">{$i18n.label.project} (*):</td>
           <td>{$forms.expensesForm.project.control}</td>
@@ -178,7 +178,7 @@ function recalculateCost() {
   {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)}
+  {if $show_project}
         <td class="tableHeader">{$i18n.label.project}</td>
   {/if}
         <td class="tableHeader">{$i18n.label.item}</td>
@@ -190,7 +190,7 @@ function recalculateCost() {
     {if $user->isPluginEnabled('cl')}
         <td valign="top">{$item.client|escape}</td>
     {/if}
-    {if ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
+    {if $show_project}
         <td valign="top">{$item.project|escape}</td>
     {/if}
         <td valign="top">{$item.item|escape}</td>
index 96fdee8..99e8d0e 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.18.29.4591 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.18.29.4592 | 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 fa844a2..eb11e73 100644 (file)
@@ -219,13 +219,14 @@ if ($request->isPost()) {
   }
 }
 
+$smarty->assign('forms', array($form->getName()=>$form->toArray()));
+$smarty->assign('show_project', $show_project);
 $smarty->assign('day_total', ttExpenseHelper::getTotalForDay($cl_date));
 $smarty->assign('expense_items', ttExpenseHelper::getItems($cl_date));
 $smarty->assign('predefined_expenses', $predefined_expenses);
 $smarty->assign('client_list', $client_list);
 $smarty->assign('project_list', $project_list);
-$smarty->assign('forms', array($form->getName()=>$form->toArray()));
-$smarty->assign('timestring', $selected_date->toString($user->date_format));
+$smarty->assign('timestring', $selected_date->toString($user->getDateFormat()));
 $smarty->assign('title', $i18n->get('title.expenses'));
 $smarty->assign('content_page_name', 'expenses.tpl');
 $smarty->display('index.tpl');