Added user input check for multiple group by.
authorNik Okuntseff <support@anuko.com>
Mon, 29 Oct 2018 14:51:31 +0000 (14:51 +0000)
committerNik Okuntseff <support@anuko.com>
Mon, 29 Oct 2018 14:51:31 +0000 (14:51 +0000)
WEB-INF/templates/footer.tpl
reports.php

index 81f2623..d261f08 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.01.4331 | 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.01.4332 | 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 39f09c0..cba0991 100644 (file)
@@ -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'));