From 26c50b9e2ca2c43ab20ce786e39310fd5d481875 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 15 Oct 2021 11:59:12 +0200 Subject: [PATCH 1/3] add setting to create PDF in PDF/A - 1b format #18990 --- htdocs/admin/pdf.php | 12 ++++++++++++ htdocs/langs/en_US/admin.lang | 1 + 2 files changed, 13 insertions(+) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index be45a2101f5..a245c9338c9 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -165,6 +165,10 @@ if ($action == 'update') { dolibarr_set_const($db, "PDF_SHOW_LINK_TO_ONLINE_PAYMENT", GETPOST('PDF_SHOW_LINK_TO_ONLINE_PAYMENT', 'alpha'), 'chaine', 0, '', $conf->entity); } + if (GETPOSTISSET('PDF_USE_1A')) { + dolibarr_set_const($db, "PDF_USE_1A", GETPOST('PDF_USE_1A', 'alpha'), 'chaine', 0, '', $conf->entity); + } + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); @@ -534,6 +538,14 @@ if ($conf->use_javascript_ajax) { } print ''; +print ''.$langs->trans("PDF_USE_1A").''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('PDF_USE_1A'); +} else { + print $form->selectyesno('PDF_USE_1A', (!empty($conf->global->PDF_USE_1A)) ? $conf->global->PDF_USE_1A : 0, 1); +} +print ''; + print ''; print ''; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index def603e653e..81034e4aacd 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2194,3 +2194,4 @@ LanguageAndPresentation=Language and presentation SkinAndColors=Skin and colors IfYouUseASecondTaxYouMustSetYouUseTheMainTax=If you want to use a second tax, you must enable also the first sales tax IfYouUseAThirdTaxYouMustSetYouUseTheMainTax=If you want to use a third tax, you must enable also the first sales tax +PDF_USE_1A=Generate PDF with PDF/A- 1b format From bbbc58ec024150a8727cb646191471b81968ddf5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Oct 2021 18:55:34 +0200 Subject: [PATCH 2/3] Update admin.lang --- 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 81034e4aacd..0cf17545b5f 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2194,4 +2194,4 @@ LanguageAndPresentation=Language and presentation SkinAndColors=Skin and colors IfYouUseASecondTaxYouMustSetYouUseTheMainTax=If you want to use a second tax, you must enable also the first sales tax IfYouUseAThirdTaxYouMustSetYouUseTheMainTax=If you want to use a third tax, you must enable also the first sales tax -PDF_USE_1A=Generate PDF with PDF/A- 1b format +PDF_USE_1A=Generate PDF with PDF/A-1b format From 5dfbd3642fc299d781cb1a8bca7b9fe2a70bf4a2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Oct 2021 19:03:20 +0200 Subject: [PATCH 3/3] Update pdf.php --- htdocs/admin/pdf.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index a245c9338c9..fdb0dae6ff0 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -165,8 +165,8 @@ if ($action == 'update') { dolibarr_set_const($db, "PDF_SHOW_LINK_TO_ONLINE_PAYMENT", GETPOST('PDF_SHOW_LINK_TO_ONLINE_PAYMENT', 'alpha'), 'chaine', 0, '', $conf->entity); } - if (GETPOSTISSET('PDF_USE_1A')) { - dolibarr_set_const($db, "PDF_USE_1A", GETPOST('PDF_USE_1A', 'alpha'), 'chaine', 0, '', $conf->entity); + if (GETPOSTISSET('PDF_USE_A')) { + dolibarr_set_const($db, "PDF_USE_A", GETPOST('PDF_USE_A', 'alpha'), 'chaine', 0, '', $conf->entity); } setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); @@ -538,11 +538,11 @@ if ($conf->use_javascript_ajax) { } print ''; -print ''.$langs->trans("PDF_USE_1A").''; +print ''.$langs->trans("PDF_USE_A").''; if ($conf->use_javascript_ajax) { - print ajax_constantonoff('PDF_USE_1A'); + print ajax_constantonoff('PDF_USE_A'); } else { - print $form->selectyesno('PDF_USE_1A', (!empty($conf->global->PDF_USE_1A)) ? $conf->global->PDF_USE_1A : 0, 1); + print $form->selectyesno('PDF_USE_A', (empty($conf->global->PDF_USE_1A) ? 0 : $conf->global->PDF_USE_A, 1); } print '';