X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=topdf.php;h=d017299b7ccb5f424afd6ae3f886576518e688a4;hb=765181f88bd61e74e2836d1ede6465945e2226cf;hp=286724fee300486ab54565515aca99d2aa2d4a42;hpb=5ef582473f6b329be18ad83c61e053fdcd9c6ed5;p=timetracker.git diff --git a/topdf.php b/topdf.php index 286724fe..d017299b 100644 --- a/topdf.php +++ b/topdf.php @@ -49,7 +49,7 @@ if (!ttAccessCheck(right_view_reports)) { } // Use custom fields plugin if it is enabled. -if (in_array('cf', explode(',', $user->plugins))) { +if ($user->isPluginEnabled('cf')) { require_once('plugins/CustomFields.class.php'); $custom_fields = new CustomFields($user->team_id); } @@ -159,7 +159,7 @@ if ($totals_only) { if ($bean->getAttribute('chinvoice')) { $colspan++; $html .= ''.$i18n->getKey('label.invoice').''; } $html .= ''; $html .= ''; - + foreach ($items as $item) { // Print a subtotal for a block of grouped values. $cur_date = $item['date']; @@ -234,11 +234,11 @@ if ($totals_only) { } if ($bean->getAttribute('chinvoice')) $html .= ''.htmlspecialchars($item['invoice']).''; $html .= ''; - + $prev_date = $item['date']; if ($print_subtotals) $prev_grouped_by = $item['grouped_by']; } - + // Print a terminating subtotal. if ($print_subtotals) { $html .= ''; @@ -283,7 +283,7 @@ if ($totals_only) { if ($bean->getAttribute('chinvoice')) $html .= ''; $html .= ''; } - + // Print totals. $html .= ' '; $html .= ''; @@ -302,7 +302,7 @@ if ($totals_only) { if ($user->canManageTeam() || $user->isClient()) $html .= $totals['cost']; else - $html .= $totals['expenses']; + $html .= $totals['expenses']; $html .= ''; } if ($bean->getAttribute('chinvoice')) $html .= ''; @@ -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,21 +333,21 @@ 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. - + // SetImageFile - sets image file name. public function SetImageFile($imgFile) { $this->image_file = $imgFile; } - + // SetPageWord - sets page word for footer. public function SetPageWord($pageWord) { $this->page_word = $pageWord; } - + // Page header. public function Header() { // Print logo, which is the only element of our custom header. @@ -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'))