Skip to content

Commit ad2e2fe

Browse files
committed
Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 19.0
2 parents 49d936c + 67c2a48 commit ad2e2fe

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

htdocs/core/modules/contract/doc/pdf_strato.modules.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* Copyright (C) 2013-2020 Philippe Grand <philippe.grand@atoo-net.com>
88
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
99
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
10+
* Copyright (C) 2024 Éric Seigne <eric.seigne@cap-rel.fr>
1011
*
1112
* This program is free software; you can redistribute it and/or modify
1213
* it under the terms of the GNU General Public License as published by
@@ -259,11 +260,24 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede
259260
$tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 : 10);
260261

261262
// Display notes
262-
if (!empty($object->note_public)) {
263+
$notetoshow = empty($object->note_public) ? '' : $object->note_public;
264+
265+
// Extrafields in note
266+
$extranote = $this->getExtrafieldsInHtml($object, $outputlangs);
267+
if (!empty($extranote)) {
268+
$notetoshow = dol_concatdesc($notetoshow, $extranote);
269+
}
270+
271+
if (!empty($notetoshow)) {
263272
$tab_top -= 2;
264273

274+
$substitutionarray = pdf_getSubstitutionArray($outputlangs, null, $object);
275+
complete_substitutions_array($substitutionarray, $outputlangs, $object);
276+
$notetoshow = make_substitutions($notetoshow, $substitutionarray, $outputlangs);
277+
$notetoshow = convertBackOfficeMediasLinksToPublicLinks($notetoshow);
278+
265279
$pdf->SetFont('', '', $default_font_size - 1);
266-
$pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top - 1, dol_htmlentitiesbr($object->note_public), 0, 1);
280+
$pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top - 1, dol_htmlentitiesbr($notetoshow), 0, 1);
267281
$nexY = $pdf->GetY();
268282
$height_note = $nexY - $tab_top;
269283

0 commit comments

Comments
 (0)