A bit of refactoring in week view.
authorNik Okuntseff <support@anuko.com>
Mon, 29 Apr 2019 13:31:24 +0000 (13:31 +0000)
committerNik Okuntseff <support@anuko.com>
Mon, 29 Apr 2019 13:31:24 +0000 (13:31 +0000)
WEB-INF/templates/footer.tpl
WEB-INF/templates/week.tpl
week.php

index 4b60ee5..0545cff 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.19.4.4998 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.19.4.4999 | 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 366762c..8d56707 100644 (file)
@@ -56,13 +56,13 @@ function fillDropdowns() {
           <td align="right">{$custom_fields->fields[0]['label']|escape}{if $custom_fields->fields[0]['required']} (*){/if}:</td><td>{$forms.weekTimeForm.cf_1.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.weekTimeForm.project.control}</td>
         </tr>
 {/if}
-{if ($smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
+{if $show_task}
         <tr>
           <td align="right">{$i18n.label.task}:</td>
           <td>{$forms.weekTimeForm.task.control}</td>
index 6cb6f28..2ef7744 100644 (file)
--- a/week.php
+++ b/week.php
@@ -58,6 +58,9 @@ if (!$user->behalf_id && !$user->can('track_own_time') && !$user->adjustBehalfId
 // End of access checks.
 
 $showClient = $user->isPluginEnabled('cl');
+$trackingMode = $user->getTrackingMode();
+$showProject = MODE_PROJECTS == $trackingMode || MODE_PROJECTS_AND_TASKS == $trackingMode;
+$showTask = MODE_PROJECTS_AND_TASKS == $trackingMode;
 $showFiles = $user->isPluginEnabled('at');
 
 // Initialize and store date in session.
@@ -511,6 +514,8 @@ $smarty->assign('timestring', $startDate->toString($user->date_format).' - '.$en
 $smarty->assign('time_records', $records);
 $smarty->assign('show_navigation', !$user->getConfigOption('menu_week'));
 $smarty->assign('show_client', $showClient);
+$smarty->assign('show_project', $showProject);
+$smarty->assign('show_task', $showTask);
 $smarty->assign('show_files', $showFiles);
 $smarty->assign('title', $i18n->get('menu.week'));
 $smarty->assign('content_page_name', 'week.tpl');