|
7 | 7 | * Copyright (C) 2013-2020 Philippe Grand <philippe.grand@atoo-net.com> |
8 | 8 | * Copyright (C) 2015 Marcos García <marcosgdf@gmail.com> |
9 | 9 | * Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr> |
| 10 | + * Copyright (C) 2024 Éric Seigne <eric.seigne@cap-rel.fr> |
10 | 11 | * |
11 | 12 | * This program is free software; you can redistribute it and/or modify |
12 | 13 | * 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 |
259 | 260 | $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 : 10); |
260 | 261 |
|
261 | 262 | // 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)) { |
263 | 272 | $tab_top -= 2; |
264 | 273 |
|
| 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 | + |
265 | 279 | $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); |
267 | 281 | $nexY = $pdf->GetY(); |
268 | 282 | $height_note = $nexY - $tab_top; |
269 | 283 |
|
|
0 commit comments