X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Ftemplates%2Freports.tpl;h=95b4a43642ed262ccce154f79b7eb957719b7911;hb=a106b7a2db73b3e1fdab428b218212f6f38d7623;hp=af674785eb1d4fff921ee3356e129255840eefe3;hpb=928c8528504a757cebd2bebcebfa5a393ac19b05;p=timetracker.git diff --git a/WEB-INF/templates/reports.tpl b/WEB-INF/templates/reports.tpl index af674785..95b4a436 100644 --- a/WEB-INF/templates/reports.tpl +++ b/WEB-INF/templates/reports.tpl @@ -133,17 +133,30 @@ function selectAssignedUsers(project_id) { } } -// handleCheckboxes - unmarks and disables the "Totals only" checkbox when -// "no grouping" is selected in the associated dropdown. -// In future we need to improve this function and hide not relevant elements completely. +// handleCheckboxes - unmarks and hides the "Totals only" checkbox when +// "no grouping" is selected in the associated group by dropdowns. function handleCheckboxes() { var totalsOnlyCheckbox = document.getElementById("chtotalsonly"); - if ("no_grouping" == document.getElementById("group_by").value) { - // Unmark and disable the "Totals only" checkbox. + var totalsOnlyLabel = document.getElementById("totals_only_label"); + 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.disabled = true; - } else - totalsOnlyCheckbox.disabled = false; + totalsOnlyCheckbox.style.visibility = "hidden"; + totalsOnlyLabel.style.visibility = "hidden"; + } } @@ -296,10 +309,15 @@ function handleCheckboxes() { - {$i18n.form.reports.group_by} + {$i18n.form.reports.group_by} - {$forms.reportForm.group_by.control} + {$forms.reportForm.group_by1.control} + {$forms.reportForm.group_by2.control} + {$forms.reportForm.group_by3.control} + + +