From a48e5ff4ad629b551f6a94143a5e9d0f235b1953 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Thu, 1 Nov 2018 20:48:16 +0000 Subject: [PATCH] Fixed emailing reports grouped by custom field, hopefully. --- WEB-INF/lib/ttReportHelper.class.php | 5 ++++- WEB-INF/templates/footer.tpl | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/WEB-INF/lib/ttReportHelper.class.php b/WEB-INF/lib/ttReportHelper.class.php index 5dafe95b..3a6a0960 100644 --- a/WEB-INF/lib/ttReportHelper.class.php +++ b/WEB-INF/lib/ttReportHelper.class.php @@ -1445,7 +1445,10 @@ class ttReportHelper { // makeJoinPart builds a left join part for getSubtotals query (for time items). static function makeJoinPart($options) { - global $custom_fields; // TODO: is it safe to assume the object is there when needed? + global $user; + if (ttReportHelper::groupingBy('cf_1', $options)) { + $custom_fields = new CustomFields($user->group_id); + } $group_by_fields = ttReportHelper::makeGroupByFieldsPart($options); // TODO: refactor this, perhaps? if (strpos($group_by_fields, 'user') !== false) { diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 0b196913..ffb9e9c9 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.18.05.4344 | Copyright © Anuko | +  Anuko Time Tracker 1.18.05.4345 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} -- 2.20.1