From: Nik Okuntseff Date: Sat, 15 Dec 2018 16:12:59 +0000 (+0000) Subject: Fixed work unit config. X-Git-Tag: timetracker_1.19-1~407 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=9763bf0359b70369021d6f9b12b6e6cc9c0939f5;p=timetracker.git Fixed work unit config. --- diff --git a/WEB-INF/lib/ttReportHelper.class.php b/WEB-INF/lib/ttReportHelper.class.php index 2265f0da..d46319db 100644 --- a/WEB-INF/lib/ttReportHelper.class.php +++ b/WEB-INF/lib/ttReportHelper.class.php @@ -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"); } } diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 84526cfb..de22892f 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.18.31.4656 | Copyright © Anuko | +  Anuko Time Tracker 1.18.31.4658 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/work_units.php b/work_units.php index 84ef37e0..e4d198d5 100644 --- a/work_units.php +++ b/work_units.php @@ -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'); }