From 0c4f2c49ae759b4f4f9b5002d0a413f89b6498e6 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 10 Mar 2019 21:27:44 +0000 Subject: [PATCH] Added an option to use page breaks on PDF reports after grouped by blocks. --- WEB-INF/lib/ttUserConfig.class.php | 1 + WEB-INF/templates/footer.tpl | 2 +- topdf.php | 11 ++++++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/WEB-INF/lib/ttUserConfig.class.php b/WEB-INF/lib/ttUserConfig.class.php index b9269944..d0907bb6 100644 --- a/WEB-INF/lib/ttUserConfig.class.php +++ b/WEB-INF/lib/ttUserConfig.class.php @@ -32,6 +32,7 @@ define('SYSC_LAST_REPORT_EMAIL', 'last_report_email'); define('SYSC_LAST_REPORT_CC', 'last_report_cc'); define('SYSC_LAST_INVOICE_EMAIL', 'last_invoice_email'); define('SYSC_LAST_INVOICE_CC', 'last_invoice_cc'); +define('SYSC_PDF_REPORT_PAGE_BREAKS', 'pdf_report_page_breaks'); // Class ttUserConfig is used for storing and retrieving named values associated with users. // When user is working on behalf of someone else, this class is still associated with a user. diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 64cc8dc1..47f39655 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
- '; $html .= ''; $html .= ''; + // TODO: page breaks on PDF reports is a rarely used feature. + // Currently without configuration capability. + // Consider adding an option to user profile instead. + if (isTrue('PDF_REPORT_PAGE_BREAKS')) { + import('ttUserConfig'); + $uc = new ttUserConfig(); + $use_breaks = $uc->getValue(PDF_REPORT_PAGE_BREAKS); + if ($use_breaks) $html .= '
'; + } } - $first_pass = false; + $first_pass = false; } // Print a regular row. -- 2.20.1
 Anuko Time Tracker 1.18.57.4860 | Copyright © Anuko | +  Anuko Time Tracker 1.18.58.4861 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/topdf.php b/topdf.php index 4ede4cdd..f68be29c 100644 --- a/topdf.php +++ b/topdf.php @@ -215,8 +215,17 @@ if ($totals_only) { if ($bean->getAttribute('chtimesheet')) $html .= '