Fixed work unit config.
authorNik Okuntseff <support@anuko.com>
Sat, 15 Dec 2018 16:12:59 +0000 (16:12 +0000)
committerNik Okuntseff <support@anuko.com>
Sat, 15 Dec 2018 16:12:59 +0000 (16:12 +0000)
WEB-INF/lib/ttReportHelper.class.php
WEB-INF/templates/footer.tpl
work_units.php

index 2265f0d..d46319d 100644 (file)
@@ -191,8 +191,8 @@ class ttReportHelper {
       if ($user->getConfigOption('unit_totals_only'))
         array_push($fields, "null as units");
       else {
-        $firstUnitThreshold = $user->getConfigInt('1st_unit_threshold');
-        $minutesInUnit = $user->getConfigInt('minutes_in_unit');
+        $firstUnitThreshold = $user->getConfigInt('1st_unit_threshold', 0);
+        $minutesInUnit = $user->getConfigInt('minutes_in_unit', 15);
         array_push($fields, "if(l.billable = 0 or time_to_sec(l.duration)/60 < $firstUnitThreshold, 0, ceil(time_to_sec(l.duration)/60/$minutesInUnit)) as units");
       }
     }
index 84526cf..de22892 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.31.4656 | 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.31.4658 | 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 84ef37e..e4d198d 100644 (file)
@@ -48,8 +48,8 @@ if ($request->isPost()) {
   $cl_1st_unit_threshold = $request->getParameter('1st_unit_threshold');
   $cl_totals_only = $request->getParameter('totals_only');
 } else {
-  $cl_minutes_in_unit = $user->getConfigInt('minutes_in_unit');
-  $cl_1st_unit_threshold = $user->getConfigInt('1st_unit_threshold');
+  $cl_minutes_in_unit = $user->getConfigInt('minutes_in_unit', 15);
+  $cl_1st_unit_threshold = $user->getConfigInt('1st_unit_threshold', 0);
   $cl_totals_only = $user->getConfigOption('unit_totals_only');
 }