X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/a58bca2afc5d6457d07c886c7c20fb10c941752a..bd92aeb3404ed8625272abccc9a8766f13ab75e6:/WEB-INF/lib/ttReportHelper.class.php diff --git a/WEB-INF/lib/ttReportHelper.class.php b/WEB-INF/lib/ttReportHelper.class.php index 4d510bbb..1f165478 100644 --- a/WEB-INF/lib/ttReportHelper.class.php +++ b/WEB-INF/lib/ttReportHelper.class.php @@ -657,7 +657,7 @@ class ttReportHelper { } // prepareReportBody - prepares an email body for report. - static function prepareReportBody($bean, $comment) + static function prepareReportBody($bean, $options, $comment) { global $user; global $i18n; @@ -665,10 +665,9 @@ class ttReportHelper { // Determine these once as they are used in multiple places in this function. $canViewReports = $user->can('view_reports') || $user->can('view_all_reports'); $isClient = $user->isClient(); - $options = ttReportHelper::getReportOptions($bean); $items = ttReportHelper::getItems($options); - $group_by = $bean->getAttribute('group_by'); + $group_by = $options['group_by']; if ($group_by && 'no_grouping' != $group_by) $subtotals = ttReportHelper::getSubtotals($options); $totals = ttReportHelper::getTotals($options); @@ -700,7 +699,7 @@ class ttReportHelper { // Output comment. if ($comment) $body .= '
'.htmlspecialchars($comment).'
'; - if ($bean->getAttribute('chtotalsonly')) { + if ($options['show_totals_only']) { // Totals only report. Output subtotals. // Determine group_by header. @@ -714,27 +713,27 @@ class ttReportHelper { $body .= '| '.$group_by_header.' | '; - if ($bean->getAttribute('chduration')) + if ($options['show_duration']) $body .= ''.$i18n->get('label.duration').' | '; - if ($bean->getAttribute('chunits')) + if ($options['show_work_units']) $body .= ''.$i18n->get('label.work_units_short').' | '; - if ($bean->getAttribute('chcost')) + if ($options['show_cost']) $body .= ''.$i18n->get('label.cost').' | '; $body .= '
| '.($subtotal['name'] ? htmlspecialchars($subtotal['name']) : ' ').' | '; - if ($bean->getAttribute('chduration')) { + if ($options['show_duration']) { $body .= ''; if ($subtotal['time'] <> '0:00') $body .= $subtotal['time']; $body .= ' | '; } - if ($bean->getAttribute('chunits')) { + if ($options['show_work_units']) { $body .= ''; $body .= $subtotal['units']; $body .= ' | '; } - if ($bean->getAttribute('chcost')) { + if ($options['show_cost']) { $body .= ''; $body .= ($canViewReports || $isClient) ? $subtotal['cost'] : $subtotal['expenses']; $body .= ' | '; @@ -742,6 +741,11 @@ class ttReportHelper { $body .= '