Improved usability by hiding not relevant controls for client users.
authorNik Okuntseff <support@anuko.com>
Sun, 24 Feb 2019 14:51:10 +0000 (14:51 +0000)
committerNik Okuntseff <support@anuko.com>
Sun, 24 Feb 2019 14:51:53 +0000 (14:51 +0000)
WEB-INF/templates/footer.tpl
WEB-INF/templates/mobile/user_add.tpl
WEB-INF/templates/mobile/user_edit.tpl
WEB-INF/templates/user_add.tpl
WEB-INF/templates/user_edit.tpl

index 35edfc1..c99fe70 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.41.4766 | 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.41.4767 | 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 1bde81b..9df99ff 100644 (file)
@@ -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() {
       <td align="right">{$i18n.form.users.role}:</td>
       <td>{$forms.userForm.role.control} {$forms.userForm.client.control}</td>
     </tr>
-    <tr>
-      <td align="right">{$i18n.form.users.default_rate}&nbsp;(0{$user->decimal_mark}00):</td>
-      <td>{$forms.userForm.rate.control}</td>
-    </tr>
+<tbody id="non_client_block">
 {if $show_quota}
     <tr>
       <td align="right">{$i18n.label.quota}&nbsp;(%):</td>
       <td>{$forms.userForm.quota_percent.control}</td>
     </tr>
 {/if}
+    <tr>
+      <td align="right">{$i18n.form.users.default_rate}&nbsp;(0{$user->decimal_mark}00):</td>
+      <td>{$forms.userForm.rate.control}</td>
+    </tr>
+</tbody>
 {if $show_projects}
 <tbody id="projects_control">
     <tr valign="top">
       <td align="right">{$i18n.label.projects}:</td>
       <td>{$forms.userForm.projects.control}</td>
     </tr>
+</tbody>
+{/if}
     <tr>
       <td colspan="2" align="center">{$i18n.label.required_fields}</td>
     </tr>
-</tbody>
-{/if}
     <tr>
       <td colspan="2" align="center" height="50">{$forms.userForm.btn_submit.control}</td>
     </tr>
index 6bddbb9..03c5db2 100644 (file)
@@ -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() {
 }
 </script>
 
+
 {$forms.userForm.open}
 <table cellspacing="4" cellpadding="7" border="0">
   <table cellspacing="1" cellpadding="2" border="0">
@@ -118,16 +122,18 @@ function handleClientControl() {
       <td>{$forms.userForm.status.control}</td>
     </tr>
 {/if}
-    <tr>
-      <td align="right">{$i18n.form.users.default_rate}&nbsp;(0{$user->decimal_mark}00):</td>
-      <td>{$forms.userForm.rate.control}</td>
-    </tr>
+<tbody id="non_client_block">
 {if $show_quota}
     <tr>
       <td align="right">{$i18n.label.quota}&nbsp;(%):</td>
       <td>{$forms.userForm.quota_percent.control}</td>
     </tr>
 {/if}
+    <tr>
+      <td align="right">{$i18n.form.users.default_rate}&nbsp;(0{$user->decimal_mark}00):</td>
+      <td>{$forms.userForm.rate.control}</td>
+    </tr>
+</tbody>
 {if $show_projects}
 <tbody id="projects_control">
     <tr valign="top">
index c6dbaa7..155bf11 100644 (file)
@@ -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() {
       <td align="right">{$i18n.form.users.role}:</td>
       <td>{$forms.userForm.role.control} {$forms.userForm.client.control}</td>
     </tr>
-    <tr>
-      <td align="right">{$i18n.form.users.default_rate}&nbsp;(0{$user->getDecimalMark()}00):</td>
-      <td>{$forms.userForm.rate.control}</td>
-    </tr>
+<tbody id="non_client_block">
 {if $show_quota}
     <tr>
       <td align="right">{$i18n.label.quota}&nbsp;(%):</td>
       <td>{$forms.userForm.quota_percent.control} <a href="https://www.anuko.com/lp/tt_27.htm" target="_blank">{$i18n.label.what_is_it}</a></td>
     </tr>
 {/if}
+    <tr>
+      <td align="right">{$i18n.form.users.default_rate}&nbsp;(0{$user->getDecimalMark()}00):</td>
+      <td>{$forms.userForm.rate.control}</td>
+    </tr>
+</tbody>
 {if $show_projects}
 <tbody id="projects_control">
     <tr><td>&nbsp;</td></tr>
@@ -112,7 +117,6 @@ function handleClientControl() {
     <tr>
       <td colspan="2" align="center">{$i18n.label.required_fields}</td>
     </tr>
-
     <tr>
       <td colspan="2" align="center" height="50">{$forms.userForm.btn_submit.control}</td>
     </tr>
index 2bba184..e17651b 100644 (file)
@@ -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() {
       <td>{$user->role_name} {if $can_swap}<a href="swap_roles.php">{$i18n.form.user_edit.swap_roles}</a>{/if}</td>
     </tr>
 {/if}
-    <tr>
-      <td align="right">{$i18n.form.users.default_rate}&nbsp;(0{$user->getDecimalMark()}00):</td>
-      <td>{$forms.userForm.rate.control}</td>
-    </tr>
+<tbody id="non_client_block">
 {if $show_quota}
     <tr>
       <td align="right">{$i18n.label.quota}&nbsp;(%):</td>
       <td>{$forms.userForm.quota_percent.control} <a href="https://www.anuko.com/lp/tt_27.htm" target="_blank">{$i18n.label.what_is_it}</a></td>
     </tr>
 {/if}
+    <tr>
+      <td align="right">{$i18n.form.users.default_rate}&nbsp;(0{$user->getDecimalMark()}00):</td>
+      <td>{$forms.userForm.rate.control}</td>
+    </tr>
+</tbody>
 {if $show_projects}
 <tbody id="projects_control">
     <tr><td>&nbsp;</td></tr>