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/26] 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/26] 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/26] 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/26] 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 6a41edd3c2b1a4f101d35460b6decfb34204971d Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Tue, 10 Aug 2021 13:02:37 +0200 Subject: [PATCH 05/26] ok --- htdocs/admin/pdf.php | 9 +++++++++ htdocs/core/modules/propale/doc/pdf_azur.modules.php | 10 ++++++---- htdocs/langs/en_US/admin.lang | 1 + 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index cee63fd91fd..83225de223d 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -253,6 +253,15 @@ for ($i = 1; $i <= 6; $i++) { } } +// Show sender name + +print ''.$langs->trans("MAIN_PDF_NO_SENDER_NAME").''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_PDF_NO_SENDER_NAME'); +} else { + print $form->selectyesno('MAIN_PDF_NO_SENDER_NAME', (!empty($conf->global->MAIN_PDF_NO_SENDER_NAME)) ? $conf->global->MAIN_PDF_NO_SENDER_NAME : 0, 1); +} +print ''; print ''; print ''; diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index b56fbc758db..ef8a2fe088c 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1585,10 +1585,12 @@ class pdf_azur extends ModelePDFPropales $pdf->SetTextColor(0, 0, 60); // Show sender name - $pdf->SetXY($posx + 2, $posy + 3); - $pdf->SetFont('', 'B', $default_font_size); - $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, $ltrdirection); - $posy = $pdf->getY(); + if(empty($conf->global->MAIN_PDF_NO_SENDER_NAME)){ + $pdf->SetXY($posx + 2, $posy + 3); + $pdf->SetFont('', 'B', $default_font_size); + $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, $ltrdirection); + $posy = $pdf->getY(); + } // Show sender information $pdf->SetXY($posx + 2, $posy); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 98c9e954ac2..36d52f40af1 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 +MAIN_PDF_NO_SENDER_NAME=Not show sender name in address 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 a5accb8c3c980c482644ed49c40bbc6933197732 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Tue, 10 Aug 2021 13:18:07 +0200 Subject: [PATCH 06/26] yes/no --- htdocs/admin/pdf.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 83225de223d..4d73a889544 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -65,6 +65,8 @@ if ($action == 'update') { if (GETPOSTISSET('MAIN_PROFID5_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID5_IN_ADDRESS", GETPOST("MAIN_PROFID5_IN_ADDRESS"), 'chaine', 0, '', $conf->entity); if (GETPOSTISSET('MAIN_PROFID6_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID6_IN_ADDRESS", GETPOST("MAIN_PROFID6_IN_ADDRESS"), 'chaine', 0, '', $conf->entity); + if (GETPOSTISSET('MAIN_PDF_NO_SENDER_NAME')) dolibarr_set_const($db, "MAIN_PDF_NO_SENDER_NAME", GETPOST("MAIN_PDF_NO_SENDER_NAME"), 'chaine', 0, '', $conf->entity); + if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT')) dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT", GETPOST("MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT"), 'chaine', 0, '', $conf->entity); if (GETPOSTISSET('MAIN_TVAINTRA_NOT_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_TVAINTRA_NOT_IN_ADDRESS", GETPOST("MAIN_TVAINTRA_NOT_IN_ADDRESS"), 'chaine', 0, '', $conf->entity); 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 07/26] 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 1d9d90036df4ec9b73878cad0f1a8d99dc7fc153 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 10 Aug 2021 15:14:41 +0000 Subject: [PATCH 08/26] 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 ef8a2fe088c..c943e6fa9e3 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1585,7 +1585,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetTextColor(0, 0, 60); // Show sender name - if(empty($conf->global->MAIN_PDF_NO_SENDER_NAME)){ + if (empty($conf->global->MAIN_PDF_NO_SENDER_NAME)) { $pdf->SetXY($posx + 2, $posy + 3); $pdf->SetFont('', 'B', $default_font_size); $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, $ltrdirection); From 2cb7e828a35af998f50268010be1b204a9a77984 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Tue, 10 Aug 2021 18:05:58 +0200 Subject: [PATCH 09/26] 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 36d52f40af1..21f56208bae 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_SENDER_NAME=Not show sender name in address +MAIN_PDF_NO_SENDER_NAME=Hide sender name in address 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 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 10/26] 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 816648f283a74a666112ce36e9565fbb2f772cd2 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Wed, 11 Aug 2021 12:28:44 +0200 Subject: [PATCH 11/26] other_docs --- .../modules/commande/doc/pdf_einstein.modules.php | 10 ++++++---- .../core/modules/contract/doc/pdf_strato.modules.php | 12 +++++++----- .../modules/expedition/doc/pdf_rouget.modules.php | 10 ++++++---- .../modules/fichinter/doc/pdf_soleil.modules.php | 12 +++++++----- 4 files changed, 26 insertions(+), 18 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index bd6caafd15a..f2b0c19c9ce 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -1418,10 +1418,12 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetTextColor(0, 0, 60); // Show sender name - $pdf->SetXY($posx + 2, $posy + 3); - $pdf->SetFont('', 'B', $default_font_size); - $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, $ltrdirection); - $posy = $pdf->getY(); + if (empty($conf->global->MAIN_PDF_NO_SENDER_NAME)) { + $pdf->SetXY($posx + 2, $posy + 3); + $pdf->SetFont('', 'B', $default_font_size); + $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, $ltrdirection); + $posy = $pdf->getY(); + } // Show sender information $pdf->SetXY($posx + 2, $posy); diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index c440cbf1cba..ab5c566058a 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -693,11 +693,13 @@ class pdf_strato extends ModelePDFContract $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1); // Show sender name - $pdf->SetXY($posx + 2, $posy + 3); - $pdf->SetTextColor(0, 0, 60); - $pdf->SetFont('', 'B', $default_font_size); - $pdf->MultiCell(80, 3, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); - $posy = $pdf->getY(); + if (empty($conf->global->MAIN_PDF_NO_SENDER_NAME)) { + $pdf->SetXY($posx + 2, $posy + 3); + $pdf->SetTextColor(0, 0, 60); + $pdf->SetFont('', 'B', $default_font_size); + $pdf->MultiCell(80, 3, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); + $posy = $pdf->getY(); + } // Show sender information $pdf->SetFont('', '', $default_font_size - 1); diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 79ceb166eed..c1131f0a3af 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -1047,10 +1047,12 @@ class pdf_rouget extends ModelePdfExpedition $pdf->SetFillColor(255, 255, 255); // Show sender name - $pdf->SetXY($posx + 2, $posy + 3); - $pdf->SetFont('', 'B', $default_font_size); - $pdf->MultiCell($widthrecbox - 2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); - $posy = $pdf->getY(); + if (empty($conf->global->MAIN_PDF_NO_SENDER_NAME)) { + $pdf->SetXY($posx + 2, $posy + 3); + $pdf->SetFont('', 'B', $default_font_size); + $pdf->MultiCell($widthrecbox - 2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); + $posy = $pdf->getY(); + } // Show sender information $pdf->SetXY($posx + 2, $posy); diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index 08d57587625..1b1ca0d33e2 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -649,11 +649,13 @@ class pdf_soleil extends ModelePDFFicheinter $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1); // Show sender name - $pdf->SetXY($posx + 2, $posy + 3); - $pdf->SetTextColor(0, 0, 60); - $pdf->SetFont('', 'B', $default_font_size); - $pdf->MultiCell(80, 3, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); - $posy = $pdf->getY(); + if (empty($conf->global->MAIN_PDF_NO_SENDER_NAME)) { + $pdf->SetXY($posx + 2, $posy + 3); + $pdf->SetTextColor(0, 0, 60); + $pdf->SetFont('', 'B', $default_font_size); + $pdf->MultiCell(80, 3, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); + $posy = $pdf->getY(); + } // Show sender information $pdf->SetFont('', '', $default_font_size - 1); 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 12/26] 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 13/26] 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 14/26] 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 15/26] 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 956bd00c13f0706ab9b0abde9e9fee9f2528f351 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Wed, 11 Aug 2021 18:37:13 +0200 Subject: [PATCH 16/26] CHANGE_CONST_ADD_DOC --- htdocs/admin/pdf.php | 8 ++++---- .../core/modules/commande/doc/pdf_einstein.modules.php | 2 +- .../modules/commande/doc/pdf_eratosthene.modules.php | 10 ++++++---- .../core/modules/contract/doc/pdf_strato.modules.php | 2 +- .../modules/expedition/doc/pdf_espadon.modules.php | 10 ++++++---- .../core/modules/expedition/doc/pdf_rouget.modules.php | 2 +- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 10 ++++++---- htdocs/core/modules/facture/doc/pdf_sponge.modules.php | 10 ++++++---- .../core/modules/fichinter/doc/pdf_soleil.modules.php | 2 +- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 2 +- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 10 ++++++---- htdocs/langs/en_US/admin.lang | 2 +- 12 files changed, 40 insertions(+), 30 deletions(-) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 4d73a889544..4a68fe12e6b 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -65,7 +65,7 @@ if ($action == 'update') { if (GETPOSTISSET('MAIN_PROFID5_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID5_IN_ADDRESS", GETPOST("MAIN_PROFID5_IN_ADDRESS"), 'chaine', 0, '', $conf->entity); if (GETPOSTISSET('MAIN_PROFID6_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID6_IN_ADDRESS", GETPOST("MAIN_PROFID6_IN_ADDRESS"), 'chaine', 0, '', $conf->entity); - if (GETPOSTISSET('MAIN_PDF_NO_SENDER_NAME')) dolibarr_set_const($db, "MAIN_PDF_NO_SENDER_NAME", GETPOST("MAIN_PDF_NO_SENDER_NAME"), 'chaine', 0, '', $conf->entity); + if (GETPOSTISSET('MAIN_PDF_HIDE_SENDER_NAME')) dolibarr_set_const($db, "MAIN_PDF_HIDE_SENDER_NAME", GETPOST("MAIN_PDF_HIDE_SENDER_NAME"), 'chaine', 0, '', $conf->entity); if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT')) dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT", GETPOST("MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT"), 'chaine', 0, '', $conf->entity); @@ -257,11 +257,11 @@ for ($i = 1; $i <= 6; $i++) { // Show sender name -print ''.$langs->trans("MAIN_PDF_NO_SENDER_NAME").''; +print ''.$langs->trans("MAIN_PDF_HIDE_SENDER_NAME").''; if ($conf->use_javascript_ajax) { - print ajax_constantonoff('MAIN_PDF_NO_SENDER_NAME'); + print ajax_constantonoff('MAIN_PDF_HIDE_SENDER_NAME'); } else { - print $form->selectyesno('MAIN_PDF_NO_SENDER_NAME', (!empty($conf->global->MAIN_PDF_NO_SENDER_NAME)) ? $conf->global->MAIN_PDF_NO_SENDER_NAME : 0, 1); + print $form->selectyesno('MAIN_PDF_HIDE_SENDER_NAME', (!empty($conf->global->MAIN_PDF_HIDE_SENDER_NAME)) ? $conf->global->MAIN_PDF_HIDE_SENDER_NAME : 0, 1); } print ''; print ''; diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index f2b0c19c9ce..315c7d1d32e 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -1418,7 +1418,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetTextColor(0, 0, 60); // Show sender name - if (empty($conf->global->MAIN_PDF_NO_SENDER_NAME)) { + if (empty($conf->global->MAIN_PDF_HIDE_SENDER_NAME)) { $pdf->SetXY($posx + 2, $posy + 3); $pdf->SetFont('', 'B', $default_font_size); $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, $ltrdirection); diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 83ccd391bd9..264777a57a5 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -1604,10 +1604,12 @@ class pdf_eratosthene extends ModelePDFCommandes $pdf->SetTextColor(0, 0, 60); // Show sender name - $pdf->SetXY($posx + 2, $posy + 3); - $pdf->SetFont('', 'B', $default_font_size); - $pdf->MultiCell($widthrecbox - 2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, $ltrdirection); - $posy = $pdf->getY(); + if (empty($conf->global->MAIN_PDF_HIDE_SENDER_NAME)) { + $pdf->SetXY($posx + 2, $posy + 3); + $pdf->SetFont('', 'B', $default_font_size); + $pdf->MultiCell($widthrecbox - 2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, $ltrdirection); + $posy = $pdf->getY(); + } // Show sender information $pdf->SetXY($posx + 2, $posy); diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index ab5c566058a..fe634ecd50e 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -693,7 +693,7 @@ class pdf_strato extends ModelePDFContract $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1); // Show sender name - if (empty($conf->global->MAIN_PDF_NO_SENDER_NAME)) { + if (empty($conf->global->MAIN_PDF_HIDE_SENDER_NAME)) { $pdf->SetXY($posx + 2, $posy + 3); $pdf->SetTextColor(0, 0, 60); $pdf->SetFont('', 'B', $default_font_size); diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index f6f4b0b1a2a..fdc9dd52ab8 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -1097,10 +1097,12 @@ class pdf_espadon extends ModelePdfExpedition $pdf->SetFillColor(255, 255, 255); // Show sender name - $pdf->SetXY($posx + 2, $posy + 3); - $pdf->SetFont('', 'B', $default_font_size); - $pdf->MultiCell($widthrecbox - 2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); - $posy = $pdf->getY(); + if (empty($conf->global->MAIN_PDF_HIDE_SENDER_NAME)) { + $pdf->SetXY($posx + 2, $posy + 3); + $pdf->SetFont('', 'B', $default_font_size); + $pdf->MultiCell($widthrecbox - 2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); + $posy = $pdf->getY(); + } // Show sender information $pdf->SetXY($posx + 2, $posy); diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index c1131f0a3af..bb9022f8efd 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -1047,7 +1047,7 @@ class pdf_rouget extends ModelePdfExpedition $pdf->SetFillColor(255, 255, 255); // Show sender name - if (empty($conf->global->MAIN_PDF_NO_SENDER_NAME)) { + if (empty($conf->global->MAIN_PDF_HIDE_SENDER_NAME)) { $pdf->SetXY($posx + 2, $posy + 3); $pdf->SetFont('', 'B', $default_font_size); $pdf->MultiCell($widthrecbox - 2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index a01fab1dacf..f5500aa35cd 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1860,10 +1860,12 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetTextColor(0, 0, 60); // Show sender name - $pdf->SetXY($posx + 2, $posy + 3); - $pdf->SetFont('', 'B', $default_font_size); - $pdf->MultiCell($widthrecbox - 2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, $ltrdirection); - $posy = $pdf->getY(); + if (empty($conf->global->MAIN_PDF_HIDE_SENDER_NAME)) { + $pdf->SetXY($posx + 2, $posy + 3); + $pdf->SetFont('', 'B', $default_font_size); + $pdf->MultiCell($widthrecbox - 2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, $ltrdirection); + $posy = $pdf->getY(); + } // Show sender information $pdf->SetXY($posx + 2, $posy); diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 401309c22e5..adb656d03b9 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -2098,10 +2098,12 @@ class pdf_sponge extends ModelePDFFactures $pdf->SetTextColor(0, 0, 60); // Show sender name - $pdf->SetXY($posx + 2, $posy + 3); - $pdf->SetFont('', 'B', $default_font_size); - $pdf->MultiCell($widthrecbox - 2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, $ltrdirection); - $posy = $pdf->getY(); + if (empty($conf->global->MAIN_PDF_HIDE_SENDER_NAME)) { + $pdf->SetXY($posx + 2, $posy + 3); + $pdf->SetFont('', 'B', $default_font_size); + $pdf->MultiCell($widthrecbox - 2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, $ltrdirection); + $posy = $pdf->getY(); + } // Show sender information $pdf->SetXY($posx + 2, $posy); diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index 1b1ca0d33e2..b54f0f8a7f1 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -649,7 +649,7 @@ class pdf_soleil extends ModelePDFFicheinter $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1); // Show sender name - if (empty($conf->global->MAIN_PDF_NO_SENDER_NAME)) { + if (empty($conf->global->MAIN_PDF_HIDE_SENDER_NAME)) { $pdf->SetXY($posx + 2, $posy + 3); $pdf->SetTextColor(0, 0, 60); $pdf->SetFont('', 'B', $default_font_size); diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index c943e6fa9e3..340d799f6a7 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1585,7 +1585,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetTextColor(0, 0, 60); // Show sender name - if (empty($conf->global->MAIN_PDF_NO_SENDER_NAME)) { + if (empty($conf->global->MAIN_PDF_HIDE_SENDER_NAME)) { $pdf->SetXY($posx + 2, $posy + 3); $pdf->SetFont('', 'B', $default_font_size); $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, $ltrdirection); diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index f75f5ecab56..186544fabb2 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -1699,10 +1699,12 @@ class pdf_cyan extends ModelePDFPropales $pdf->SetTextColor(0, 0, 60); // Show sender name - $pdf->SetXY($posx + 2, $posy + 3); - $pdf->SetFont('', 'B', $default_font_size); - $pdf->MultiCell($widthrecbox - 2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, $ltrdirection); - $posy = $pdf->getY(); + if (empty($conf->global->MAIN_PDF_HIDE_SENDER_NAME)) { + $pdf->SetXY($posx + 2, $posy + 3); + $pdf->SetFont('', 'B', $default_font_size); + $pdf->MultiCell($widthrecbox - 2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, $ltrdirection); + $posy = $pdf->getY(); + } // Show sender information $pdf->SetXY($posx + 2, $posy); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 21f56208bae..36fc408a2b2 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_SENDER_NAME=Hide sender name in address +MAIN_PDF_HIDE_SENDER_NAME=Hide sender name in address 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 e691217d00035371c7989d62a0d5280f7c601050 Mon Sep 17 00:00:00 2001 From: Vincent Dieltiens Date: Thu, 12 Aug 2021 13:56:41 +0200 Subject: [PATCH 17/26] Add a Global variable 'PDF_HIDE_PRODUCT_LABEL_IN_SUPPLIER_LINES' to have the possibility to hide product label in supplier order lines. --- htdocs/core/lib/pdf.lib.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 6a17f4b6d44..93829c4a470 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1275,12 +1275,15 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, $desc = str_replace('(DEPOSIT)', $outputlangs->trans('Deposit'), $desc); } - // Description short of product line - $libelleproduitservice = $label; - if (!empty($libelleproduitservice) && !empty($conf->global->PDF_BOLD_PRODUCT_LABEL)) { - $libelleproduitservice = ''.$libelleproduitservice.''; + if (empty($conf->global->PDF_HIDE_PRODUCT_LABEL_IN_SUPPLIER_LINES)) { + // Description short of product line + $libelleproduitservice = $label; + if (!empty($libelleproduitservice) && !empty($conf->global->PDF_BOLD_PRODUCT_LABEL)) { + $libelleproduitservice = ''.$libelleproduitservice.''; + } } + // Add ref of subproducts if (!empty($conf->global->SHOW_SUBPRODUCT_REF_IN_PDF)) { $prodser->get_sousproduits_arbo(); From 84b8717693777afecdfc62a22fe11af57851b3d0 Mon Sep 17 00:00:00 2001 From: lainwir3d Date: Thu, 12 Aug 2021 17:05:00 +0400 Subject: [PATCH 18/26] CLOSE #18401 Add __NEWREF__ subtitute to get new object reference. Allow the use of __NEWREF__ to get for example the new reference a draft order will get after validation. --- htdocs/core/lib/functions.lib.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index a9cb45e06fb..e04545f094b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6860,6 +6860,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, if ($onlykey) { $substitutionarray['__ID__'] = '__ID__'; $substitutionarray['__REF__'] = '__REF__'; + $substitutionarray['__NEWREF__'] = '__NEWREF__'; $substitutionarray['__REF_CLIENT__'] = '__REF_CLIENT__'; $substitutionarray['__REF_SUPPLIER__'] = '__REF_SUPPLIER__'; $substitutionarray['__NOTE_PUBLIC__'] = '__NOTE_PUBLIC__'; @@ -6940,6 +6941,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, } else { $substitutionarray['__ID__'] = $object->id; $substitutionarray['__REF__'] = $object->ref; + $substitutionarray['__NEWREF__'] = $object->newref; $substitutionarray['__REF_CLIENT__'] = (isset($object->ref_client) ? $object->ref_client : (isset($object->ref_customer) ? $object->ref_customer : null)); $substitutionarray['__REF_SUPPLIER__'] = (isset($object->ref_supplier) ? $object->ref_supplier : null); $substitutionarray['__NOTE_PUBLIC__'] = (isset($object->note_public) ? $object->note_public : null); From 2125bc9aa51116fd9d01f1b091ac9eb359056a80 Mon Sep 17 00:00:00 2001 From: lainwir3d Date: Thu, 12 Aug 2021 17:13:35 +0400 Subject: [PATCH 19/26] CLOSE #18403 Add __URL_SHIPMENT__ substitute to get the URL of a shipment --- htdocs/core/lib/functions.lib.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index a9cb45e06fb..d99ef50bdec 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7183,6 +7183,10 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, if (is_object($object) && $object->element == 'supplier_proposal') { $substitutionarray['__URL_SUPPLIER_PROPOSAL__'] = DOL_MAIN_URL_ROOT."/supplier_proposal/card.php?id=".$object->id; } + if (is_object($object) && $object->element == 'shipping') { + $substitutionarray['__URL_SHIPMENT__'] = DOL_MAIN_URL_ROOT."/expedition/card.php?id=".$object->id; + } + } if (is_object($object) && $object->element == 'action') { From 22eda3fd63e270357c0c8e6408ccaef6bd6672f2 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Thu, 12 Aug 2021 15:39:52 +0200 Subject: [PATCH 20/26] NEW : add missing printFieldListFrom hook call on several lists --- htdocs/comm/propal/list.php | 6 ++++++ htdocs/commande/list.php | 6 ++++++ htdocs/compta/facture/list.php | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 29c87b0ebd2..ccdc77c26cd 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -298,6 +298,12 @@ if ($search_user > 0) $sql.=", ".MAIN_DB_PREFIX."element_contact as c"; $sql.=", ".MAIN_DB_PREFIX."c_type_contact as tc"; } + +// Add table from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; + $sql.= ' WHERE p.fk_soc = s.rowid'; $sql.= ' AND p.entity IN ('.getEntity('propal').')'; if (! $user->rights->societe->client->voir && ! $socid) //restriction diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index f64aadf0e53..227c4d48528 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -273,6 +273,12 @@ if ($search_user > 0) $sql.=", ".MAIN_DB_PREFIX."element_contact as ec"; $sql.=", ".MAIN_DB_PREFIX."c_type_contact as tc"; } + +// Add table from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; + $sql.= ' WHERE c.fk_soc = s.rowid'; $sql.= ' AND c.entity IN ('.getEntity('commande').')'; if ($search_product_category > 0) $sql.=" AND cp.fk_categorie = ".$search_product_category; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 653f1182d78..4685b0e9582 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -407,6 +407,12 @@ if ($search_user > 0) $sql.=", ".MAIN_DB_PREFIX."element_contact as ec"; $sql.=", ".MAIN_DB_PREFIX."c_type_contact as tc"; } + +// Add table from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; + $sql.= ' WHERE f.fk_soc = s.rowid'; $sql.= ' AND f.entity IN ('.getEntity('invoice').')'; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; From 1932bc308ddd11320c46a4a4b8e3fd7028adcad7 Mon Sep 17 00:00:00 2001 From: atm-florian Date: Fri, 13 Aug 2021 13:26:11 +0200 Subject: [PATCH 21/26] FIX: e-mail of applicant is not transferred to the new user when creating a user from an applicant card --- htdocs/recruitment/recruitmentcandidature_card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/recruitment/recruitmentcandidature_card.php b/htdocs/recruitment/recruitmentcandidature_card.php index a1e98ded601..a84644d30cb 100644 --- a/htdocs/recruitment/recruitmentcandidature_card.php +++ b/htdocs/recruitment/recruitmentcandidature_card.php @@ -264,6 +264,7 @@ if (empty($reshook)) { $nuser->birth = $object->date_birth; $nuser->salary = $object->remuneration_proposed; $nuser->fk_user = $jobposition->fk_user_supervisor; // Supervisor + $nuser->email = $object->email; $result = $nuser->create($user); From 5f4ab188cf94eadece2172d154b1401d3bf6f2df Mon Sep 17 00:00:00 2001 From: Quentin VIAL-GOUTEYRON Date: Tue, 17 Aug 2021 09:33:50 +0200 Subject: [PATCH 22/26] NEW hook after rank update --- htdocs/core/class/commonobject.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 50d86d17488..2853031b698 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3022,6 +3022,7 @@ abstract class CommonObject */ public function updateRangOfLine($rowid, $rang) { + global $hookmanager; $fieldposition = 'rang'; // @todo Rename 'rang' into 'position' if (in_array($this->table_element_line, array('bom_bomline', 'ecm_files', 'emailcollector_emailcollectoraction'))) { $fieldposition = 'position'; @@ -3034,6 +3035,9 @@ abstract class CommonObject if (!$this->db->query($sql)) { dol_print_error($this->db); } + $parameters=array('rowid'=>$rowid, 'rang'=>$rang, 'fieldposition' => $fieldposition); + $action=''; + $reshook = $hookmanager->executeHooks('afterRankUpdate', $parameters, $this, $action); } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps From 7986f4881c6fca92f30873725c180d7ca84d8d7b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Aug 2021 16:12:45 +0200 Subject: [PATCH 23/26] Update commonobject.class.php --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 2853031b698..1a2015acac0 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3037,7 +3037,7 @@ abstract class CommonObject } $parameters=array('rowid'=>$rowid, 'rang'=>$rang, 'fieldposition' => $fieldposition); $action=''; - $reshook = $hookmanager->executeHooks('afterRankUpdate', $parameters, $this, $action); + $reshook = $hookmanager->executeHooks('afterRankOfLineUpdate', $parameters, $this, $action); } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps From 582bf1415e4bdb68d22cd842e34738de29d1d629 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Aug 2021 16:35:43 +0200 Subject: [PATCH 24/26] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index d99ef50bdec..051efc09cc3 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7186,7 +7186,6 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, if (is_object($object) && $object->element == 'shipping') { $substitutionarray['__URL_SHIPMENT__'] = DOL_MAIN_URL_ROOT."/expedition/card.php?id=".$object->id; } - } if (is_object($object) && $object->element == 'action') { From 6e7c8677eb492b8b7425a801d8c5059a38079ac3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Aug 2021 16:40:31 +0200 Subject: [PATCH 25/26] Update admin.lang --- htdocs/langs/en_US/admin.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 09bc9bbac1e..9ea8f9ef0cc 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1995,7 +1995,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_HIDE_SENDER_NAME=Hide sender name in address +MAIN_PDF_HIDE_SENDER_NAME=Hide sender/company name in address block PROPOSAL_PDF_HIDE_PAYMENTTERM=Hide payments conditions PROPOSAL_PDF_HIDE_PAYMENTMODE=Hide payment mode MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING=Add electronic sign in PDF @@ -2158,4 +2158,4 @@ DatabasePasswordObfuscated=Database password is obfuscated in conf file DatabasePasswordNotObfuscated=Database password is NOT obfuscated in conf file APIsAreNotEnabled=APIs modules are not enabled YouShouldSetThisToOff=You should set this to 0 or off -InstallAndUpgradeLockedBy=Install and upgrades are locked by the file %s \ No newline at end of file +InstallAndUpgradeLockedBy=Install and upgrades are locked by the file %s From d4c35edef4db6ca318757b4b100b941570c7b29a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Aug 2021 16:55:56 +0200 Subject: [PATCH 26/26] 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 '';