From 5403806f9c5e87add5a1594835018125a5ed0b0b Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Wed, 31 Oct 2018 12:40:28 +0000 Subject: [PATCH] Improved visibility of Totals only checkbox on reports.php for multiple group by. --- WEB-INF/templates/footer.tpl | 2 +- WEB-INF/templates/reports.tpl | 6 ++++-- reports.php | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index be04ad96..1a52dda6 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.18.03.4335 | Copyright © Anuko | +  Anuko Time Tracker 1.18.03.4336 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/WEB-INF/templates/reports.tpl b/WEB-INF/templates/reports.tpl index feb5800f..418c172a 100644 --- a/WEB-INF/templates/reports.tpl +++ b/WEB-INF/templates/reports.tpl @@ -138,8 +138,10 @@ function selectAssignedUsers(project_id) { function handleCheckboxes() { var totalsOnlyCheckbox = document.getElementById("chtotalsonly"); var totalsOnlyLabel = document.getElementById("totals_only_label"); - if ("no_grouping" == document.getElementById("group_by1").value) { - // Unmark and disable the "Totals only" checkbox. + if ("no_grouping" == document.getElementById("group_by1").value + && "no_grouping" == document.getElementById("group_by2").value + && "no_grouping" == document.getElementById("group_by3").value) { + // Unmark and hide the "Totals only" checkbox. totalsOnlyCheckbox.checked = false; totalsOnlyCheckbox.style.visibility = "hidden"; totalsOnlyLabel.style.visibility = "hidden"; diff --git a/reports.php b/reports.php index ae7f552c..31028f2f 100644 --- a/reports.php +++ b/reports.php @@ -234,8 +234,8 @@ if ($custom_fields && $custom_fields->fields[0] && $custom_fields->fields[0]['ty } $group_by_options_size = sizeof($group_by_options); $form->addInput(array('type'=>'combobox','onchange'=>'handleCheckboxes();','name'=>'group_by1','data'=>$group_by_options)); -if ($group_by_options_size > 2) $form->addInput(array('type'=>'combobox','name'=>'group_by2','data'=>$group_by_options)); -if ($group_by_options_size > 3) $form->addInput(array('type'=>'combobox','name'=>'group_by3','data'=>$group_by_options)); +if ($group_by_options_size > 2) $form->addInput(array('type'=>'combobox','onchange'=>'handleCheckboxes();','name'=>'group_by2','data'=>$group_by_options)); +if ($group_by_options_size > 3) $form->addInput(array('type'=>'combobox','onchange'=>'handleCheckboxes();','name'=>'group_by3','data'=>$group_by_options)); $form->addInput(array('type'=>'checkbox','name'=>'chtotalsonly')); // Add text field for a new favorite report name. -- 2.20.1