From f377456132e272ab4f0cb734c557fd84740a7311 Mon Sep 17 00:00:00 2001 From: Louis Carrese Date: Tue, 20 Oct 2020 14:19:37 +0200 Subject: [PATCH 1/2] CLOSE #15065 Put the product label in bold in the PDF templates if configured The global configuration variable PDF_BOLD_PRODUCT_LABEL is checked to put the product label in bold in the PDF templates. This modification is based on the same behaviour for the product reference, found at line 1373 of the same file. The products table of the invoices / commercial propositions is produced in the PDF library, hence we have to modify this library to style the invoices. Producing a new template would mean duplicating code from the library with the maintenace implications. --- htdocs/core/lib/pdf.lib.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 4156b89a2ab..ad285d4e420 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1278,8 +1278,12 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, // Description short of product line $libelleproduitservice = $label; + if (!empty($libelleproduitservice) && !empty($conf->global->PDF_BOLD_PRODUCT_LABEL)) + { + $libelleproduitservice = ''.$libelleproduitservice.''; + } - // Description long of product line + // Description long of product line if (!empty($desc) && ($desc != $label)) { if ($libelleproduitservice && empty($hidedesc)) From 693e345cab901e9b26e4d64802ed8e513a862bc4 Mon Sep 17 00:00:00 2001 From: Louis Carrese Date: Tue, 20 Oct 2020 14:34:17 +0200 Subject: [PATCH 2/2] CLOSE #15065 Fix formatting Had spaces instead of tabs... --- htdocs/core/lib/pdf.lib.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index ad285d4e420..0ff40659daa 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1278,12 +1278,11 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, // Description short of product line $libelleproduitservice = $label; - if (!empty($libelleproduitservice) && !empty($conf->global->PDF_BOLD_PRODUCT_LABEL)) - { - $libelleproduitservice = ''.$libelleproduitservice.''; - } + if (!empty($libelleproduitservice) && !empty($conf->global->PDF_BOLD_PRODUCT_LABEL)) { + $libelleproduitservice = '' . $libelleproduitservice . ''; + } - // Description long of product line + // Description long of product line if (!empty($desc) && ($desc != $label)) { if ($libelleproduitservice && empty($hidedesc))