From: Nik Okuntseff Date: Wed, 31 Oct 2018 01:22:43 +0000 (+0000) Subject: Fixed a condition that determines grouping for getting subtotals. X-Git-Tag: timetracker_1.19-1~745 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=7562c5b6d68929eb4787749f8c10dc032ee9a1c7;p=timetracker.git Fixed a condition that determines grouping for getting subtotals. --- diff --git a/WEB-INF/lib/ttReportHelper.class.php b/WEB-INF/lib/ttReportHelper.class.php index 454b437d..3940a51b 100644 --- a/WEB-INF/lib/ttReportHelper.class.php +++ b/WEB-INF/lib/ttReportHelper.class.php @@ -1411,6 +1411,15 @@ class ttReportHelper { return $group_by_fields; } + // grouping determines if we are grooping the project by either group_by1, + // group_by2, or group_by3 values passed in $options. + static function grouping($options) { + $grouping = ($options['group_by1'] != null && $options['group_by1'] != 'no_grouping') || + ($options['group_by2'] != null && $options['group_by2'] != 'no_grouping') || + ($options['group_by3'] != null && $options['group_by3'] != 'no_grouping'); + return $grouping; + } + // groupingByUser determines if we are grouping a report by user. static function groupingByUser($options) { if ($options['group_by1'] == 'user' || $options['group_by2'] == 'user' || $options['group_by3'] == 'user') return true; diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index f2bf5b5e..be04ad96 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.18.03.4334 | Copyright © Anuko | +  Anuko Time Tracker 1.18.03.4335 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/report.php b/report.php index 5f7e687b..f6abcc4c 100644 --- a/report.php +++ b/report.php @@ -178,7 +178,7 @@ $report_items = ttReportHelper::getItems($options); if ($request->isGet() && $user->isPluginEnabled('ps')) ttReportHelper::putInSession($report_items); -if ('no_grouping' != $group_by) +if (ttReportHelper::grouping($options)) $subtotals = ttReportHelper::getSubtotals($options); $totals = ttReportHelper::getTotals($options);