X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Ftemplates%2Freports.tpl;h=95b4a43642ed262ccce154f79b7eb957719b7911;hb=f9e704d00a2d21b1a94332e088f78c22da03d37c;hp=418c172a37b7588abc54800128c55042c3b9e2cf;hpb=5403806f9c5e87add5a1594835018125a5ed0b0b;p=timetracker.git diff --git a/WEB-INF/templates/reports.tpl b/WEB-INF/templates/reports.tpl index 418c172a..95b4a436 100644 --- a/WEB-INF/templates/reports.tpl +++ b/WEB-INF/templates/reports.tpl @@ -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"; } }