Reorganized code a bit for clarity.
authorNik Okuntseff <support@anuko.com>
Mon, 28 Mar 2016 20:53:48 +0000 (20:53 +0000)
committerNik Okuntseff <support@anuko.com>
Mon, 28 Mar 2016 20:53:48 +0000 (20:53 +0000)
WEB-INF/lib/ttReportHelper.class.php
WEB-INF/templates/footer.tpl

index d7c50a9..582d289 100644 (file)
@@ -733,26 +733,25 @@ class ttReportHelper {
 
     // Execute query.
     $res = $mdb2->query($sql);
-    if (!is_a($res, 'PEAR_Error')) {
-      while ($val = $res->fetchRow()) {
-        if ('date' == $group_by_option) {
-          // This is needed to get the date in user date format.
-          $o_date = new DateAndTime(DB_DATEFORMAT, $val['group_field']);
-          $val['group_field'] = $o_date->toString($user->date_format);
-          unset($o_date);
-        }
-        $time = $val['time'] ? sec_to_time_fmt_hm($val['time']) : null;
-        if ($bean->getAttribute('chcost')) {
-          if ('.' != $user->decimal_mark) {
-            $val['cost'] = str_replace('.', $user->decimal_mark, $val['cost']);
-            $val['expenses'] = str_replace('.', $user->decimal_mark, $val['expenses']);
-          }
-          $subtotals[$val['group_field']] = array('name'=>$val['group_field'],'time'=>$time,'cost'=>$val['cost'],'expenses'=>$val['expenses']);
-        } else
-          $subtotals[$val['group_field']] = array('name'=>$val['group_field'],'time'=>$time);
+    if (is_a($res, 'PEAR_Error')) die($res->getMessage());
+
+    while ($val = $res->fetchRow()) {
+      if ('date' == $group_by_option) {
+        // This is needed to get the date in user date format.
+        $o_date = new DateAndTime(DB_DATEFORMAT, $val['group_field']);
+        $val['group_field'] = $o_date->toString($user->date_format);
+        unset($o_date);
       }
-    } else
-      die($res->getMessage());
+      $time = $val['time'] ? sec_to_time_fmt_hm($val['time']) : null;
+      if ($bean->getAttribute('chcost')) {
+        if ('.' != $user->decimal_mark) {
+          $val['cost'] = str_replace('.', $user->decimal_mark, $val['cost']);
+          $val['expenses'] = str_replace('.', $user->decimal_mark, $val['expenses']);
+        }
+        $subtotals[$val['group_field']] = array('name'=>$val['group_field'],'time'=>$time,'cost'=>$val['cost'],'expenses'=>$val['expenses']);
+      } else
+        $subtotals[$val['group_field']] = array('name'=>$val['group_field'],'time'=>$time);
+    }
 
     return $subtotals;
   }
index c6931a0..8d51d37 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.9.20.3447 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.9.20.3448 | 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>