Removed unneeded subtotal row on reports, fixed printing of 0 subtotals.
authorNik Okuntseff <support@anuko.com>
Sun, 21 Apr 2019 14:10:51 +0000 (14:10 +0000)
committerNik Okuntseff <support@anuko.com>
Sun, 21 Apr 2019 14:11:28 +0000 (14:11 +0000)
WEB-INF/lib/ttReportHelper.class.php
WEB-INF/templates/footer.tpl
report.php

index 5fd2253..966865f 100644 (file)
@@ -513,7 +513,7 @@ class ttReportHelper {
     $res = $mdb2->query($sql);
     if (is_a($res, 'PEAR_Error')) die($res->getMessage());
     while ($val = $res->fetchRow()) {
-      $time = $val['time'] ? ttTimeHelper::minutesToDuration($val['time'] / 60) : null;
+      $time = ttTimeHelper::minutesToDuration($val['time'] / 60);
       $rowLabel = ttReportHelper::makeGroupByLabel($val['group_field'], $options);
       if ($options['show_cost']) {
         $decimalMark = $user->getDecimalMark();
@@ -595,7 +595,7 @@ class ttReportHelper {
     if (is_a($res, 'PEAR_Error')) die($res->getMessage());
 
     $val = $res->fetchRow();
-    $total_time = $val['time'] ? ttTimeHelper::minutesToDuration($val['time'] / 60) : null;
+    $total_time = ttTimeHelper::minutesToDuration($val['time'] / 60);
     if ($options['show_cost']) {
       $total_cost = $val['cost'];
       if (!$total_cost) $total_cost = '0.00';
index e0684a6..4216000 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.19.1.4964 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.19.1.4965 | 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 b82380d..31cee67 100644 (file)
@@ -275,17 +275,16 @@ if ($request->isGet() && $use_checkboxes)
 if (ttReportHelper::grouping($options)) {
   $subtotals = ttReportHelper::getSubtotals($options);
   $smarty->assign('group_by_header', ttReportHelper::makeGroupByHeader($options));
+  if ($report_items) {
+    // Assign variables that are used to print subtotals.
+    $smarty->assign('print_subtotals', true);
+    $smarty->assign('first_pass', true);
+    $smarty->assign('prev_grouped_by', '');
+    $smarty->assign('cur_grouped_by', '');
+  }
 }
 $totals = ttReportHelper::getTotals($options);
 
-// Assign variables that are used to print subtotals.
-if ($report_items) {
-  $smarty->assign('print_subtotals', true);
-  $smarty->assign('first_pass', true);
-  $smarty->assign('prev_grouped_by', '');
-  $smarty->assign('cur_grouped_by', '');
-}
-
 // Determine column span for note field.
 $colspan = 1;
 if ($user->can('view_reports') || $user->can('view_all_reports') || $user->isClient()) $colspan++;