]> wagnertech.de Git - timetracker.git/blobdiff - WEB-INF/lib/ttReportHelper.class.php
Starting work on subgroups.
[timetracker.git] / WEB-INF / lib / ttReportHelper.class.php
index 5dafe95be2f7917a86233ce54fd8abb3dd7d1ce0..3a6a09608fff703388429fa063ffcc6e8c1f4fe1 100644 (file)
@@ -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) {