From: Nik Okuntseff Date: Sun, 21 Apr 2019 14:10:51 +0000 (+0000) Subject: Removed unneeded subtotal row on reports, fixed printing of 0 subtotals. X-Git-Tag: timetracker_1.19-1~65 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=9b5a1834db24f25803fc0d461394e4a2bfcc44b7;p=timetracker.git Removed unneeded subtotal row on reports, fixed printing of 0 subtotals. --- diff --git a/WEB-INF/lib/ttReportHelper.class.php b/WEB-INF/lib/ttReportHelper.class.php index 5fd22531..966865fb 100644 --- a/WEB-INF/lib/ttReportHelper.class.php +++ b/WEB-INF/lib/ttReportHelper.class.php @@ -513,7 +513,7 @@ class ttReportHelper { $res = $mdb2->query($sql); if (is_a($res, 'PEAR_Error')) die($res->getMessage()); while ($val = $res->fetchRow()) { - $time = $val['time'] ? ttTimeHelper::minutesToDuration($val['time'] / 60) : null; + $time = ttTimeHelper::minutesToDuration($val['time'] / 60); $rowLabel = ttReportHelper::makeGroupByLabel($val['group_field'], $options); if ($options['show_cost']) { $decimalMark = $user->getDecimalMark(); @@ -595,7 +595,7 @@ class ttReportHelper { if (is_a($res, 'PEAR_Error')) die($res->getMessage()); $val = $res->fetchRow(); - $total_time = $val['time'] ? ttTimeHelper::minutesToDuration($val['time'] / 60) : null; + $total_time = ttTimeHelper::minutesToDuration($val['time'] / 60); if ($options['show_cost']) { $total_cost = $val['cost']; if (!$total_cost) $total_cost = '0.00'; diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index e0684a67..4216000f 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.19.1.4964 | Copyright © Anuko | +  Anuko Time Tracker 1.19.1.4965 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/report.php b/report.php index b82380d7..31cee67a 100644 --- a/report.php +++ b/report.php @@ -275,17 +275,16 @@ if ($request->isGet() && $use_checkboxes) if (ttReportHelper::grouping($options)) { $subtotals = ttReportHelper::getSubtotals($options); $smarty->assign('group_by_header', ttReportHelper::makeGroupByHeader($options)); + if ($report_items) { + // Assign variables that are used to print subtotals. + $smarty->assign('print_subtotals', true); + $smarty->assign('first_pass', true); + $smarty->assign('prev_grouped_by', ''); + $smarty->assign('cur_grouped_by', ''); + } } $totals = ttReportHelper::getTotals($options); -// Assign variables that are used to print subtotals. -if ($report_items) { - $smarty->assign('print_subtotals', true); - $smarty->assign('first_pass', true); - $smarty->assign('prev_grouped_by', ''); - $smarty->assign('cur_grouped_by', ''); -} - // Determine column span for note field. $colspan = 1; if ($user->can('view_reports') || $user->can('view_all_reports') || $user->isClient()) $colspan++;