A bit of refactoring.
authorNik Okuntseff <support@anuko.com>
Mon, 6 Aug 2018 14:02:29 +0000 (14:02 +0000)
committerNik Okuntseff <support@anuko.com>
Mon, 6 Aug 2018 14:02:29 +0000 (14:02 +0000)
WEB-INF/lib/ttReportHelper.class.php
WEB-INF/templates/footer.tpl

index 46ce3f8..1f16547 100644 (file)
@@ -699,9 +699,7 @@ class ttReportHelper {
     // Output comment.
     if ($comment) $body .= '<p>'.htmlspecialchars($comment).'</p>';
 
-// 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 .= '<table border="0" cellpadding="4" cellspacing="0" width="100%">';
       $body .= '<tr>';
       $body .= '<td style="'.$tableHeader.'">'.$group_by_header.'</td>';
-      if ($bean->getAttribute('chduration'))
+      if ($options['show_duration'])
         $body .= '<td style="'.$tableHeaderCentered.'" width="5%">'.$i18n->get('label.duration').'</td>';
-      if ($bean->getAttribute('chunits'))
+      if ($options['show_work_units'])
         $body .= '<td style="'.$tableHeaderCentered.'" width="5%">'.$i18n->get('label.work_units_short').'</td>';
-      if ($bean->getAttribute('chcost'))
+      if ($options['show_cost'])
         $body .= '<td style="'.$tableHeaderCentered.'" width="5%">'.$i18n->get('label.cost').'</td>';
       $body .= '</tr>';
       foreach($subtotals as $subtotal) {
         $body .= '<tr style="'.$rowSubtotal.'">';
         $body .= '<td style="'.$cellLeftAlignedSubtotal.'">'.($subtotal['name'] ? htmlspecialchars($subtotal['name']) : '&nbsp;').'</td>';
-        if ($bean->getAttribute('chduration')) {
+        if ($options['show_duration']) {
           $body .= '<td style="'.$cellRightAlignedSubtotal.'">';
           if ($subtotal['time'] <> '0:00') $body .= $subtotal['time'];
           $body .= '</td>';
         }
-        if ($bean->getAttribute('chunits')) {
+        if ($options['show_work_units']) {
           $body .= '<td style="'.$cellRightAlignedSubtotal.'">';
           $body .= $subtotal['units'];
           $body .= '</td>';
         }
-        if ($bean->getAttribute('chcost')) {
+        if ($options['show_cost']) {
           $body .= '<td style="'.$cellRightAlignedSubtotal.'">';
           $body .= ($canViewReports || $isClient) ? $subtotal['cost'] : $subtotal['expenses'];
           $body .= '</td>';
@@ -743,6 +741,11 @@ class ttReportHelper {
         $body .= '</tr>';
       }
 
+// TODO: refactoring ongoing down from here...
+
+
+
+
       // Print totals.
       $body .= '<tr><td>&nbsp;</td></tr>';
       $body .= '<tr style="'.$rowSubtotal.'">';
index c8a4919..cdbd8cb 100644 (file)
@@ -12,7 +12,7 @@
       <br>
       <table cellspacing="0" cellpadding="4" width="100%" border="0">
         <tr>
-          <td align="center">&nbsp;Anuko Time Tracker 1.17.98.4317 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.17.98.4318 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
             <a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
             <a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
             <a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>