From 6b54d7f8335ff643b02c8bca3d52332b2de6a624 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Apr 2024 13:49:35 +0200 Subject: [PATCH 1/4] Fix #29098 --- htdocs/contact/perso.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contact/perso.php b/htdocs/contact/perso.php index c5ab1faf862..0661a80b685 100644 --- a/htdocs/contact/perso.php +++ b/htdocs/contact/perso.php @@ -120,7 +120,7 @@ if ($action == 'update' && !GETPOST("cancel") && $user->hasRight('societe', 'con $now = dol_now(); -$title = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")); +$title = $langs->trans("ContactPersonalData"); if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/contactnameonly/', getDolGlobalString('MAIN_HTML_TITLE')) && $object->lastname) { $title = $object->lastname; } From 4b1dba0764b70aecded36a4f4d01339b150c1520 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Apr 2024 14:06:03 +0200 Subject: [PATCH 2/4] Fix replyto and from is not the same. --- htdocs/admin/notification.php | 30 ++++++++++++++++++------------ htdocs/core/class/notify.class.php | 10 +++++----- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php index 43e29dfb535..b4b5ee09fc6 100644 --- a/htdocs/admin/notification.php +++ b/htdocs/admin/notification.php @@ -196,28 +196,18 @@ print ''.$langs->trans("Parameter").''; print ''.$langs->trans("Value").''; print "\n"; + print ''; print $langs->trans("NotificationEMailFrom").''; print ''; print img_picto('', 'email', 'class="pictofixedwidth"'); print ''; -if (getDolGlobalString('NOTIFICATION_EMAIL_FROM') && !isValidEmail($conf->global->NOTIFICATION_EMAIL_FROM)) { +if (getDolGlobalString('NOTIFICATION_EMAIL_FROM') && !isValidEmail(getDolGlobalString('NOTIFICATION_EMAIL_FROM'))) { print ' '.img_warning($langs->trans("ErrorBadEMail")); } print ''; print ''; -print ''; -print $langs->trans("NotificationDisableConfirmMessageContact").''; -print ''; -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_CONTACT'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_CONTACT", $arrval, getDolGlobalString('NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_CONTACT')); -} -print ''; -print ''; print ''; print $langs->trans("NotificationDisableConfirmMessageUser").''; @@ -231,6 +221,20 @@ if ($conf->use_javascript_ajax) { print ''; print ''; + +print ''; +print $langs->trans("NotificationDisableConfirmMessageContact").''; +print ''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_CONTACT'); +} else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_CONTACT", $arrval, getDolGlobalString('NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_CONTACT')); +} +print ''; +print ''; + + print ''; print $langs->trans("NotificationDisableConfirmMessageFix").''; print ''; @@ -242,6 +246,8 @@ if ($conf->use_javascript_ajax) { } print ''; print ''; + + print ''; print ''; diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index e498e287323..c4b0a371726 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -646,7 +646,7 @@ class Notify if (getDolGlobalString('MAIN_APPLICATION_TITLE')) { $application = getDolGlobalString('MAIN_APPLICATION_TITLE'); } - $replyto = $conf->notification->email_from; + $from = getDolGlobalString('NOTIFICATION_EMAIL_FROM'); $object_type = ''; $link = ''; $num = 0; @@ -945,7 +945,7 @@ class Notify $sendto = preg_replace('/[\s,]+$/', '', $sendto); // Clean end of string } - $parameters = array('notifcode' => $notifcode, 'sendto' => $sendto, 'replyto' => $replyto, 'file' => $filename_list, 'mimefile' => $mimetype_list, 'filename' => $mimefilename_list, 'outputlangs' => $outputlangs, 'labeltouse' => $labeltouse); + $parameters = array('notifcode' => $notifcode, 'sendto' => $sendto, 'from' => $from, 'file' => $filename_list, 'mimefile' => $mimetype_list, 'filename' => $mimefilename_list, 'outputlangs' => $outputlangs, 'labeltouse' => $labeltouse); if (!isset($action)) { $action = ''; } @@ -968,7 +968,7 @@ class Notify $mailfile = new CMailFile( $subject, $sendto, - $replyto, + $from, $message, $filename_list, $mimetype_list, @@ -1211,7 +1211,7 @@ class Notify } if ($sendto) { - $parameters = array('notifcode' => $notifcode, 'sendto' => $sendto, 'replyto' => $replyto, 'file' => $filename_list, 'mimefile' => $mimetype_list, 'filename' => $mimefilename_list, 'subject' => &$subject, 'message' => &$message); + $parameters = array('notifcode' => $notifcode, 'sendto' => $sendto, 'from' => $from, 'file' => $filename_list, 'mimefile' => $mimetype_list, 'filename' => $mimefilename_list, 'subject' => &$subject, 'message' => &$message); $reshook = $hookmanager->executeHooks('formatNotificationMessage', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if (empty($reshook)) { if (!empty($hookmanager->resArray['files'])) { @@ -1229,7 +1229,7 @@ class Notify $mailfile = new CMailFile( $subject, $sendto, - $replyto, + $from, $message, $filename_list, $mimetype_list, From a8d024f9f8a23426be35bf72de4ec370d67f5fae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Apr 2024 14:11:24 +0200 Subject: [PATCH 3/4] Fix lang --- dev/translation/dynamic_translation_keys.lst | 1 + htdocs/admin/notification.php | 2 +- htdocs/langs/en_US/other.lang | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dev/translation/dynamic_translation_keys.lst b/dev/translation/dynamic_translation_keys.lst index b66526bd241..00a01c617ca 100644 --- a/dev/translation/dynamic_translation_keys.lst +++ b/dev/translation/dynamic_translation_keys.lst @@ -2029,6 +2029,7 @@ Notify_MEMBER_MODIFY Notify_MEMBER_RESILIATE Notify_MEMBER_SUBSCRIPTION Notify_MEMBER_VALIDATE +Notify_ORDER_CANCEL Notify_ORDER_CLOSE Notify_ORDER_SENTBYMAIL Notify_ORDER_SUPPLIER_APPROVE diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php index b4b5ee09fc6..d7bb4315638 100644 --- a/htdocs/admin/notification.php +++ b/htdocs/admin/notification.php @@ -189,7 +189,7 @@ print '
'; print ''; print ''; -print '
'; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang index 12955cc9f0e..41a8ac3985d 100644 --- a/htdocs/langs/en_US/other.lang +++ b/htdocs/langs/en_US/other.lang @@ -42,6 +42,7 @@ notiftouserandtofixedemail=To user and fixed mail Notify_ORDER_VALIDATE=Sales order validated Notify_ORDER_SENTBYMAIL=Sales order sent by mail Notify_ORDER_CLOSE=Sales order delivered +Notify_ORDER_CANCEL=Sales order canceled Notify_ORDER_SUPPLIER_SENTBYMAIL=Purchase order sent by email Notify_ORDER_SUPPLIER_VALIDATE=Purchase order recorded Notify_ORDER_SUPPLIER_APPROVE=Purchase order approved From 9811ef1a78479c49da3acb571805bfe3a85f86f0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Apr 2024 14:43:05 +0200 Subject: [PATCH 4/4] Fix phpstan --- htdocs/expensereport/class/api_expensereports.class.php | 2 +- htdocs/modulebuilder/template/class/api_mymodule.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/expensereport/class/api_expensereports.class.php b/htdocs/expensereport/class/api_expensereports.class.php index 9d77af493a1..b6bc3a8c8b9 100644 --- a/htdocs/expensereport/class/api_expensereports.class.php +++ b/htdocs/expensereport/class/api_expensereports.class.php @@ -187,7 +187,7 @@ class ExpenseReports extends DolibarrApi continue; } - $this->expensereport->$field = $this->_checkValForAPI($field, $value, $this->epensereport); + $this->expensereport->$field = $this->_checkValForAPI($field, $value, $this->expensereport); } /*if (isset($request_data["lines"])) { $lines = array(); diff --git a/htdocs/modulebuilder/template/class/api_mymodule.class.php b/htdocs/modulebuilder/template/class/api_mymodule.class.php index d369237d412..25291332ffd 100644 --- a/htdocs/modulebuilder/template/class/api_mymodule.class.php +++ b/htdocs/modulebuilder/template/class/api_mymodule.class.php @@ -212,7 +212,7 @@ class MyModuleApi extends DolibarrApi if ($field == 'array_options' && is_array($value)) { foreach ($value as $index => $val) { - $this->contact->array_options[$index] = $this->_checkValForAPI('extrafields', $val, $this->contact); + $this->myobject->array_options[$index] = $this->_checkValForAPI('extrafields', $val, $this->myobject); } continue; }
'.$langs->trans("Parameter").'