From df96e39d7c2376bf6d50b8823bc34c6c41cbb607 Mon Sep 17 00:00:00 2001 From: Lemon Date: Sat, 27 Jun 2026 17:49:26 +0200 Subject: [PATCH 1/2] NEW Add MAIN_ODT_AS_PDFA option to export ODT documents as PDF/A (#38993) Co-authored-by: Laurent Destailleur --- htdocs/includes/odtphp/odf.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/htdocs/includes/odtphp/odf.php b/htdocs/includes/odtphp/odf.php index ae6a21a9a52..aee2b827e4c 100644 --- a/htdocs/includes/odtphp/odf.php +++ b/htdocs/includes/odtphp/odf.php @@ -901,7 +901,17 @@ IMG; // using windows libreoffice that must be in path // using linux/mac libreoffice that must be in path // Note PHP Config "fastcgi.impersonate=0" must set to 0 - Default is 1 - $command ='soffice --headless -env:UserInstallation=file:'.escapeshellarg((getDolGlobalString('MAIN_ODT_ADD_SLASH_FOR_WINDOWS') ? '///' : '').dol_sanitizePathName($conf->user->dir_temp).'/odtaspdf').' --convert-to pdf --outdir '. escapeshellarg(dirname($name)). " ".escapeshellarg($name); + // By default LibreOffice exports a plain PDF. If MAIN_ODT_AS_PDFA is set to + // 1, 2 or 3, ask LibreOffice for a PDF/A archival format through the + // SelectPdfVersion export filter (1 = PDF/A-1b, 2 = PDF/A-2b, 3 = PDF/A-3b). + // PDF/A is suited for long term archival and is the required base format for + // electronic invoicing (for example Factur-X needs a PDF/A-3 file). + $converttarget = 'pdf'; + $pdfaversion = getDolGlobalInt('MAIN_ODT_AS_PDFA'); + if ($pdfaversion >= 1 && $pdfaversion <= 3) { + $converttarget = 'pdf:writer_pdf_Export:{"SelectPdfVersion":{"type":"long","value":"'.$pdfaversion.'"}}'; + } + $command ='soffice --headless -env:UserInstallation=file:'.escapeshellarg((getDolGlobalString('MAIN_ODT_ADD_SLASH_FOR_WINDOWS') ? '///' : '').dol_sanitizePathName($conf->user->dir_temp).'/odtaspdf').' --convert-to '.escapeshellarg($converttarget).' --outdir '. escapeshellarg(dirname($name)). " ".escapeshellarg($name); } elseif (preg_match('/unoconv/', getDolGlobalString('MAIN_ODT_AS_PDF'))) { // This feature is now disabled by default. Must set var in conf.php to allow it. global $dolibarr_main_allow_unoconv; From f4d34aec50ac0a610d1efe1402caaacd6ac87526 Mon Sep 17 00:00:00 2001 From: nicolasVr <46503289+nicolasVr@users.noreply.github.com> Date: Sat, 27 Jun 2026 17:57:03 +0200 Subject: [PATCH 2/2] FIX Syntax error (#38976) This prevented display of reminder fields --- htdocs/comm/action/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index ef72f36b678..f891f4c38d9 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -2044,7 +2044,7 @@ if ($action == 'create') { $("#select_offsetunittype_duration").select2("destroy"); $("#select_offsetunittype_duration").select2(); selectremindertype(); - }); + } toggle_reminder_part(); $("#addreminder").click(toggle_reminder_part);