Improved output of pdf reports by including grouped values in subtotals.
authorNik Okuntseff <support@anuko.com>
Thu, 1 Nov 2018 19:46:45 +0000 (19:46 +0000)
committerNik Okuntseff <support@anuko.com>
Thu, 1 Nov 2018 19:46:45 +0000 (19:46 +0000)
WEB-INF/templates/footer.tpl
topdf.php

index af9a278..90e8b3c 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.18.05.4342 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.18.05.4343 | 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>
index 15ac1ee..e3801d2 100644 (file)
--- a/topdf.php
+++ b/topdf.php
@@ -172,27 +172,27 @@ if ($totals_only) {
         $html .= '<td>'.$i18n->get('label.subtotal').'</td>';
         if ($user->can('view_reports') || $user->can('view_all_reports') || $user->isClient()) {
             $html .= '<td>';
-            if ($group_by1 == 'user') $html .= htmlspecialchars($subtotals[$prev_grouped_by]['name']);
+            $html .= htmlspecialchars($subtotals[$prev_grouped_by]['user']);
             $html .= '</td>';
         }
         if ($bean->getAttribute('chclient')) {
             $html .= '<td>';
-            if ($group_by1 == 'client') $html .= htmlspecialchars($subtotals[$prev_grouped_by]['name']);
+            $html .= htmlspecialchars($subtotals[$prev_grouped_by]['client']);
             $html .= '</td>';
         }
         if ($bean->getAttribute('chproject')) {
             $html .= '<td>';
-            if ($group_by1 == 'project') $html .= htmlspecialchars($subtotals[$prev_grouped_by]['name']);
+            $html .= htmlspecialchars($subtotals[$prev_grouped_by]['project']);
             $html .= '</td>';
         }
         if ($bean->getAttribute('chtask')) {
             $html .= '<td>';
-            if ($group_by1 == 'task') $html .= htmlspecialchars($subtotals[$prev_grouped_by]['name']);
+            $html .= htmlspecialchars($subtotals[$prev_grouped_by]['task']);
             $html .= '</td>';
         }
         if ($bean->getAttribute('chcf_1')) {
             $html .= '<td>';
-            if ($group_by1 == 'cf_1') $html .= htmlspecialchars($subtotals[$prev_grouped_by]['name']);
+            $html .= htmlspecialchars($subtotals[$prev_grouped_by]['cf_1']);
             $html .= '</td>';
         }
         if ($bean->getAttribute('chstart')) $html .= '<td></td>';
@@ -261,27 +261,27 @@ if ($totals_only) {
     $html .= '<td>'.$i18n->get('label.subtotal').'</td>';
     if ($user->can('view_reports') || $user->can('view_all_reports') || $user->isClient()) {
       $html .= '<td>';
-      if ($group_by1 == 'user') $html .= htmlspecialchars($subtotals[$prev_grouped_by]['name']);
+      $html .= htmlspecialchars($subtotals[$prev_grouped_by]['user']);
       $html .= '</td>';
     }
     if ($bean->getAttribute('chclient')) {
       $html .= '<td>';
-      if ($group_by1 == 'client') $html .= htmlspecialchars($subtotals[$prev_grouped_by]['name']);
+      $html .= htmlspecialchars($subtotals[$prev_grouped_by]['client']);
       $html .= '</td>';
     }
     if ($bean->getAttribute('chproject')) {
       $html .= '<td>';
-      if ($group_by1 == 'project') $html .= htmlspecialchars($subtotals[$prev_grouped_by]['name']);
+      $html .= htmlspecialchars($subtotals[$prev_grouped_by]['project']);
       $html .= '</td>';
     }
     if ($bean->getAttribute('chtask')) {
       $html .= '<td>';
-      if ($group_by1 == 'task') $html .= htmlspecialchars($subtotals[$prev_grouped_by]['name']);
+      $html .= htmlspecialchars($subtotals[$prev_grouped_by]['task']);
       $html .= '</td>';
     }
     if ($bean->getAttribute('chcf_1')) {
       $html .= '<td>';
-      if ($group_by1 == 'cf_1') $html .= htmlspecialchars($subtotals[$prev_grouped_by]['name']);
+      $html .= htmlspecialchars($subtotals[$prev_grouped_by]['cf_1']);
       $html .= '</td>';
     }
     if ($bean->getAttribute('chstart')) $html .= '<td></td>';