From 3d6637d9e14122d6998e0be59e9138d41733d5db Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 29 Apr 2019 13:31:24 +0000 Subject: [PATCH] A bit of refactoring in week view. --- WEB-INF/templates/footer.tpl | 2 +- WEB-INF/templates/week.tpl | 4 ++-- week.php | 5 +++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 4b60ee5b..0545cff5 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
- {/if} -{if ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)} +{if $show_project} {/if} -{if ($smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)} +{if $show_task} diff --git a/week.php b/week.php index 6cb6f28a..2ef77447 100644 --- 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'); -- 2.20.1
 Anuko Time Tracker 1.19.4.4998 | Copyright © Anuko | +  Anuko Time Tracker 1.19.4.4999 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/WEB-INF/templates/week.tpl b/WEB-INF/templates/week.tpl index 366762cf..8d56707f 100644 --- a/WEB-INF/templates/week.tpl +++ b/WEB-INF/templates/week.tpl @@ -56,13 +56,13 @@ function fillDropdowns() { {$custom_fields->fields[0]['label']|escape}{if $custom_fields->fields[0]['required']} (*){/if}:{$forms.weekTimeForm.cf_1.control}
{$i18n.label.project} (*): {$forms.weekTimeForm.project.control}
{$i18n.label.task}: {$forms.weekTimeForm.task.control}