From 1e825770a4defc5eb8d2032c35dc90e8bc8684da Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 10 Mar 2019 18:16:30 +0000 Subject: [PATCH] A fix for column span for user reports. --- WEB-INF/lib/ttReportHelper.class.php | 18 ++++++++++++++++++ WEB-INF/templates/footer.tpl | 2 +- report.php | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/WEB-INF/lib/ttReportHelper.class.php b/WEB-INF/lib/ttReportHelper.class.php index 0cc2702c..4de5a483 100644 --- a/WEB-INF/lib/ttReportHelper.class.php +++ b/WEB-INF/lib/ttReportHelper.class.php @@ -738,6 +738,24 @@ class ttReportHelper { $cellLeftAlignedSubtotal = 'font-weight: bold; text-align: left; vertical-align: top;'; $cellRightAlignedSubtotal = 'font-weight: bold; text-align: right; vertical-align: top;'; + // Determine column span for note field. + $colspan = 1; + if ($user->can('view_reports') || $user->can('view_all_reports') || $user->isClient()) $colspan++; + if ($options['show_client']) $colspan++; + if ($options['show_project']) $colspan++; + if ($options['show_task']) $colspan++; + if ($options['show_custom_field_1']) $colspan++; + if ($options['show_start']) $colspan++; + if ($options['show_end']) $colspan++; + if ($options['show_duration']) $colspan++; + if ($options['show_work_units']) $colspan++; + if ($options['show_cost']) $colspan++; + if ($options['show_approved']) $colspan++; + if ($options['show_paid']) $colspan++; + if ($options['show_ip']) $colspan++; + if ($options['show_invoice']) $colspan++; + if ($options['show_timesheet']) $colspan++; + // Start creating email body. $body = ''; $body .= ''; diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 30e8b2ef..2fb33067 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.18.57.4857 | Copyright © Anuko | +  Anuko Time Tracker 1.18.57.4858 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/report.php b/report.php index 9f29069d..620064af 100644 --- a/report.php +++ b/report.php @@ -284,7 +284,7 @@ if ($report_items) { // Determine column span for note field. $colspan = 1; -if ($bean->getAttribute('chuser')) $colspan++; +if ($user->can('view_reports') || $user->can('view_all_reports') || $user->isClient()) $colspan++; if ($bean->getAttribute('chclient')) $colspan++; if ($bean->getAttribute('chproject')) $colspan++; if ($bean->getAttribute('chtask')) $colspan++; -- 2.20.1