From f8de2b8704ee62cd84e4e119fb128a99e6092fc7 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+BB2A-Anthony@users.noreply.github.com> Date: Sun, 2 Aug 2026 16:59:36 +0200 Subject: [PATCH] NEW - Definition of a global email signature (#37427) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Debug v23 * Debug v23 * Doc * New import Leave Balance (Datastructure) (#37001) * New import Leave Balance (Datastructure) * fix --------- Co-authored-by: Lucas Marcouiller * Qual: Update Phan baseline.txt with reduced issue counts (#36996) This commit updates the Phan baseline.txt file. * Better log * Log * Better error management * Doc * Fix error message * CI * Try to fix CI * fix phan (#37007) * CI * fix phan (#37008) PhanTypeMismatchArgumentNullable Argument 3 ($txt) is $productlot->batch of type ?string but \TCPDF::MultiCell() takes string defined at htdocs/includes/tecnickcom/tcpdf/tcpdf.php:5871 (expected type to be non-nullable) * CI * NEW Add new EUID number (#36997) * Doc * ci * Fix CI * Improve OAuth HTTP error details (#36951) Keep throwing TokenResponseException on HTTP 4xx/5xx while also capturing the response body (ignore_errors) to include a short snippet for admins. Co-authored-by: caminotravelcenter Co-authored-by: Laurent Destailleur * NEW add import of leave balance (Implementation) (#37011) * New add import Leave Balance * add eof * Update modHoliday.class.php --------- Co-authored-by: Lucas Marcouiller Co-authored-by: Laurent Destailleur * NEW add image format avif (#37014) * add format avif * Update functions.lib.php * Exclude non interesting warning * Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop * CI * CI * CI * Trans * CI * CI * CI * Fix typo in phpstan.neon.dist for isset() rule (#37018) See https://github.com/Dolibarr/dolibarr/actions/runs/21444577128/job/61756970301?pr=37017 * Remove jstz.min.js from JavaScript array (#37017) jstz.min.js was deleted in https://github.com/Dolibarr/dolibarr/commit/5599ac733b07d990d64e3ff18b30b3dca16d5b86 * Remove jstz.min.js from JavaScript array (#37017) jstz.min.js was deleted in https://github.com/Dolibarr/dolibarr/commit/5599ac733b07d990d64e3ff18b30b3dca16d5b86 * prevent ST_AsWKT() (#37013) * prevent ST_AsWKT() * Update commonobject.class.php --------- Co-authored-by: Laurent Destailleur * prevent ST_AsWKT() (#37013) * prevent ST_AsWKT() * Update commonobject.class.php --------- Co-authored-by: Laurent Destailleur * Try to fix phan * CI * CI * ci * ci * css * qual: Update french texts (comments) to english (#37009) * qual: Update french texts (comments) to english * Qual: Update comment to english in card-rec.php and card.php Translation of comments in the files card-rec.php and card.php. * Qual: Translate comments to English * Qual: Translate comments to English * Fix space into tab * Fix spelling * Qual: Translate comments to English * Update website.php --------- Co-authored-by: Laurent Destailleur * ci * Clean code * Fix test * Debug v23 * Merge manually changes from #37012 that seems good. * Log * More robust phpunit * Populate openid data from wellknow url (#37023) * Delete inexistant file File jstz.min.js was deleted in https://github.com/Dolibarr/dolibarr/commit/5599ac733b07d990d64e3ff18b30b3dca16d5b86 * Populate openid parameters from wellknow url * CI * Debug v23 - fix code for rounding * MCP server sql part (#37025) * Create llx_ai_request_log.sql * Create llx_ai_request_log.key.sql * Update 23.0.0-24.0.0.sql * Update llx_ai_request_log.sql * Update 23.0.0-24.0.0.sql * Remove foreign key constraint from llx_ai_request_log Removed foreign key constraint for fk_user in llx_ai_request_log. --------- Co-authored-by: Laurent Destailleur * Debug v24 * Fix syntax error * NEW allow to disable freezone product on takepos (#37004) * allow to disable freezone product on takepos * Conditionally add FreeZone product to menus * Add NoFreeZoneProduct language entry --------- Co-authored-by: Laurent Destailleur * Fix label of dispute * [database] Minimum amount and subscription's amount formula description (#37021) * Remove jstz.min.js from JavaScript array (#37017) jstz.min.js was deleted in https://github.com/Dolibarr/dolibarr/commit/5599ac733b07d990d64e3ff18b30b3dca16d5b86 * prevent ST_AsWKT() (#37013) * prevent ST_AsWKT() * Update commonobject.class.php --------- Co-authored-by: Laurent Destailleur * css * Update llx_adherent_type.sql add minimumamount and amountformuladescription rows * Update 22.0.0-23.0.0.sql add minimumamount and amountformuladescription column --------- Co-authored-by: hansemschnokeloch Co-authored-by: atm-jonathan <146709163+atm-jonathan@users.noreply.github.com> Co-authored-by: Laurent Destailleur * NEW: Display thirdparty name with ref in supplier orders linked objects (#36952) Co-authored-by: Zakaria Boushaba * css * Debug v23 * Fix type * CI * CI * Test without file list * CI * Add api document management for holiday (#36915) Co-authored-by: Laurent Destailleur * NEW Invoice - List - use select2 multiselect for status (#36834) * NEW Invoice - List - use select2 multiselect for status * Optimize * CI * CI * Review * Duplicate line and last problem * CI --------- Co-authored-by: Laurent Destailleur * FIX Pb in total price of line when adding the discount of a down payment when unit price was using a high accuracy. * Clean code * try to fix phan * Fix phan * Clean code * Clean code * Debug v23 * Fix LDAP * fix facture.class.php (#37031) * Debug v23 * Qual: Update french comments with 'nombre' (#37032) Update french comments with 'nombre' in their phrasing Co-authored-by: Laurent Destailleur * fix phan (#37029) Co-authored-by: Laurent Destailleur * fix phan (#37030) Co-authored-by: Laurent Destailleur * Doc * Doc comment * FIX When bank direct debit SEPA ref is > 99 * Fix when there is more than 99 direct debit in same month * Debug v24 * Merge branch '23.0' of git@github.com:Dolibarr/dolibarr.git into 23.0 * CSS * Fix when there is more than 99 direct debit in same month * Debug v24 * FIX Division by zero * FIX Division by zero * More log * More log * More log * More Log * Fix IPN payment * Fix IPN * Log * Clean code * Debug v23 - Fix ipn for dispute and withdraw funds. * fix CI (#37033) * fix CI (#37033) * CI * fix french doc (#36897) * fix french doc * fix french doc * fix french doc * fix french doc * fix french doc * fix french doc * fix french doc * fix french doc * fix french doc * fix french doc * fix french doc * fix * fix * fix * fix * fix french doc * fix french doc * fix french doc * fix french doc * fix french doc * fix french doc * fix french doc * fix french doc * Update html.form.class.php * Update html.form.class.php * Update index.php * fix * fix * fix * fix * fix * fix * fix * fix * Update modules_facture.php * Update phpstan.neon.dist --------- Co-authored-by: Laurent Destailleur * Qual: Translate French comments to English (#37044) * Qual: Translate French comments to English * Qual: Translate French comments to English * Qual: Translate French comments to English ("niveau") (#37041) Translate French comments to English (comments with "niveau") * fix french doc (#37040) * warning error if no societe->id defined (#37039) * fix french doc (#37037) * fix french doc * Update dispatch.php * Update dispatch.php * Update graph.php * fix french doc (#37047) * fix french doc * Update index.php * Update index.php * Fix CI * Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop * CI * Fix CI * Minimum amount and subscription's amount formula description (#37006) Co-authored-by: Laurent Destailleur * Warning on export/import - Add isset() protection in Export::load_arrays() & Import::load_arrays() (#37043) * Warning on export - Add isset() protection in Export::load_arrays() * Warning on import - Add isset() protection in Import::load_arrays() --------- Co-authored-by: Laurent Destailleur * Clean comment * Warning on account model (#37042) * Error on account model * Simplify rowid assignment in accountmodel.php --------- Co-authored-by: Laurent Destailleur * Fix #35394 Display public note on first page (#36993) * Display public note (an incoterms and sales rep signat) only on real first page * Display public note (an incoterms and sales rep signat) only on real first page --------- Co-authored-by: vmaury Co-authored-by: Laurent Destailleur * FIX: Add htmlname and selectedrate to parameters array for hook (#36998) Co-authored-by: Laurent Destailleur * FIX: Add htmlname and selectedrate to parameters array for hook (#36998) Co-authored-by: Laurent Destailleur * Fix CI * Fix CI * Fix CI * Fix ci * Qual: Translate French comments to English (#37052) * Qual: Translate French 'valeur' in comments to English (#37051) * NEW Accountancy - Select between accrual accounting and cash accounting (#37050) * Qual: Translate french 'avec' comments to English (#37049) # Qual: Translate french 'avec' comments to English * FIX divisa rate indirect to direct because Dolibarr use indirect for default (#37046) * FIX rate_indirect to rate_direct Direct : 1 Divisa Currency = X Currency Main. Indirect : 1 Currency Main = X Divisa Currency. Then for Dolibarr use is Indirect for default * FIX divisa rate indirect to direct Direct : 1 Divisa Currency = X Currency Main. Indirect: 1 Currency Main = X Divisa Currency. Then for Dolibarr use is Indirect for default * FIX divisa rate indirect to direct Direct : 1 Divisa Currency = X Currency Main. Indirect: 1 Currency Main = X Divisa Currency. Then for Dolibarr use is Indirect for default * FIX divisa rate indirect to direct Direct : 1 Divisa Currency = X Currency Main. Indirect: 1 Currency Main = X Divisa Currency. Then for Dolibarr use is Indirect for default * FIX divisa rate indirect to direct Direct : 1 Divisa Currency = X Currency Main. Indirect: 1 Currency Main = X Divisa Currency. Then for Dolibarr use is Indirect for default * Divisa rate direct Direct : 1 Divisa Currency = X Currency Main. Indirect: 1 Currency Main = X Divisa Currency. Then for Dolibarr use is Indirect for default * Add col rate_direct because Dolibarr use for.default rate indirect --------- Co-authored-by: Laurent Destailleur * CI * Add thumbnails for avif (#37045) * vignette for avif * vignette for avif * vignette for avif * vignette for avif * vignette for avif * vignette for avif * vignette for avif * vignette for avif * vignette for avif * vignette for avif * vignette for avif * fix * fix * fix * fix * fix * fix * fix * fix * fix --------- Co-authored-by: Laurent Destailleur * FIX #36892 * NEW : Manage discount for all lines for supplier elements. (#36954) * NEW : Manage remise for all lines for supplier elements. * Cast remise_percent to float in updateline call --------- Co-authored-by: Laurent Destailleur * Fix Signature position (#37048) Move up the position of the signature to fix its explosion on 3 pages * remove french doc and fix travis migration missing (#37053) * fix french doc * fix french doc * fix french doc * fix french doc * Clean up comments in card.php Removed unnecessary comments from card.php --------- Co-authored-by: Laurent Destailleur * Debug v23 * Fix CSS * Fix CSS * Fix sql syntax error * Fix sql syntax error * Add optionnal img to openid login (#37060) * fix french doc (#37056) * fix french doc * fix french doc * fix french doc * doc translation * doc translation * doc translation * doc translation * doc translation * load tables in init for create categorie table associated (#37059) * Fix situation invoice * Fix situation invoice * Debug v23 * Link and filter on ountry for holiday types * Link and filter on ountry for holiday types * Trans * Debug v23 * css * CSS on current day * Debug v23 * css * More complete message * Make array of dispute status a shared constant * Debug v23 * Debug v23 * bad link on sql in fichinter list (#37081) * bad link on sql in fichinter list (#37081) * FIX: TakePOS, webapp-hardware-bridge and TakePOS-Connector for modern weighing scales (#37078) * feat: CustomerDisplay through Webapp-Hardware-Bridge * feat: WeighingScale through Webapp-Hardware-Bridge * feat: WeighingScale through Webapp-Hardware-Bridge * fix: looks like a typo * feat: for small screens * fix: attribut contenant le prix du produit ajouté * feat: ajout d'un callback de gestion d'erreur * Clean code for Takepos * Debug v23 * Fix new path of dolreceiptprinter.class.php * Adjust signature appearance position in PDF generation (#37076) * EmailCollector: exclude sender emails/domains (#37075) # Conflicts: # htdocs/langs/en_US/admin.lang Co-authored-by: braito4 * fix: dev/examples/zapier/package.json to reduce vulnerabilities (#37071) The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-LODASH-15053838 Co-authored-by: snyk-bot * translate french doc to english (#37064) * fix french doc * fix french doc * fix french doc * fix french doc * fix * fix * fix * fix * Trans * Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop * Change translation function to transnoentities (#37065) Co-authored-by: Laurent Destailleur * Change translation function to transnoentities (#37065) Co-authored-by: Laurent Destailleur * NEW Show total multicurrency on payment (#37070) * Total multicurrency * Total multicurrency paiment * total result multicurrency * show total multicurrency * Fix CI * CLOSE #37085 - Popup notif is just under the menu bar * fix: add missing geturl lib (#37088) * Fix CI * Restrict to modiied files * #36843 Update card-rec.php (#37062) The item desc is already added into the line when selecting the Item. No Need to concat it again when clicking the "add" button. * Clean code * Fix CI * Doc * Fix CI * family assignment logic on user perms of external modules (#36456) * family assignment logic on user perms of external modules Updated family assignment logic to default to 'other' if family does not exist in $familyinfo. * Update copyright year for Charlene Benke * family assignment logic on user perms of external modules (#36456) * family assignment logic on user perms of external modules Updated family assignment logic to default to 'other' if family does not exist in $familyinfo. * Update copyright year for Charlene Benke * Fix comment and keep external modules out of core modules * Close #36975 * Close #36975 * css * NEW : hide remise_except unit price on invoice lines (#37066) Co-authored-by: Laurent Destailleur * NEW(API): create fixed amount discount (#37091) * NEW(API): create fixed amount discount * FIX CI * FIX CI --------- Co-authored-by: Benjamin Falière * Fix phan * CI * FIX * FIX * NEW - Definition of a global email signature * Fix parameter in DolEditor instantiation * Fix DolEditor instantiation parameter --------- Co-authored-by: Laurent Destailleur Co-authored-by: Laurent Destailleur Co-authored-by: Lucas Marcouiller <45882981+Hystepik@users.noreply.github.com> Co-authored-by: Lucas Marcouiller Co-authored-by: MDW Co-authored-by: Frédéric FRANCE Co-authored-by: Alexandre SPANGARO Co-authored-by: Braito Co-authored-by: caminotravelcenter Co-authored-by: hansemschnokeloch Co-authored-by: atm-jonathan <146709163+atm-jonathan@users.noreply.github.com> Co-authored-by: sonikf <93765174+sonikf@users.noreply.github.com> Co-authored-by: Charlène Benke <1179011+defrance@users.noreply.github.com> Co-authored-by: Thatoo Co-authored-by: Zakaria Boushaba <48571684+Boushabazakaria@users.noreply.github.com> Co-authored-by: Zakaria Boushaba Co-authored-by: Vincent Maury Co-authored-by: vmaury Co-authored-by: Jyhere Co-authored-by: Lenin Rivas <53640168+leninrivas@users.noreply.github.com> Co-authored-by: ThomasNgr-OpenDSI Co-authored-by: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Co-authored-by: LePat Co-authored-by: braito4 Co-authored-by: snyk-bot Co-authored-by: Vanyo Co-authored-by: AWeerWolf <74211972+AWeerWolf@users.noreply.github.com> Co-authored-by: Benjamin Falière <121813548+BenjaminFlr@users.noreply.github.com> Co-authored-by: Benjamin Falière Co-authored-by: Anthony Berton --- htdocs/admin/mails.php | 20 ++++++++++++++++++-- htdocs/core/lib/functions.lib.php | 6 +++++- htdocs/langs/en_US/admin.lang | 2 ++ 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index a36102affab..56aea4e8355 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -6,7 +6,9 @@ * Copyright (C) 2023 Anthony Berton * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2024-2025 MDW - * + * Copyright (C) 2026 Anthony Berton + +* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or @@ -102,6 +104,9 @@ if ($action == 'update' && !$cancel) { dolibarr_set_const($db, "MAIN_MAIL_FORCE_SENDTO", GETPOST("MAIN_MAIL_FORCE_SENDTO", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_MAIL_ENABLED_USER_DEST_SELECT", GETPOSTINT("MAIN_MAIL_ENABLED_USER_DEST_SELECT"), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, 'MAIN_MAIL_NO_WITH_TO_SELECTED', GETPOSTINT('MAIN_MAIL_NO_WITH_TO_SELECTED'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, 'MAIN_MAIL_DEFAULT_SIGNATURE_FOR_ALL_USERS', GETPOST('MAIN_MAIL_DEFAULT_SIGNATURE_FOR_ALL_USERS', 'restricthtml'), 'chaine', 0, '', $conf->entity); + + // Send mode parameters dolibarr_set_const($db, "MAIN_MAIL_SENDMODE", GETPOST("MAIN_MAIL_SENDMODE", 'aZ09'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_MAIL_SMTP_PORT", GETPOSTINT("MAIN_MAIL_SMTP_PORT"), 'chaine', 0, '', $conf->entity); @@ -670,6 +675,12 @@ if ($action == 'edit') { print ''.$langs->trans("MAIN_MAIL_NO_WITH_TO_SELECTED").''; print $form->selectyesno('MAIN_MAIL_NO_WITH_TO_SELECTED', getDolGlobalString('MAIN_MAIL_NO_WITH_TO_SELECTED'), 1); print ''; + // Global signature for all users employees + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $doleditor = new DolEditor('MAIN_MAIL_DEFAULT_SIGNATURE_FOR_ALL_USERS', getDolGlobalString('MAIN_MAIL_DEFAULT_SIGNATURE_FOR_ALL_USERS'), '', 138, 'dolibarr_notes', 'In', true, true, !getDolGlobalString('FCKEDITOR_ENABLE_USERSIGN') ? 0 : 1, 0, '90%'); + $text = $langs->trans("MAIN_MAIL_DEFAULT_SIGNATURE_FOR_ALL_USERS"); + $texthelp = $langs->trans("MAIN_MAIL_DEFAULT_SIGNATURE_FOR_ALL_USERS_Help"); + print ''.$form->textwithpicto($text, $texthelp, 1, 'help').''.$doleditor->Create(1).''; print ''; print ''; @@ -999,7 +1010,12 @@ if ($action == 'edit') { print ''.$langs->trans("MAIN_MAIL_ENABLED_USER_DEST_SELECT").''.yn(getDolGlobalString('MAIN_MAIL_ENABLED_USER_DEST_SELECT')).''; //Disable autoselect to print ''.$langs->trans("MAIN_MAIL_NO_WITH_TO_SELECTED").''.yn(getDolGlobalString('MAIN_MAIL_NO_WITH_TO_SELECTED')).''; - + // Global signature for all users employees + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $doleditor = new DolEditor('MAIN_MAIL_DEFAULT_SIGNATURE_FOR_ALL_USERS', getDolGlobalString('MAIN_MAIL_DEFAULT_SIGNATURE_FOR_ALL_USERS'), '', 138, 'dolibarr_notes', 'In', true, true, !getDolGlobalString('FCKEDITOR_ENABLE_USERSIGN') ? 0 : 1, 0, '90%', 1); + $text = $langs->trans("MAIN_MAIL_DEFAULT_SIGNATURE_FOR_ALL_USERS"); + $texthelp = $langs->trans("MAIN_MAIL_DEFAULT_SIGNATURE_FOR_ALL_USERS_Help"); + print ''.$form->textwithpicto($text, $texthelp, 1, 'help').''.$doleditor->Create(1).''; print ''; print ''; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 0e328b7ce9f..e6a2096836e 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -17,7 +17,7 @@ * Copyright (C) 2019-2023 Thibault Foucart * Copyright (C) 2020 Open-Dsi * Copyright (C) 2021 Gauthier VERDOL - * Copyright (C) 2022 Anthony Berton + * Copyright (C) 2022-2026 Anthony Berton * Copyright (C) 2022 Ferran Marcet * Copyright (C) 2022-2026 Charlene Benke * Copyright (C) 2024-2026 MDW @@ -10226,6 +10226,10 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, //var_dump($onlykey); $emailsendersignature = $user->signature; // By default, we use the signature of current user. We must complete substitution with signature in c_email_senderprofile of array after calling getCommonSubstitutionArray() $usersignature = $user->signature; + if (getDolGlobalString('MAIN_MAIL_DEFAULT_SIGNATURE_FOR_ALL_USERS') && !empty($user->employee)) { + $emailsendersignature = getDolGlobalString('MAIN_MAIL_DEFAULT_SIGNATURE_FOR_ALL_USERS'); + $usersignature = getDolGlobalString('MAIN_MAIL_DEFAULT_SIGNATURE_FOR_ALL_USERS'); + } $substitutionarray = array_merge($substitutionarray, array( '__SENDEREMAIL_SIGNATURE__' => (string) ((!getDolGlobalString('MAIN_MAIL_DO_NOT_USE_SIGN')) ? ($onlykey == 2 ? dol_trunc('SignatureFromTheSelectedSenderProfile', 30) : $emailsendersignature) : ''), '__USER_SIGNATURE__' => (string) (($usersignature && !getDolGlobalString('MAIN_MAIL_DO_NOT_USE_SIGN')) ? ($onlykey == 2 ? dol_trunc(dol_string_nohtmltag($usersignature), 30) : $usersignature) : '') diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 5d6658482bb..cd77df9774e 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -324,6 +324,8 @@ MAIN_DISABLE_ALL_MAILS=Disable all email sending (for test purposes or demos) MAIN_MAIL_FORCE_SENDTO=Send all emails to (instead of real recipients, for test purposes) MAIN_MAIL_ENABLED_USER_DEST_SELECT=Suggest emails of employees (if defined) into the list of predefined recipient when writing a new email MAIN_MAIL_NO_WITH_TO_SELECTED=Disable the selection of a default recipient when writing an email, even if there is only 1 possible choice +MAIN_MAIL_DEFAULT_SIGNATURE_FOR_ALL_USERS=Signature for all employee user +MAIN_MAIL_DEFAULT_SIGNATURE_FOR_ALL_USERS_Help=User signatures will be replaced by this one. Leave the field empty to keep the user signatures. MAIN_MAIL_SENDMODE=Sending method MAIN_MAIL_SMTPS_ID=SMTP username or ID (if sending server requires an authentication) MAIN_MAIL_SMTPS_PW=SMTP password or token (if sending server requires an authentication)