diff --git a/ChangeLog b/ChangeLog
index 40b4b40eb4a..9b5eef7aca5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,14 +13,16 @@ NEW: complete_head_from_modules() in ldap_prepare_head()
WARNING:
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
-* The methode "cloture" on contact were renamed into "closeAll".
+* The methode "cloture" on contract were renamed into "closeAll".
* The substitution key for reference of object is now __REF__ whatever is the object (it replaces __ORDERREF__,
__PROPALREF__, ...)
+* The substition key __SIGNATURE__ was renamed into __USER_SIGNATURE__ to standardize naming conventions.
+* Substitution keys with syntax %XXX% were renamed into __XXX__ to match others.
* Some REST API to access the dictionary (country, town, ...) were moved into a common API.
* Page bank/index.php and bank/bankentries.php were renamed into bank/list.php and bank/bankentries_list.php to
follow page naming conventions (so default filter/sort order features can also work).
-* The trigger ORDER_SUPPLIER_STATUS_ONPROCESS was renamed ORDER_SUPPLIER_STATUS_ORDERED
-* The trigger ORDER_SUPPLIER_STATUS_RECEIVED_ALL was renamed ORDER_SUPPLIER_STATUS_RECEIVED_COMPLETELY
+* The trigger ORDER_SUPPLIER_STATUS_ONPROCESS was renamed into ORDER_SUPPLIER_STATUS_ORDERED
+* The trigger ORDER_SUPPLIER_STATUS_RECEIVED_ALL was renamed into ORDER_SUPPLIER_STATUS_RECEIVED_COMPLETELY
***** ChangeLog for 6.0.2 compared to 6.0.1 *****
diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php
index 961491cce2e..42fbd3903c0 100644
--- a/htdocs/admin/mails.php
+++ b/htdocs/admin/mails.php
@@ -50,7 +50,7 @@ $substitutionarrayfortest=array(
'__ID__' => 'RecipientIdRecord',
//'__EMAIL__' => 'RecipientEMail', // Done into actions_sendmails
'__CHECK_READ__' => (is_object($object) && is_object($object->thirdparty))?'
':'',
-'__SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?$usersignature:''), // Done into actions_sendmails
+'__USER_SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?$usersignature:''), // Done into actions_sendmails
'__LOGIN__' => 'RecipientLogin',
'__LASTNAME__' => 'RecipientLastname',
'__FIRSTNAME__' => 'RecipientFirstname',
diff --git a/htdocs/admin/mails_emailing.php b/htdocs/admin/mails_emailing.php
index b98661edab5..fc4b41bd6ab 100644
--- a/htdocs/admin/mails_emailing.php
+++ b/htdocs/admin/mails_emailing.php
@@ -51,7 +51,7 @@ $substitutionarrayfortest=array(
'__EMAIL__' => 'TESTEMail',
'__LASTNAME__' => 'TESTLastname',
'__FIRSTNAME__' => 'TESTFirstname',
-'__SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?$usersignature:''),
+'__USER_SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?$usersignature:''),
//'__PERSONALIZED__' => 'TESTPersonalized' // Hiden because not used yet
);
complete_substitutions_array($substitutionarrayfortest, $langs);
diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php
index 539f8bede92..c8338d22379 100644
--- a/htdocs/comm/mailing/card.php
+++ b/htdocs/comm/mailing/card.php
@@ -216,7 +216,8 @@ if (empty($reshook))
$substitutionarray['__OTHER3__'] = $other3;
$substitutionarray['__OTHER4__'] = $other4;
$substitutionarray['__OTHER5__'] = $other5;
- $substitutionarray['__SIGNATURE__'] = $signature; // Signature is empty when ran from command line or taken from user in parameter)
+ $substitutionarray['__USER_SIGNATURE__'] = $signature; // Signature is empty when ran from command line or taken from user in parameter)
+ $substitutionarray['__SIGNATURE__'] = $signature; // For backward compatibility
$substitutionarray['__CHECK_READ__'] = '
';
$substitutionarray['__UNSUBSCRIBE__'] = ''.$langs->trans("MailUnsubcribe").'';
diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php
index 3ad460a8688..93d2244a6ec 100644
--- a/htdocs/core/class/html.formmail.class.php
+++ b/htdocs/core/class/html.formmail.class.php
@@ -858,9 +858,9 @@ class FormMail extends Form
$defaultmessage=str_replace('\n',"\n",$defaultmessage);
// Deal with format differences between message and signature (text / HTML)
- if(dol_textishtml($defaultmessage) && !dol_textishtml($this->substit['__SIGNATURE__'])) {
- $this->substit['__SIGNATURE__'] = dol_nl2br($this->substit['__SIGNATURE__']);
- } else if(!dol_textishtml($defaultmessage) && dol_textishtml($this->substit['__SIGNATURE__'])) {
+ if(dol_textishtml($defaultmessage) && !dol_textishtml($this->substit['__USER_SIGNATURE__'])) {
+ $this->substit['__USER_SIGNATURE__'] = dol_nl2br($this->substit['__USER_SIGNATURE__']);
+ } else if(!dol_textishtml($defaultmessage) && dol_textishtml($this->substit['__USER_SIGNATURE__'])) {
$defaultmessage = dol_nl2br($defaultmessage);
}
@@ -1213,7 +1213,7 @@ class FormMail extends Form
$tmparray['__OTHER3__'] = 'Other3';
$tmparray['__OTHER4__'] = 'Other4';
$tmparray['__OTHER5__'] = 'Other5';
- $tmparray['__SIGNATURE__'] = 'TagSignature';
+ $tmparray['__USER_SIGNATURE__'] = 'TagSignature';
$tmparray['__CHECK_READ__'] = 'TagCheckMail';
$tmparray['__UNSUBSCRIBE__'] = 'TagUnsubscribe';
//,'__PERSONALIZED__' => 'Personalized' // Hidden because not used yet in mass emailing
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index c3c7913e2d4..6aafc6c2bbd 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -5511,7 +5511,9 @@ function make_substitutions($text, $substitutionarray, $outputlangs=null)
// Make substitition for array $substitutionarray
foreach ($substitutionarray as $key => $value)
{
- if ($key == '__SIGNATURE__' && (! empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))) $value='';
+ if ($key == '__SIGNATURE__' && (! empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))) $value=''; // Protection
+ if ($key == '__USER_SIGNATURE__' && (! empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))) $value=''; // Protection
+
$text=str_replace("$key","$value",$text); // We must keep the " to work when value is 123.5 for example
}
diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang
index bbc8f34a92e..e1270533ae2 100644
--- a/htdocs/langs/en_US/other.lang
+++ b/htdocs/langs/en_US/other.lang
@@ -76,19 +76,19 @@ MaxSize=Maximum size
AttachANewFile=Attach a new file/document
LinkedObject=Linked object
NbOfActiveNotifications=Number of notifications (nb of recipient emails)
-PredefinedMailTest=This is a test mail sent to __EMAIL__.\nThe two lines are separated by a carriage return.\n\n__SIGNATURE__
-PredefinedMailTestHtml=This is a test mail (the word test must be in bold).
The two lines are separated by a carriage return.
__SIGNATURE__
-PredefinedMailContentSendInvoice=__CONTACTCIVNAME__\n\nYou will find here the invoice __REF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
-PredefinedMailContentSendInvoiceReminder=__CONTACTCIVNAME__\n\nWe would like to warn you that the invoice __REF__ seems to not be payed. So this is the invoice in attachment again, as a reminder.\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
-PredefinedMailContentSendProposal=__CONTACTCIVNAME__\n\nYou will find here the commercial proposal __PREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
-PredefinedMailContentSendSupplierProposal=__CONTACTCIVNAME__\n\nYou will find here the price request __REF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
-PredefinedMailContentSendOrder=__CONTACTCIVNAME__\n\nYou will find here the order __REF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
-PredefinedMailContentSendSupplierOrder=__CONTACTCIVNAME__\n\nYou will find here our order __REF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
-PredefinedMailContentSendSupplierInvoice=__CONTACTCIVNAME__\n\nYou will find here the invoice __REF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
-PredefinedMailContentSendShipping=__CONTACTCIVNAME__\n\nYou will find here the shipping __REF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
-PredefinedMailContentSendFichInter=__CONTACTCIVNAME__\n\nYou will find here the intervention __REF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
-PredefinedMailContentThirdparty=\n\n__SIGNATURE__
-PredefinedMailContentUser=\n\n__SIGNATURE__
+PredefinedMailTest=__(Hello)__\nThis is a test mail sent to __EMAIL__.\nThe two lines are separated by a carriage return.\n\n__USER_SIGNATURE__
+PredefinedMailTestHtml=__(Hello)__\nThis is a test mail (the word test must be in bold).
The two lines are separated by a carriage return.
__USER_SIGNATURE__
+PredefinedMailContentSendInvoice=__(Hello)__\n\nYou will find here the invoice __REF__\n\n__ONLINE_PAYMENT_URL__\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
+PredefinedMailContentSendInvoiceReminder=__(Hello)__\n\nWe would like to warn you that the invoice __REF__ seems to not be payed. So this is the invoice in attachment again, as a reminder.\n\n__ONLINE_PAYMENT_URL__\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
+PredefinedMailContentSendProposal=__(Hello)__\n\nYou will find here the commercial proposal __PREF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
+PredefinedMailContentSendSupplierProposal=__(Hello)__\n\nYou will find here the price request __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
+PredefinedMailContentSendOrder=__(Hello)__\n\nYou will find here the order __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
+PredefinedMailContentSendSupplierOrder=__(Hello)__\n\nYou will find here our order __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
+PredefinedMailContentSendSupplierInvoice=__(Hello)__\n\nYou will find here the invoice __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
+PredefinedMailContentSendShipping=__(Hello)__\n\nYou will find here the shipping __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
+PredefinedMailContentSendFichInter=__(Hello)__\n\nYou will find here the intervention __REF__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
+PredefinedMailContentThirdparty=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
+PredefinedMailContentUser=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__
DemoDesc=Dolibarr is a compact ERP/CRM supporting several business modules. A demo showcasing all modules makes no sense as this scenario never occurs (several hundred available). So, several demo profiles are available.
ChooseYourDemoProfil=Choose the demo profile that best suits your needs...
ChooseYourDemoProfilMore=...or build your own profile
(manual module selection)
diff --git a/scripts/emailings/mailing-send.php b/scripts/emailings/mailing-send.php
index 836f435890b..7daf0dace88 100755
--- a/scripts/emailings/mailing-send.php
+++ b/scripts/emailings/mailing-send.php
@@ -178,7 +178,8 @@ if ($resql)
$substitutionarray['__OTHER3__'] = $other3;
$substitutionarray['__OTHER4__'] = $other4;
$substitutionarray['__OTHER5__'] = $other5;
- $substitutionarray['__SIGNATURE__'] = $signature; // Signature is empty when ran from command line or taken from user in parameter)
+ $substitutionarray['__USER_SIGNATURE__'] = $signature; // Signature is empty when ran from command line or taken from user in parameter)
+ $substitutionarray['__SIGNATURE__'] = $signature; // For backward compatibility
$substitutionarray['__CHECK_READ__'] = '
';
$substitutionarray['__UNSUBSCRIBE__'] = ''.$langs->trans("MailUnsubcribe").'';