From 30bb88aea34039db35d696233149168a14af024c Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 26 Nov 2018 17:42:30 +0000 Subject: [PATCH] Made display of projects conditional on user_add.php and user_edit.php. --- WEB-INF/templates/footer.tpl | 2 +- WEB-INF/templates/user_add.tpl | 6 ++++-- WEB-INF/templates/user_edit.tpl | 3 ++- user_add.php | 1 + user_edit.php | 1 + 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index fe920a00..40949083 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
- -{if ($smarty.const.MODE_PROJECTS == $user->getTrackingMode() || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->getTrackingMode())} +{if ($smarty.const.MODE_PROJECTS == $user->getTrackingMode() || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->getTrackingMode()) && $show_projects} + +{/if} -{/if} + diff --git a/WEB-INF/templates/user_edit.tpl b/WEB-INF/templates/user_edit.tpl index a0872a1f..0c24a011 100644 --- a/WEB-INF/templates/user_edit.tpl +++ b/WEB-INF/templates/user_edit.tpl @@ -115,7 +115,8 @@ function handleClientControl() { -{if ($smarty.const.MODE_PROJECTS == $user->getTrackingMode() || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->getTrackingMode())} +{if ($smarty.const.MODE_PROJECTS == $user->getTrackingMode() || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->getTrackingMode()) && $show_projects} + diff --git a/user_add.php b/user_add.php index bc78adbf..7fb6ea3c 100644 --- a/user_add.php +++ b/user_add.php @@ -169,6 +169,7 @@ if ($request->isPost()) { $smarty->assign('auth_external', $auth->isPasswordExternal()); $smarty->assign('active_roles', $active_roles); $smarty->assign('forms', array($form->getName()=>$form->toArray())); +$smarty->assign('show_projects', count($projects) > 0); $smarty->assign('onload', 'onLoad="document.userForm.name.focus();handleClientControl();"'); $smarty->assign('title', $i18n->get('title.add_user')); $smarty->assign('content_page_name', 'user_add.tpl'); diff --git a/user_edit.php b/user_edit.php index 26dfa01a..c1c9e6c8 100644 --- a/user_edit.php +++ b/user_edit.php @@ -227,6 +227,7 @@ $smarty->assign('rates', $rates); $smarty->assign('auth_external', $auth->isPasswordExternal()); $smarty->assign('active_roles', $active_roles); $smarty->assign('can_swap', $can_swap); +$smarty->assign('show_projects', count($projects) > 0); $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="document.userForm.name.focus();handleClientControl();"'); $smarty->assign('user_id', $user_id); -- 2.20.1
 Anuko Time Tracker 1.18.28.4524 | Copyright © Anuko | +  Anuko Time Tracker 1.18.28.4525 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/WEB-INF/templates/user_add.tpl b/WEB-INF/templates/user_add.tpl index 762f0528..29218d86 100644 --- a/WEB-INF/templates/user_add.tpl +++ b/WEB-INF/templates/user_add.tpl @@ -81,15 +81,17 @@ function handleClientControl() { {$i18n.form.users.default_rate} (0{$user->getDecimalMark()}00): {$forms.userForm.rate.control}
 
{$i18n.label.projects}: {$forms.userForm.projects.control}
{$i18n.label.required_fields}
{$forms.userForm.btn_submit.control}
{$i18n.form.users.default_rate} (0{$user->getDecimalMark()}00): {$forms.userForm.rate.control}
 
{$i18n.label.projects}: {$forms.userForm.projects.control}