From 926dd539ace8f4019e3953fe06fd41298777b4fe Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 10 Mar 2024 15:01:26 +0100 Subject: [PATCH] update code, better compliance with php8 --- .../modules/commande/doc/pdf_eratosthene.modules.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 232880038529e..ca7209733f5a8 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -89,7 +89,7 @@ class pdf_eratosthene extends ModelePDFCommandes * * @param DoliDB $db Database handler */ - public function __construct($db) + public function __construct(DoliDB $db) { global $conf, $langs, $mysoc; @@ -295,8 +295,11 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $pdf->SetAutoPageBreak(1, 0); $heightforinfotot = 40; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page - $heightforfooter = $this->marge_basse + (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS') ? 12 : 22); // Height reserved to output the footer (value include bottom margin) + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page + $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) + if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { + $heightforfooter += 6; + } if (class_exists('TCPDF')) { $pdf->setPrintHeader(false); @@ -343,7 +346,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede $pdf->useTemplate($tplidx); } $pagenb++; - $top_shift = $this->_pagehead($pdf, $object, 1, $outputlangs, $outputlangsbis); + $top_shift = $this->_pagehead($pdf, $object, 1, $outputlangs, (is_object($outputlangsbis) ? $outputlangsbis : null)); $pdf->SetFont('', '', $default_font_size - 1); $pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->SetTextColor(0, 0, 0);