A little bit more refactoring.
authorNik Okuntseff <support@anuko.com>
Tue, 31 Jul 2018 23:32:49 +0000 (23:32 +0000)
committerNik Okuntseff <support@anuko.com>
Tue, 31 Jul 2018 23:32:49 +0000 (23:32 +0000)
WEB-INF/lib/ttReportHelper.class.php
WEB-INF/templates/footer.tpl

index 1b1adf9..42463d0 100644 (file)
@@ -157,19 +157,19 @@ class ttReportHelper {
         array_push($fields, 'cfo.value as cf_1');
       }
     }
-
-// TODO: refactoring in progress down from here... The above is identical to getFavItems and is ready to merge.
     // Add start time.
-    if ($bean->getAttribute('chstart')) {
+    if ($options['show_start']) {
       array_push($fields, "l.start as unformatted_start");
       array_push($fields, "TIME_FORMAT(l.start, '%k:%i') as start");
     }
     // Add finish time.
-    if ($bean->getAttribute('chfinish'))
+    if ($options['show_end'])
       array_push($fields, "TIME_FORMAT(sec_to_time(time_to_sec(l.start) + time_to_sec(l.duration)), '%k:%i') as finish");
     // Add duration.
-    if ($bean->getAttribute('chduration'))
+    if ($options['show_duration'])
       array_push($fields, "TIME_FORMAT(l.duration, '%k:%i') as duration");
+
+// TODO: refactoring in progress down from here... The above is identical to getFavItems and is ready to merge.
     // Add work units.
     if ($bean->getAttribute('chunits')) {
       if ($user->unit_totals_only)
@@ -1816,8 +1816,8 @@ class ttReportHelper {
  */
     $options['show_project'] = $bean->getAttribute('chproject');
     $options['show_start'] = $bean->getAttribute('chstart');
+    $options['show_duration'] = $bean->getAttribute('chduration');
 /*
-  `show_duration` tinyint(4) NOT NULL default 0,         # whether to show duration field
   `show_cost` tinyint(4) NOT NULL default 0,             # whether to show cost field
  */
     $options['show_task'] = $bean->getAttribute('chtask');
index 4711f93..bcbfab0 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.97.4305 | 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.97.4306 | 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>