X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=report.php;h=1a8ce63cc8dbe71954baa5411a9d34607603f9c1;hb=6289820a41e9ab79635294c1d6a22583aacf6e77;hp=efbaccea8ea74136a23b14d4bbeeaf8612c71c81;hpb=47b6c704a5375b9f98376bf4eb727d4ee49fe3e2;p=timetracker.git diff --git a/report.php b/report.php index efbaccea..1a8ce63c 100644 --- a/report.php +++ b/report.php @@ -54,7 +54,7 @@ if ($user->isPluginEnabled('iv')) { // Use custom fields plugin if it is enabled. if ($user->isPluginEnabled('cf')) { require_once('plugins/CustomFields.class.php'); - $custom_fields = new CustomFields($user->group_id); + $custom_fields = new CustomFields(); $smarty->assign('custom_fields', $custom_fields); } @@ -173,12 +173,14 @@ if ($request->isPost()) { $group_by = $bean->getAttribute('group_by1'); $options = ttReportHelper::getReportOptions($bean); + +$group_by_tag = ttReportHelper::makeGroupByXmlTag($options); $report_items = ttReportHelper::getItems($options); // Store record ids in session in case user wants to act on records such as marking them all paid. 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); @@ -192,13 +194,18 @@ if ($report_items && 'no_grouping' != $group_by1) { } // Determine group by header. if ('no_grouping' != $group_by) { + /* if ('cf_1' == $group_by) $smarty->assign('group_by_header', $custom_fields->fields[0]['label']); else { $key = 'label.'.$group_by; $smarty->assign('group_by_header', $i18n->get($key)); - } + } */ + $smarty->assign('group_by_header', ttReportHelper::makeGroupByHeader($options)); } + +$smarty->assign('group_by', $group_by_tag); + // Assign variables that are used to alternate color of rows for different dates. $smarty->assign('prev_date', ''); $smarty->assign('cur_date', '');