From 0bead55836f87ea1a22724c96c3b9765a3cd9cb7 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Mon, 9 Aug 2021 18:11:36 +0200 Subject: [PATCH 01/11] ok --- htdocs/admin/pdf_other.php | 9 +++++++++ htdocs/core/modules/propale/doc/pdf_azur.modules.php | 2 +- htdocs/langs/en_US/admin.lang | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/pdf_other.php b/htdocs/admin/pdf_other.php index ed14f2ac119..2866240e87d 100644 --- a/htdocs/admin/pdf_other.php +++ b/htdocs/admin/pdf_other.php @@ -103,6 +103,15 @@ if ($conf->use_javascript_ajax) { } print ''; +print ''.$langs->trans("PDF_NO_CODE_CLIENT"); +print ''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('PDF_NO_CODE_CLIENT'); +} else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("PDF_NO_CODE_CLIENT", $arrval, $conf->global->PDF_NO_CODE_CLIENT); +} +print ''; /* print ''.$langs->trans("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING").''; if ($conf->use_javascript_ajax) { diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index b56fbc758db..e1455da3b20 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1523,7 +1523,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateEndPropal")." : ".dol_print_date($object->fin_validite, "day", false, $outputlangs, true), '', 'R'); - if ($object->thirdparty->code_client) { + if ($object->thirdparty->code_client && empty($conf->global->PDF_NO_CODE_CLIENT)) { $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 98c9e954ac2..674a2926023 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1992,6 +1992,7 @@ MAIN_PDF_MARGIN_TOP=Top margin on PDF MAIN_PDF_MARGIN_BOTTOM=Bottom margin on PDF MAIN_DOCUMENTS_LOGO_HEIGHT=Height for logo on PDF MAIN_GENERATE_PROPOSALS_WITH_PICTURE=Add picture on proposal line +PDF_NO_CODE_CLIENT=Do not display customer code MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING=Add electronic sign in PDF NothingToSetup=There is no specific setup required for this module. SetToYesIfGroupIsComputationOfOtherGroups=Set this to yes if this group is a computation of other groups From 284b40f15202110f891ea655aac0794dc30b1d12 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Tue, 10 Aug 2021 09:38:07 +0200 Subject: [PATCH 02/11] CONST --- htdocs/admin/pdf.php | 10 ++++++++++ htdocs/admin/pdf_other.php | 9 --------- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 2 +- htdocs/langs/en_US/admin.lang | 2 +- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index cee63fd91fd..56d22553d89 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -371,6 +371,16 @@ print $formadmin->select_language($selected, 'PDF_USE_ALSO_LANGUAGE_CODE', 0, nu //} print ''; +print ''.$langs->trans("MAIN_PDF_NO_CODE_CLIENT"); +print ''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_PDF_NO_CODE_CLIENT'); +} else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("MAIN_PDF_NO_CODE_CLIENT", $arrval, $conf->global->MAIN_PDF_NO_CODE_CLIENT); +} +print ''; + // Ref print ''.$langs->trans("HideRefOnPDF").''; diff --git a/htdocs/admin/pdf_other.php b/htdocs/admin/pdf_other.php index 2866240e87d..ed14f2ac119 100644 --- a/htdocs/admin/pdf_other.php +++ b/htdocs/admin/pdf_other.php @@ -103,15 +103,6 @@ if ($conf->use_javascript_ajax) { } print ''; -print ''.$langs->trans("PDF_NO_CODE_CLIENT"); -print ''; -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('PDF_NO_CODE_CLIENT'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("PDF_NO_CODE_CLIENT", $arrval, $conf->global->PDF_NO_CODE_CLIENT); -} -print ''; /* print ''.$langs->trans("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING").''; if ($conf->use_javascript_ajax) { diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index e1455da3b20..2cffa9d25da 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1523,7 +1523,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateEndPropal")." : ".dol_print_date($object->fin_validite, "day", false, $outputlangs, true), '', 'R'); - if ($object->thirdparty->code_client && empty($conf->global->PDF_NO_CODE_CLIENT)) { + if ($object->thirdparty->code_client && empty($conf->global->MAIN_PDF_NO_CODE_CLIENT)) { $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 674a2926023..acb4bf6c409 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1992,7 +1992,7 @@ MAIN_PDF_MARGIN_TOP=Top margin on PDF MAIN_PDF_MARGIN_BOTTOM=Bottom margin on PDF MAIN_DOCUMENTS_LOGO_HEIGHT=Height for logo on PDF MAIN_GENERATE_PROPOSALS_WITH_PICTURE=Add picture on proposal line -PDF_NO_CODE_CLIENT=Do not display customer code +MAIN_PDF_NO_CODE_CLIENT=Do not display customer code MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING=Add electronic sign in PDF NothingToSetup=There is no specific setup required for this module. SetToYesIfGroupIsComputationOfOtherGroups=Set this to yes if this group is a computation of other groups From f8df84544293e9ee874c906c3029ce7b8ea28cc7 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Tue, 10 Aug 2021 09:45:15 +0200 Subject: [PATCH 03/11] Const and Com --- htdocs/admin/pdf.php | 8 +++++--- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 2 +- htdocs/langs/en_US/admin.lang | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 56d22553d89..69fcbebb671 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -371,13 +371,15 @@ print $formadmin->select_language($selected, 'PDF_USE_ALSO_LANGUAGE_CODE', 0, nu //} print ''; -print ''.$langs->trans("MAIN_PDF_NO_CODE_CLIENT"); +// + +print ''.$langs->trans("MAIN_PDF_NO_CUSTOMER_CODE"); print ''; if ($conf->use_javascript_ajax) { - print ajax_constantonoff('MAIN_PDF_NO_CODE_CLIENT'); + print ajax_constantonoff('MAIN_PDF_NO_CUSTOMER_CODE'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("MAIN_PDF_NO_CODE_CLIENT", $arrval, $conf->global->MAIN_PDF_NO_CODE_CLIENT); + print $form->selectarray("MAIN_PDF_NO_CUSTOMER_CODE", $arrval, $conf->global->MAIN_PDF_NO_CUSTOMER_CODE); } print ''; diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 2cffa9d25da..e521e01765f 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1523,7 +1523,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateEndPropal")." : ".dol_print_date($object->fin_validite, "day", false, $outputlangs, true), '', 'R'); - if ($object->thirdparty->code_client && empty($conf->global->MAIN_PDF_NO_CODE_CLIENT)) { + if ($object->thirdparty->code_client && empty($conf->global->MAIN_PDF_NO_CUSTOMER_CODE)) { $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index acb4bf6c409..6458091faf2 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1992,7 +1992,7 @@ MAIN_PDF_MARGIN_TOP=Top margin on PDF MAIN_PDF_MARGIN_BOTTOM=Bottom margin on PDF MAIN_DOCUMENTS_LOGO_HEIGHT=Height for logo on PDF MAIN_GENERATE_PROPOSALS_WITH_PICTURE=Add picture on proposal line -MAIN_PDF_NO_CODE_CLIENT=Do not display customer code +MAIN_PDF_NO_CUSTOMER_CODE=Do not display customer code MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING=Add electronic sign in PDF NothingToSetup=There is no specific setup required for this module. SetToYesIfGroupIsComputationOfOtherGroups=Set this to yes if this group is a computation of other groups From fcd174f3ada66a2328ee04e8c7fc56dd09ce3ebe Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 10 Aug 2021 07:45:47 +0000 Subject: [PATCH 04/11] Fixing style errors. --- htdocs/admin/pdf.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 69fcbebb671..3c6e32b0cb4 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -371,7 +371,7 @@ print $formadmin->select_language($selected, 'PDF_USE_ALSO_LANGUAGE_CODE', 0, nu //} print ''; -// +// print ''.$langs->trans("MAIN_PDF_NO_CUSTOMER_CODE"); print ''; From 21d6b9834a94ed6d3e741add16b7a1b5eda3ac28 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Tue, 10 Aug 2021 13:31:25 +0200 Subject: [PATCH 05/11] yes/no save --- htdocs/admin/pdf.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 3c6e32b0cb4..8d26d30131e 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -89,6 +89,8 @@ 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); + if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS", GETPOST("MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS"), 'chaine', 0, '', $conf->entity); if (GETPOSTISSET('MAIN_PDF_MAIN_HIDE_SECOND_TAX')) dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_SECOND_TAX", GETPOST("MAIN_PDF_MAIN_HIDE_SECOND_TAX"), 'chaine', 0, '', $conf->entity); From be016197b40d7193515d2b6110f0f0e879d9175a Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Tue, 10 Aug 2021 18:07:11 +0200 Subject: [PATCH 06/11] Trans --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 6458091faf2..ba027a3696b 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1992,7 +1992,7 @@ MAIN_PDF_MARGIN_TOP=Top margin on PDF MAIN_PDF_MARGIN_BOTTOM=Bottom margin on PDF MAIN_DOCUMENTS_LOGO_HEIGHT=Height for logo on PDF MAIN_GENERATE_PROPOSALS_WITH_PICTURE=Add picture on proposal line -MAIN_PDF_NO_CUSTOMER_CODE=Do not display customer code +MAIN_PDF_NO_CUSTOMER_CODE=Hide customer code MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING=Add electronic sign in PDF NothingToSetup=There is no specific setup required for this module. SetToYesIfGroupIsComputationOfOtherGroups=Set this to yes if this group is a computation of other groups From b45a57060f5175a20226e0b1808164b5d9081dc4 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Wed, 11 Aug 2021 12:36:16 +0200 Subject: [PATCH 07/11] const_and_other_doc --- htdocs/admin/pdf.php | 6 +++--- htdocs/core/modules/contract/doc/pdf_strato.modules.php | 2 +- htdocs/core/modules/expedition/doc/pdf_rouget.modules.php | 2 +- htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php | 2 +- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 2 +- htdocs/langs/en_US/admin.lang | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 8d26d30131e..8db10aa3034 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -375,13 +375,13 @@ print ''; // -print ''.$langs->trans("MAIN_PDF_NO_CUSTOMER_CODE"); +print ''.$langs->trans("DOC_SHOW_CUSTOMER_CODE"); print ''; if ($conf->use_javascript_ajax) { - print ajax_constantonoff('MAIN_PDF_NO_CUSTOMER_CODE'); + print ajax_constantonoff('DOC_SHOW_CUSTOMER_CODE'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("MAIN_PDF_NO_CUSTOMER_CODE", $arrval, $conf->global->MAIN_PDF_NO_CUSTOMER_CODE); + print $form->selectarray("DOC_SHOW_CUSTOMER_CODE", $arrval, $conf->global->DOC_SHOW_CUSTOMER_CODE); } print ''; diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index c440cbf1cba..c86567db370 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -657,7 +657,7 @@ class pdf_strato extends ModelePDFContract $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("Date")." : ".dol_print_date($object->date_contrat, "day", false, $outputlangs, true), '', 'R'); - if ($object->thirdparty->code_client) { + if (!empty($conf->global->DOC_SHOW_CUSTOMER_CODE) && $object->thirdparty->code_client) { $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 79ceb166eed..621b20e624f 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -971,7 +971,7 @@ class pdf_rouget extends ModelePdfExpedition $pdf->MultiCell($w, 4, $outputlangs->transnoentities("DateDeliveryPlanned")." : ".dol_print_date($object->date_delivery, "day", false, $outputlangs, true), '', 'R'); } - if (!empty($object->thirdparty->code_client)) { + if (!empty($conf->global->DOC_SHOW_CUSTOMER_CODE) && !empty($object->thirdparty->code_client)) { $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index 08d57587625..57aec4907a8 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -613,7 +613,7 @@ class pdf_soleil extends ModelePDFFicheinter $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("Date")." : ".dol_print_date($object->datec, "day", false, $outputlangs, true), '', 'R'); - if ($object->thirdparty->code_client) { + if (!empty($conf->global->DOC_SHOW_CUSTOMER_CODE) && $object->thirdparty->code_client) { $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index e521e01765f..cdc1e660dca 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1523,7 +1523,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateEndPropal")." : ".dol_print_date($object->fin_validite, "day", false, $outputlangs, true), '', 'R'); - if ($object->thirdparty->code_client && empty($conf->global->MAIN_PDF_NO_CUSTOMER_CODE)) { + if (!empty($conf->global->DOC_SHOW_CUSTOMER_CODE) && $object->thirdparty->code_client)) { $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index ba027a3696b..ed71e52c146 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1992,7 +1992,7 @@ MAIN_PDF_MARGIN_TOP=Top margin on PDF MAIN_PDF_MARGIN_BOTTOM=Bottom margin on PDF MAIN_DOCUMENTS_LOGO_HEIGHT=Height for logo on PDF MAIN_GENERATE_PROPOSALS_WITH_PICTURE=Add picture on proposal line -MAIN_PDF_NO_CUSTOMER_CODE=Hide customer code +DOC_SHOW_CUSTOMER_CODE=Show customer code MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING=Add electronic sign in PDF NothingToSetup=There is no specific setup required for this module. SetToYesIfGroupIsComputationOfOtherGroups=Set this to yes if this group is a computation of other groups From b7441aaf4564fb2b38384de2f9e14076926e2662 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 11 Aug 2021 10:37:06 +0000 Subject: [PATCH 08/11] Fixing style errors. --- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index cdc1e660dca..d98b1695c9f 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1523,7 +1523,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateEndPropal")." : ".dol_print_date($object->fin_validite, "day", false, $outputlangs, true), '', 'R'); - if (!empty($conf->global->DOC_SHOW_CUSTOMER_CODE) && $object->thirdparty->code_client)) { + if (!empty($conf->global->DOC_SHOW_CUSTOMER_CODE) && $object->thirdparty->code_client) {) $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); From c5e8302ba2213604b919169a03ddbcd06f1bfaba Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Wed, 11 Aug 2021 16:18:16 +0200 Subject: [PATCH 09/11] Const --- htdocs/admin/pdf.php | 2 +- htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 2 +- htdocs/core/modules/contract/doc/pdf_strato.modules.php | 2 +- htdocs/core/modules/expedition/doc/pdf_rouget.modules.php | 2 +- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 2 +- htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php | 2 +- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 2 +- htdocs/langs/en_US/admin.lang | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 8db10aa3034..a92b4011b83 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -375,7 +375,7 @@ print ''; // -print ''.$langs->trans("DOC_SHOW_CUSTOMER_CODE"); +print ''.$langs->trans("MAIN_PDF_HIDE_CUSTOMER_CODE"); print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('DOC_SHOW_CUSTOMER_CODE'); diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index bd6caafd15a..7acf7007e60 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -1356,7 +1356,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell($w, 3, $outputlangs->transnoentities("OrderDate")." : ".dol_print_date($object->date, "day", false, $outputlangs, true), '', 'R'); - if (!empty($conf->global->DOC_SHOW_CUSTOMER_CODE) && !empty($object->thirdparty->code_client)) { + if (!empty($conf->global->MAIN_PDF_HIDE_CUSTOMER_CODE) && !empty($object->thirdparty->code_client)) { $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index c86567db370..a8462a08e19 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -657,7 +657,7 @@ class pdf_strato extends ModelePDFContract $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->DOC_SHOW_CUSTOMER_CODE) && $object->thirdparty->code_client) { + if (!empty($conf->global->MAIN_PDF_HIDE_CUSTOMER_CODE) && $object->thirdparty->code_client) { $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 621b20e624f..90d1119b33c 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -971,7 +971,7 @@ class pdf_rouget extends ModelePdfExpedition $pdf->MultiCell($w, 4, $outputlangs->transnoentities("DateDeliveryPlanned")." : ".dol_print_date($object->date_delivery, "day", false, $outputlangs, true), '', 'R'); } - if (!empty($conf->global->DOC_SHOW_CUSTOMER_CODE) && !empty($object->thirdparty->code_client)) { + if (!empty($conf->global->MAIN_PDF_HIDE_CUSTOMER_CODE) && !empty($object->thirdparty->code_client)) { $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index a01fab1dacf..27cbbd8f802 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1803,7 +1803,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->MultiCell($w, 3, $title." : ".dol_print_date($object->date_lim_reglement, "day", false, $outputlangs, true), '', 'R'); } - if ($object->thirdparty->code_client) { + if (!empty($conf->global->MAIN_PDF_HIDE_CUSTOMER_CODE) && $object->thirdparty->code_client) { $posy += 3; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index 57aec4907a8..a88b0a44bf7 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -613,7 +613,7 @@ class pdf_soleil extends ModelePDFFicheinter $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("Date")." : ".dol_print_date($object->datec, "day", false, $outputlangs, true), '', 'R'); - if (!empty($conf->global->DOC_SHOW_CUSTOMER_CODE) && $object->thirdparty->code_client) { + if (!empty($conf->global->MAIN_PDF_HIDE_CUSTOMER_CODE) && $object->thirdparty->code_client) { $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index d98b1695c9f..1837589e504 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1523,7 +1523,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetTextColor(0, 0, 60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateEndPropal")." : ".dol_print_date($object->fin_validite, "day", false, $outputlangs, true), '', 'R'); - if (!empty($conf->global->DOC_SHOW_CUSTOMER_CODE) && $object->thirdparty->code_client) {) + if (!empty($conf->global->MAIN_PDF_HIDE_CUSTOMER_CODE) && $object->thirdparty->code_client) {) $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index ed71e52c146..4d474e61a2a 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1992,7 +1992,7 @@ MAIN_PDF_MARGIN_TOP=Top margin on PDF MAIN_PDF_MARGIN_BOTTOM=Bottom margin on PDF MAIN_DOCUMENTS_LOGO_HEIGHT=Height for logo on PDF MAIN_GENERATE_PROPOSALS_WITH_PICTURE=Add picture on proposal line -DOC_SHOW_CUSTOMER_CODE=Show customer code +MAIN_PDF_HIDE_CUSTOMER_CODE=Hide customer code MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING=Add electronic sign in PDF NothingToSetup=There is no specific setup required for this module. SetToYesIfGroupIsComputationOfOtherGroups=Set this to yes if this group is a computation of other groups From a8562704cf2a2146293f978622ad87268fa496b3 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Wed, 11 Aug 2021 18:16:53 +0200 Subject: [PATCH 10/11] add_doc --- htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php | 2 +- htdocs/core/modules/expedition/doc/pdf_espadon.modules.php | 2 +- htdocs/core/modules/facture/doc/pdf_sponge.modules.php | 2 +- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 83ccd391bd9..88e64483300 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -1538,7 +1538,7 @@ class pdf_eratosthene extends ModelePDFCommandes } $pdf->MultiCell($w, 3, $title." : ".dol_print_date($object->date, "day", false, $outputlangs, true), '', 'R'); - if (!empty($conf->global->DOC_SHOW_CUSTOMER_CODE) && !empty($object->thirdparty->code_client)) { + if (!empty($conf->global->MAIN_PDF_HIDE_CUSTOMER_CODE) && !empty($object->thirdparty->code_client)) { $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index f6f4b0b1a2a..05fbfbbc2a6 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -1021,7 +1021,7 @@ class pdf_espadon extends ModelePdfExpedition $pdf->MultiCell($w, 4, $outputlangs->transnoentities("DateDeliveryPlanned")." : ".dol_print_date($object->date_delivery, "day", false, $outputlangs, true), '', 'R'); } - if (!empty($object->thirdparty->code_client)) { + if (!empty($conf->global->MAIN_PDF_HIDE_CUSTOMER_CODE) && !empty($object->thirdparty->code_client)) { $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 401309c22e5..73ffab18441 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -2041,7 +2041,7 @@ class pdf_sponge extends ModelePDFFactures $pdf->MultiCell($w, 3, $title." : ".dol_print_date($object->date_lim_reglement, "day", false, $outputlangs, true), '', 'R'); } - if ($object->thirdparty->code_client) { + if (!empty($conf->global->MAIN_PDF_HIDE_CUSTOMER_CODE) && $object->thirdparty->code_client) { $posy += 3; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index f75f5ecab56..5490da11b02 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -1634,7 +1634,7 @@ class pdf_cyan extends ModelePDFPropales } $pdf->MultiCell($w, 3, $title." : ".dol_print_date($object->fin_validite, "day", false, $outputlangs, true), '', 'R'); - if ($object->thirdparty->code_client) { + if (!empty($conf->global->MAIN_PDF_HIDE_CUSTOMER_CODE) && $object->thirdparty->code_client) { $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); From d4c35edef4db6ca318757b4b100b941570c7b29a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Aug 2021 16:55:56 +0200 Subject: [PATCH 11/11] Update pdf.php --- htdocs/admin/pdf.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 0d17d534981..2ff2a4c0ede 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -389,10 +389,10 @@ print ''; print ''.$langs->trans("MAIN_PDF_HIDE_CUSTOMER_CODE"); print ''; if ($conf->use_javascript_ajax) { - print ajax_constantonoff('DOC_SHOW_CUSTOMER_CODE'); + print ajax_constantonoff('MAIN_PDF_HIDE_CUSTOMER_CODE'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("DOC_SHOW_CUSTOMER_CODE", $arrval, $conf->global->DOC_SHOW_CUSTOMER_CODE); + print $form->selectarray("MAIN_PDF_HIDE_CUSTOMER_CODE", $arrval, $conf->global->MAIN_PDF_HIDE_CUSTOMER_CODE); } print '';