Added an option to use page breaks on PDF reports after grouped by blocks.
authorNik Okuntseff <support@anuko.com>
Sun, 10 Mar 2019 21:27:44 +0000 (21:27 +0000)
committerNik Okuntseff <support@anuko.com>
Sun, 10 Mar 2019 21:27:44 +0000 (21:27 +0000)
WEB-INF/lib/ttUserConfig.class.php
WEB-INF/templates/footer.tpl
topdf.php

index b926994..d0907bb 100644 (file)
@@ -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.
index 64cc8dc..47f3965 100644 (file)
@@ -12,7 +12,7 @@
       <br>
       <table cellspacing="0" cellpadding="4" width="100%" border="0">
         <tr>
-          <td align="center">&nbsp;Anuko Time Tracker 1.18.57.4860 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.18.58.4861 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
             <a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
             <a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
             <a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>
index 4ede4cd..f68be29 100644 (file)
--- a/topdf.php
+++ b/topdf.php
@@ -215,8 +215,17 @@ if ($totals_only) {
         if ($bean->getAttribute('chtimesheet')) $html .= '<td></td>';
         $html .= '</tr>';
         $html .= '<tr><td colspan="'.$colspan.'">&nbsp;</td></tr>';
+        // 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 .= '<br pagebreak="true"/>';
+        }
       }
-      $first_pass = false; 
+      $first_pass = false;
     }
 
     // Print a regular row.