From e99d8df6059bacd85be829c9a369f6a1e2994882 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 29 Oct 2018 14:51:31 +0000 Subject: [PATCH] Added user input check for multiple group by. --- WEB-INF/templates/footer.tpl | 2 +- reports.php | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 81f2623e..d261f081 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.18.01.4331 | Copyright © Anuko | +  Anuko Time Tracker 1.18.01.4332 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/reports.php b/reports.php index 39f09c0b..cba09916 100644 --- a/reports.php +++ b/reports.php @@ -338,6 +338,13 @@ if ($request->isPost()) { if ($start_date->compare($end_date) > 0) $err->add($i18n->get('error.interval'), $i18n->get('label.end_date'), $i18n->get('label.start_date')); } + $group_by1 = $bean->getAttribute('group_by1'); + $group_by2 = $bean->getAttribute('group_by2'); + $group_by3 = $bean->getAttribute('group_by3'); + if (($group_by3 != null && $group_by3 != 'no_grouping') && ($group_by3 == $group_by1 || $group_by3 == $group_by2)) + $err->add($i18n->get('error.field'), $i18n->get('form.reports.group_by')); + if (($group_by2 != null && $group_by2 != 'no_grouping') && ($group_by2 == $group_by1 || $group_by3 == $group_by2)) + $err->add($i18n->get('error.field'), $i18n->get('form.reports.group_by')); // Check remaining values. if (!ttReportHelper::verifyBean($bean)) $err->add($i18n->get('error.sys')); -- 2.20.1