From 8b5e58e72a7d6ec9728f6890261f1ece2cfa7cc8 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 24 Feb 2019 14:51:10 +0000 Subject: [PATCH] Improved usability by hiding not relevant controls for client users. --- WEB-INF/templates/footer.tpl | 2 +- WEB-INF/templates/mobile/user_add.tpl | 17 +++++++++++------ WEB-INF/templates/mobile/user_edit.tpl | 14 ++++++++++---- WEB-INF/templates/user_add.tpl | 14 +++++++++----- WEB-INF/templates/user_edit.tpl | 13 +++++++++---- 5 files changed, 40 insertions(+), 20 deletions(-) diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 35edfc1e..c99fe708 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
- - - - - + {if $show_quota} {/if} + + + + + {if $show_projects} + +{/if} - -{/if} diff --git a/WEB-INF/templates/mobile/user_edit.tpl b/WEB-INF/templates/mobile/user_edit.tpl index 6bddbb99..03c5db2e 100644 --- a/WEB-INF/templates/mobile/user_edit.tpl +++ b/WEB-INF/templates/mobile/user_edit.tpl @@ -56,6 +56,7 @@ function setRate(element) { function handleClientControl() { var selectedRoleId = document.getElementById("role").value; var clientControl = document.getElementById("client"); + var nonClientBlock = document.getElementById("non_client_block"); var projectsControl = document.getElementById("projects_control"); var len = roles.length; @@ -64,6 +65,7 @@ function handleClientControl() { var isClient = roles[i][1]; if (isClient == 1) { clientControl.style.visibility = "visible"; + nonClientBlock.style.display = "none"; projectsControl.style.display = "none"; // Uncheck all project checkboxes. @@ -75,6 +77,7 @@ function handleClientControl() { } else { clientControl.value = ""; clientControl.style.visibility = "hidden"; + nonClientBlock.style.display = ""; projectsControl.style.display = ""; } break; @@ -83,6 +86,7 @@ function handleClientControl() { } + {$forms.userForm.open}
 Anuko Time Tracker 1.18.41.4766 | Copyright © Anuko | +  Anuko Time Tracker 1.18.41.4767 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/WEB-INF/templates/mobile/user_add.tpl b/WEB-INF/templates/mobile/user_add.tpl index 1bde81b1..9df99ff0 100644 --- a/WEB-INF/templates/mobile/user_add.tpl +++ b/WEB-INF/templates/mobile/user_add.tpl @@ -34,6 +34,7 @@ function setDefaultRate(element) { function handleClientControl() { var selectedRoleId = document.getElementById("role").value; var clientControl = document.getElementById("client"); + var nonClientBlock = document.getElementById("non_client_block"); var projectsControl = document.getElementById("projects_control"); var len = roles.length; @@ -42,6 +43,7 @@ function handleClientControl() { var isClient = roles[i][1]; if (isClient == 1) { clientControl.style.visibility = "visible"; + nonClientBlock.style.display = "none"; projectsControl.style.display = "none"; // Uncheck all project checkboxes. @@ -53,6 +55,7 @@ function handleClientControl() { } else { clientControl.value = ""; clientControl.style.visibility = "hidden"; + nonClientBlock.style.display = ""; projectsControl.style.display = ""; } break; @@ -90,27 +93,29 @@ function handleClientControl() { {$i18n.form.users.role}: {$forms.userForm.role.control} {$forms.userForm.client.control}
{$i18n.form.users.default_rate} (0{$user->decimal_mark}00):{$forms.userForm.rate.control}
{$i18n.label.quota} (%): {$forms.userForm.quota_percent.control}
{$i18n.form.users.default_rate} (0{$user->decimal_mark}00):{$forms.userForm.rate.control}
{$i18n.label.projects}: {$forms.userForm.projects.control}
{$i18n.label.required_fields}
{$forms.userForm.btn_submit.control}
@@ -118,16 +122,18 @@ function handleClientControl() { {/if} - - - - + {if $show_quota} {/if} + + + + + {if $show_projects} diff --git a/WEB-INF/templates/user_add.tpl b/WEB-INF/templates/user_add.tpl index c6dbaa7b..155bf11c 100644 --- a/WEB-INF/templates/user_add.tpl +++ b/WEB-INF/templates/user_add.tpl @@ -34,6 +34,7 @@ function setDefaultRate(element) { function handleClientControl() { var selectedRoleId = document.getElementById("role").value; var clientControl = document.getElementById("client"); + var nonClientBlock = document.getElementById("non_client_block"); var projectsControl = document.getElementById("projects_control"); var len = roles.length; @@ -42,6 +43,7 @@ function handleClientControl() { var isClient = roles[i][1]; if (isClient == 1) { clientControl.style.visibility = "visible"; + nonClientBlock.style.display = "none"; projectsControl.style.display = "none"; // Uncheck all project checkboxes. @@ -53,6 +55,7 @@ function handleClientControl() { } else { clientControl.value = ""; clientControl.style.visibility = "hidden"; + nonClientBlock.style.display = ""; projectsControl.style.display = ""; } break; @@ -90,16 +93,18 @@ function handleClientControl() { - - - - + {if $show_quota} {/if} + + + + + {if $show_projects} @@ -112,7 +117,6 @@ function handleClientControl() { - diff --git a/WEB-INF/templates/user_edit.tpl b/WEB-INF/templates/user_edit.tpl index 2bba1842..e17651b2 100644 --- a/WEB-INF/templates/user_edit.tpl +++ b/WEB-INF/templates/user_edit.tpl @@ -56,6 +56,7 @@ function setRate(element) { function handleClientControl() { var selectedRoleId = document.getElementById("role").value; var clientControl = document.getElementById("client"); + var nonClientBlock = document.getElementById("non_client_block"); var projectsControl = document.getElementById("projects_control"); var len = roles.length; @@ -64,6 +65,7 @@ function handleClientControl() { var isClient = roles[i][1]; if (isClient == 1) { clientControl.style.visibility = "visible"; + nonClientBlock.style.display = "none"; projectsControl.style.display = "none"; // Uncheck all project checkboxes. @@ -75,6 +77,7 @@ function handleClientControl() { } else { clientControl.value = ""; clientControl.style.visibility = "hidden"; + nonClientBlock.style.display = ""; projectsControl.style.display = ""; } break; @@ -124,16 +127,18 @@ function handleClientControl() { {/if} - - - - + {if $show_quota} {/if} + + + + + {if $show_projects} -- 2.20.1
{$forms.userForm.status.control}
{$i18n.form.users.default_rate} (0{$user->decimal_mark}00):{$forms.userForm.rate.control}
{$i18n.label.quota} (%): {$forms.userForm.quota_percent.control}
{$i18n.form.users.default_rate} (0{$user->decimal_mark}00):{$forms.userForm.rate.control}
{$i18n.form.users.role}: {$forms.userForm.role.control} {$forms.userForm.client.control}
{$i18n.form.users.default_rate} (0{$user->getDecimalMark()}00):{$forms.userForm.rate.control}
{$i18n.label.quota} (%): {$forms.userForm.quota_percent.control} {$i18n.label.what_is_it}
{$i18n.form.users.default_rate} (0{$user->getDecimalMark()}00):{$forms.userForm.rate.control}
 
{$i18n.label.required_fields}
{$forms.userForm.btn_submit.control}
{$user->role_name} {if $can_swap}{$i18n.form.user_edit.swap_roles}{/if}
{$i18n.form.users.default_rate} (0{$user->getDecimalMark()}00):{$forms.userForm.rate.control}
{$i18n.label.quota} (%): {$forms.userForm.quota_percent.control} {$i18n.label.what_is_it}
{$i18n.form.users.default_rate} (0{$user->getDecimalMark()}00):{$forms.userForm.rate.control}