Skip to content

Commit

Permalink
update code, better compliance with php8
Browse files Browse the repository at this point in the history
  • Loading branch information
grandoc committed Mar 10, 2024
1 parent e36898d commit 926dd53
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 926dd53

Please sign in to comment.