From 20e681d025307a78cba5e60074ea1e17f4c98465 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 28 Aug 2021 20:59:12 +0200 Subject: [PATCH] Revert "[NEW] PDF Document ref in title option" --- htdocs/admin/pdf.php | 2 -- .../commande/doc/pdf_einstein.modules.php | 14 +++++++++----- .../commande/doc/pdf_eratosthene.modules.php | 18 ++++++++++++++---- .../contract/doc/pdf_strato.modules.php | 13 +++++++++---- .../expedition/doc/pdf_espadon.modules.php | 8 ++++++-- .../expedition/doc/pdf_rouget.modules.php | 10 ++++++---- .../modules/facture/doc/pdf_crabe.modules.php | 2 -- .../modules/facture/doc/pdf_sponge.modules.php | 2 -- .../fichinter/doc/pdf_soleil.modules.php | 12 ++++++++---- .../modules/propale/doc/pdf_azur.modules.php | 11 ++++++++--- .../modules/propale/doc/pdf_cyan.modules.php | 18 ++++++++++++++---- 11 files changed, 74 insertions(+), 36 deletions(-) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 9cd5836d2e8..5030c487537 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -4,7 +4,6 @@ * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2012-2107 Juanjo Menent * Copyright (C) 2019 Ferran Marcet - * Copyright (C) 2021 Anthony Berton * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -94,7 +93,6 @@ if ($action == 'update') { if (GETPOSTISSET('MAIN_DOCUMENTS_LOGO_HEIGHT')) dolibarr_set_const($db, "MAIN_DOCUMENTS_LOGO_HEIGHT", GETPOST("MAIN_DOCUMENTS_LOGO_HEIGHT", 'int'), 'chaine', 0, '', $conf->entity); if (GETPOSTISSET('MAIN_INVERT_SENDER_RECIPIENT')) dolibarr_set_const($db, "MAIN_INVERT_SENDER_RECIPIENT", GETPOST("MAIN_INVERT_SENDER_RECIPIENT"), 'chaine', 0, '', $conf->entity); - if (GETPOSTISSET('MAIN_PDF_USE_ISO_LOCATION')) dolibarr_set_const($db, "MAIN_PDF_USE_ISO_LOCATION", GETPOST("MAIN_PDF_USE_ISO_LOCATION"), 'chaine', 0, '', $conf->entity); if (GETPOSTISSET('MAIN_PDF_NO_CUSTOMER_CODE')) dolibarr_set_const($db, "MAIN_PDF_NO_CUSTOMER_CODE", GETPOST("MAIN_PDF_NO_CUSTOMER_CODE"), 'chaine', 0, '', $conf->entity); diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 2a1f283a02c..be0b9f3c6fe 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -1311,16 +1311,20 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); $title = $outputlangs->transnoentities($titlekey); - - $title .= " " . $outputlangs->convToOutputCharset($object->ref); - $pdf->MultiCell($w, 3, $title, '', 'R'); + $pdf->SetFont('', 'B', $default_font_size); + + $posy += 5; + $pdf->SetXY($posx, $posy); + $pdf->SetTextColor(0, 0, 60); + $pdf->MultiCell(100, 4, $outputlangs->transnoentities("Ref")." : ".$outputlangs->convToOutputCharset($object->ref), '', 'R'); + + $posy += 1; $pdf->SetFont('', '', $default_font_size - 1); - $posy += 2; if ($object->ref_client) { - $posy += 3; + $posy += 5; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell($w, 3, $outputlangs->transnoentities("RefCustomer")." : ".$outputlangs->convToOutputCharset($object->ref_client), '', 'R'); diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index b8622fe3b26..7e04445ea15 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -1483,15 +1483,25 @@ class pdf_eratosthene extends ModelePDFCommandes $title .= $outputlangsbis->transnoentities($titlekey); } - $title .= " " . $outputlangs->convToOutputCharset($object->ref); - $pdf->MultiCell($w, 3, $title, '', 'R'); + $pdf->SetFont('', 'B', $default_font_size); + + $posy += 5; + $pdf->SetXY($posx, $posy); + $pdf->SetTextColor(0, 0, 60); + $textref = $outputlangs->transnoentities("Ref")." : ".$outputlangs->convToOutputCharset($object->ref); + if ($object->statut == $object::STATUS_DRAFT) { + $pdf->SetTextColor(128, 0, 0); + $textref .= ' - '.$outputlangs->transnoentities("NotValidated"); + } + $pdf->MultiCell($w, 4, $textref, '', 'R'); + + $posy += 1; $pdf->SetFont('', '', $default_font_size - 2); - $posy += 2; if ($object->ref_client) { - $posy += 3; + $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell($w, 3, $outputlangs->transnoentities("RefCustomer")." : ".$outputlangs->convToOutputCharset($object->ref_client), '', 'R'); diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index d3d0f1905ff..638c22221bd 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -640,16 +640,21 @@ class pdf_strato extends ModelePDFContract $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); $title = $outputlangs->transnoentities("ContractCard"); - - $title .= " " . $outputlangs->convToOutputCharset($object->ref); - $pdf->MultiCell(100, 4, $title, '', 'R'); - $pdf->SetFont('', '', $default_font_size); + $pdf->SetFont('', 'B', $default_font_size + 2); $posy += 5; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); + $pdf->MultiCell(100, 4, $outputlangs->transnoentities("Ref")." : ".$outputlangs->convToOutputCharset($object->ref), '', 'R'); + + $posy += 1; + $pdf->SetFont('', '', $default_font_size); + + $posy += 4; + $pdf->SetXY($posx, $posy); + $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("Date")." : ".dol_print_date($object->date_contrat, "day", false, $outputlangs, true), '', 'R'); if (empty($conf->global->MAIN_PDF_HIDE_CUSTOMER_CODE) && $object->thirdparty->code_client) { diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index c20ffec1d72..28d797acffc 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -1003,12 +1003,16 @@ class pdf_espadon extends ModelePdfExpedition $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); $title = $outputlangs->transnoentities("SendingSheet"); - $title .= " " . $outputlangs->convToOutputCharset($object->ref); - $pdf->MultiCell($w, 4, $title, '', 'R'); $pdf->SetFont('', '', $default_font_size + 1); + $posy += 5; + + $pdf->SetXY($posx, $posy); + $pdf->SetTextColor(0, 0, 60); + $pdf->MultiCell($w, 4, $outputlangs->transnoentities("RefSending")." : ".$object->ref, '', 'R'); + // Date planned delivery if (!empty($object->date_delivery)) { $posy += 4; diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 1b2b35e8562..aa6603fa35a 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -953,13 +953,15 @@ class pdf_rouget extends ModelePdfExpedition $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); $title = $outputlangs->transnoentities("SendingSheet"); - - $title .= " " . $outputlangs->convToOutputCharset($object->ref); - $pdf->MultiCell($w, 4, $title, '', 'R'); $pdf->SetFont('', '', $default_font_size + 1); - $posy += 1; + + $posy += 5; + + $pdf->SetXY($posx, $posy); + $pdf->SetTextColor(0, 0, 60); + $pdf->MultiCell($w, 4, $outputlangs->transnoentities("RefSending")." : ".$object->ref, '', 'R'); // Date planned delivery if (!empty($object->date_delivery)) { diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index cdcd681eaa6..6ad123f3461 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -986,8 +986,6 @@ class pdf_crabe extends ModelePDFFactures $title = $outputlangs->transnoentities("PaymentsBackAlreadyDone"); } - $title .= " " . $outputlangs->convToOutputCharset($object->ref); - $pdf->SetFont('', '', $default_font_size - 3); $pdf->SetXY($tab3_posx, $tab3_top - 4); $pdf->MultiCell(60, 3, $title, 0, 'L', 0); diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index d4098d1db38..42a8830e3fc 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -987,8 +987,6 @@ class pdf_sponge extends ModelePDFFactures $title = $outputlangs->transnoentities("PaymentsBackAlreadyDone"); } - $title .= " " . $outputlangs->convToOutputCharset($object->ref); - $pdf->SetFont('', '', $default_font_size - 3); $pdf->SetXY($tab3_posx, $tab3_top - 4); $pdf->MultiCell(60, 3, $title, 0, 'L', 0); diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index 8710c67dda1..37d64c43e17 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -596,15 +596,19 @@ class pdf_soleil extends ModelePDFFicheinter $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); $title = $outputlangs->transnoentities("InterventionCard"); - - $title .= " " . $outputlangs->convToOutputCharset($object->ref); - $pdf->MultiCell(100, 4, $title, '', 'R'); - $posy += 5; + $pdf->SetFont('', 'B', $default_font_size + 2); + $posy += 5; + $pdf->SetXY($posx, $posy); + $pdf->SetTextColor(0, 0, 60); + $pdf->MultiCell(100, 4, $outputlangs->transnoentities("Ref")." : ".$outputlangs->convToOutputCharset($object->ref), '', 'R'); + + $posy += 1; $pdf->SetFont('', '', $default_font_size); + $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("Date")." : ".dol_print_date($object->datec, "day", false, $outputlangs, true), '', 'R'); diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 9ea3e34511c..2045683661b 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1473,12 +1473,17 @@ class pdf_azur extends ModelePDFPropales $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); $title = $outputlangs->transnoentities("PdfCommercialProposalTitle"); - $title .= " " . $outputlangs->convToOutputCharset($object->ref); - $pdf->MultiCell(100, 4, $title, '', 'R'); - $pdf->SetFont('', '', $default_font_size - 2); + $pdf->SetFont('', 'B', $default_font_size); + + $posy += 5; + $pdf->SetXY($posx, $posy); + $pdf->SetTextColor(0, 0, 60); + $pdf->MultiCell(100, 4, $outputlangs->transnoentities("Ref")." : ".$outputlangs->convToOutputCharset($object->ref), '', 'R'); + $posy += 1; + $pdf->SetFont('', '', $default_font_size - 2); if ($object->ref_client) { $posy += 4; diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 703ebaa62f0..7d8ada03ad5 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -1574,15 +1574,25 @@ class pdf_cyan extends ModelePDFPropales $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); $title = $outputlangs->transnoentities("PdfCommercialProposalTitle"); - $title .= " " . $outputlangs->convToOutputCharset($object->ref); - $pdf->MultiCell($w, 4, $title, '', 'R'); + $pdf->SetFont('', 'B', $default_font_size); + + $posy += 5; + $pdf->SetXY($posx, $posy); + $pdf->SetTextColor(0, 0, 60); + $textref = $outputlangs->transnoentities("Ref")." : ".$outputlangs->convToOutputCharset($object->ref); + if ($object->statut == $object::STATUS_DRAFT) { + $pdf->SetTextColor(128, 0, 0); + $textref .= ' - '.$outputlangs->transnoentities("NotValidated"); + } + $pdf->MultiCell($w, 4, $textref, '', 'R'); + + $posy += 1; $pdf->SetFont('', '', $default_font_size - 2); - $posy += 2; if ($object->ref_client) { - $posy += 3; + $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell($w, 3, $outputlangs->transnoentities("RefCustomer")." : ".$outputlangs->convToOutputCharset($object->ref_client), '', 'R');