From bd92aeb3404ed8625272abccc9a8766f13ab75e6 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 6 Aug 2018 14:02:29 +0000 Subject: [PATCH] A bit of refactoring. --- WEB-INF/lib/ttReportHelper.class.php | 21 ++++++++++++--------- WEB-INF/templates/footer.tpl | 2 +- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/WEB-INF/lib/ttReportHelper.class.php b/WEB-INF/lib/ttReportHelper.class.php index 46ce3f85..1f165478 100644 --- a/WEB-INF/lib/ttReportHelper.class.php +++ b/WEB-INF/lib/ttReportHelper.class.php @@ -699,9 +699,7 @@ class ttReportHelper { // Output comment. if ($comment) $body .= '

'.htmlspecialchars($comment).'

'; -// TODO: refactoring ongoing down from here... - - if ($bean->getAttribute('chtotalsonly')) { + if ($options['show_totals_only']) { // Totals only report. Output subtotals. // Determine group_by header. @@ -715,27 +713,27 @@ class ttReportHelper { $body .= ''; $body .= ''; $body .= ''; - if ($bean->getAttribute('chduration')) + if ($options['show_duration']) $body .= ''; - if ($bean->getAttribute('chunits')) + if ($options['show_work_units']) $body .= ''; - if ($bean->getAttribute('chcost')) + if ($options['show_cost']) $body .= ''; $body .= ''; foreach($subtotals as $subtotal) { $body .= ''; $body .= ''; - if ($bean->getAttribute('chduration')) { + if ($options['show_duration']) { $body .= ''; } - if ($bean->getAttribute('chunits')) { + if ($options['show_work_units']) { $body .= ''; } - if ($bean->getAttribute('chcost')) { + if ($options['show_cost']) { $body .= ''; @@ -743,6 +741,11 @@ class ttReportHelper { $body .= ''; } +// TODO: refactoring ongoing down from here... + + + + // Print totals. $body .= ''; $body .= ''; diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index c8a4919c..cdbd8cbb 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
'.$group_by_header.''.$i18n->get('label.duration').''.$i18n->get('label.work_units_short').''.$i18n->get('label.cost').'
'.($subtotal['name'] ? htmlspecialchars($subtotal['name']) : ' ').''; if ($subtotal['time'] <> '0:00') $body .= $subtotal['time']; $body .= ''; $body .= $subtotal['units']; $body .= ''; $body .= ($canViewReports || $isClient) ? $subtotal['cost'] : $subtotal['expenses']; $body .= '
 
-
 Anuko Time Tracker 1.17.98.4317 | Copyright © Anuko | +  Anuko Time Tracker 1.17.98.4318 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} -- 2.20.1