From 9763bf0359b70369021d6f9b12b6e6cc9c0939f5 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 15 Dec 2018 16:12:59 +0000 Subject: [PATCH] Fixed work unit config. --- WEB-INF/lib/ttReportHelper.class.php | 4 ++-- WEB-INF/templates/footer.tpl | 2 +- work_units.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) 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'); } -- 2.20.1