Improved the script that shows the Totals only checkbox.
authorNik Okuntseff <support@anuko.com>
Wed, 31 Oct 2018 13:35:35 +0000 (13:35 +0000)
committerNik Okuntseff <support@anuko.com>
Wed, 31 Oct 2018 13:35:35 +0000 (13:35 +0000)
WEB-INF/templates/footer.tpl
WEB-INF/templates/reports.tpl

index 1a52dda..bc3b468 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.03.4336 | 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.03.4337 | 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 418c172..95b4a43 100644 (file)
@@ -134,20 +134,28 @@ function selectAssignedUsers(project_id) {
 }
 
 // handleCheckboxes - unmarks and hides the "Totals only" checkbox when
-// "no grouping" is selected in the associated dropdown.
+// "no grouping" is selected in the associated group by dropdowns.
 function handleCheckboxes() {
   var totalsOnlyCheckbox = document.getElementById("chtotalsonly");
   var totalsOnlyLabel = document.getElementById("totals_only_label");
-  if ("no_grouping" == document.getElementById("group_by1").value
-      && "no_grouping" == document.getElementById("group_by2").value
-      && "no_grouping" == document.getElementById("group_by3").value) {
+  var groupBy1 = document.getElementById("group_by1");
+  var groupBy2 = document.getElementById("group_by2");
+  var groupBy3 = document.getElementById("group_by3");
+  var grouping = false;
+  if ((groupBy1 != null && "no_grouping" != groupBy1.value) ||
+      (groupBy2 != null && "no_grouping" != groupBy2.value) ||
+      (groupBy3 != null && "no_grouping" != groupBy3.value)) {
+    grouping = true;
+  }
+  if (grouping) {
+    // Show the "Totals only" checkbox.
+    totalsOnlyCheckbox.style.visibility = "visible";
+    totalsOnlyLabel.style.visibility = "visible";
+  } else {
     // Unmark and hide the "Totals only" checkbox.
     totalsOnlyCheckbox.checked = false;
     totalsOnlyCheckbox.style.visibility = "hidden";
     totalsOnlyLabel.style.visibility = "hidden";
-  } else {
-    totalsOnlyCheckbox.style.visibility = "visible";
-    totalsOnlyLabel.style.visibility = "visible";
   }
 }
 </script>