From: Nik Okuntseff Date: Fri, 11 Mar 2016 08:10:11 +0000 (-0800) Subject: Made report footer optional depending on setting in config.php X-Git-Tag: timetracker_1.19-1~1833 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=029e1daa627ad332edd64bba79f5415fcaf1407d;p=timetracker.git Made report footer optional depending on setting in config.php The REPORT_FOOTER setting must be defined as false to remove the footer --- diff --git a/WEB-INF/config.php.dist b/WEB-INF/config.php.dist index 95efb4e8..25ba2c0d 100644 --- a/WEB-INF/config.php.dist +++ b/WEB-INF/config.php.dist @@ -173,6 +173,11 @@ define('CURRENCY_DEFAULT', '$'); define('EXPORT_DECIMAL_DURATION', true); +// REPORT_FOOTER - defines whether to use a footer on reports. +// +define('REPORT_FOOTER', true); + + // Authentication module (see WEB-INF/lib/auth/) // Possible authentication methods: // db - internal database, logins and password hashes are stored in time tracker database. diff --git a/WEB-INF/lib/ttReportHelper.class.php b/WEB-INF/lib/ttReportHelper.class.php index ac7d6794..8d422e6a 100644 --- a/WEB-INF/lib/ttReportHelper.class.php +++ b/WEB-INF/lib/ttReportHelper.class.php @@ -1055,13 +1055,13 @@ class ttReportHelper { // prepareReportBody - prepares an email body for report. static function prepareReportBody($bean, $comment) { - global $user; - global $i18n; + global $user; + global $i18n; $items = ttReportHelper::getItems($bean); $group_by = $bean->getAttribute('group_by'); if ($group_by && 'no_grouping' != $group_by) - $subtotals = ttReportHelper::getSubtotals($bean); + $subtotals = ttReportHelper::getSubtotals($bean); $totals = ttReportHelper::getTotals($bean); // Use custom fields plugin if it is enabled. @@ -1301,7 +1301,8 @@ class ttReportHelper { } // Output footer. - $body .= '

'.$i18n->getKey('form.mail.footer').'

'; + if (!defined('REPORT_FOOTER') || !(REPORT_FOOTER == false)) + $body .= '

'.$i18n->getKey('form.mail.footer').'

'; // Finish creating email body. $body .= ''; @@ -1558,7 +1559,8 @@ class ttReportHelper { } // Output footer. - $body .= '

'.$i18n->getKey('form.mail.footer').'

'; + if (!defined('REPORT_FOOTER') || !(REPORT_FOOTER == false)) + $body .= '

'.$i18n->getKey('form.mail.footer').'

'; // Finish creating email body. $body .= ''; diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 8bd37deb..2de3e4b8 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.9.13.3402 | Copyright © Anuko | +  Anuko Time Tracker 1.9.14.3403 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/topdf.php b/topdf.php index 286724fe..3f0a6dc7 100644 --- a/topdf.php +++ b/topdf.php @@ -311,7 +311,9 @@ if ($totals_only) { } // Output footer. -$html .= '

'.$i18n->getKey('form.mail.footer').'

'; +if (!defined('REPORT_FOOTER') || !(REPORT_FOOTER == false)) // By default we print it unless explicitely defined as false. + $html .= '

'.$i18n->getKey('form.mail.footer').'

'; + // By this time we have html ready. // Determine title for report. @@ -331,7 +333,7 @@ header('Content-Disposition: attachment; filename="timesheet.pdf"'); // Beginning of TCPDF code here. // Extend TCPDF class so that we can use custom header and footer. -class MyyPDF extends TCPDF { +class ttPDF extends TCPDF { public $image_file = 'images/tt_logo.png'; // Image file for the logo in header. public $page_word = 'Page'; // Localized "Page" word in footer, ex: Page 1/2. @@ -364,7 +366,7 @@ class MyyPDF extends TCPDF { } // Create new PDF document. -$pdf = new MyyPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); +$pdf = new ttPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); // If custom logo file exists - set it. if (file_exists('images/'.$user->team_id.'.png'))