diff --git a/ChangeLog b/ChangeLog
index 1f07b3dc1de..02fc78640df 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -52,6 +52,7 @@ For users:
- New: [ task #1218 ] Can drag and drop an event from calendar to change its day.
- New: Optimize size of image static resources.
- New: Add hourly and daily amount on user card. Add weekly working hours and salary on user card.
+- New: Content of predefined email come firstly from table llx_c_email_template, then translation key.
- Upgrade phpexcel lib to 1.7.8
- Fix: [ bug #1487 ] PAYMENT_DELETE trigger does not intercept trigger action
- Fix: [ bug #1470, #1472, #1473] User trigger problem
@@ -79,7 +80,6 @@ New experimental module:
Ari Elbaz
Florian Henry
Juanjo Menent
-
And to the contributors :
Jeff Info 2000 euros
Nord Anim 120 euros
@@ -95,25 +95,25 @@ For developers:
- New: Add a css style "cursorpointer".
- New: Select list of users can return user into hierarchy.
- New: getBrowserInfo can return type of layout of browser (classic/phone/tablet)
-- New: Add hook "searchAgendaFrom".
+- New: Add hook "searchAgendaFrom" and "beforePDFCreation".
- New: Add trigger DON_UPDATE, DON_DELETE
- New: Add country iso code on 3 chars into table of countries.
- Qual: Removed hard coded rowid into data init of table llx_c_action_trigger.
- LINEBILL_DELETE, LINK_DELETE, ORDER_SUPPLIER_DELETE, RESOURCE_DELETE trigger called before SQL delete
- New: [ Task #1481 ] Add trigger BILL_SUPPLIER_UPDATE.
- New: [ Task #1495 ] Add trigger LINECONTRACT_CREATE.
-- New: Added hook "formConfirm" and "doActions" for supplier invoice card
-- New: [ task #1511, #1426 ] Added hook "doActions" for supplier card and supplier order card
-- New: renamed table llx_c_pays to llx_c_country & libelle field to label
-- Qual: Renamed table llx_c_civilite into llx_c_civility
- field civilite into label in the same table
+- New: Added hook "formConfirm" and "doActions" for supplier invoice card.
+- New: [ task #1511, #1426 ] Added hook "doActions" for supplier card and supplier order card.
+- New: renamed table llx_c_pays to llx_c_country & libelle field to label.
+- Qual: Renamed table llx_c_civilite into llx_c_civility,
+ field civilite into label in the same table,
and field civilite into civility in other table
-WARNING: Following change may create regression for some external modules, but was necessary to make
+WARNING: Following changes may create regression for some external modules, but was necessary to make
Dolibarr better:
- Changed the way parameters are provided to scripts sync_xxx_ldap2dolibarr.php
-- Some field into database wwere renamed from "libelle" to "label".
+- Some field into database were renamed from "libelle" to "label".
- Table llx_c_pays were renamed into llx_c_country.
- Triggers *_BUILDDOC are removed. Building a doc is not a business event. For action after
creation of a pdf or odt, hook "afterPDFCreation" or "afterODTCreation" must be used instead.
diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php
index 261754801a9..13edeb168fa 100644
--- a/htdocs/core/class/html.formmail.class.php
+++ b/htdocs/core/class/html.formmail.class.php
@@ -250,6 +250,21 @@ class FormMail
if (! empty($_SESSION["listofnames"])) $listofnames=explode(';',$_SESSION["listofnames"]);
if (! empty($_SESSION["listofmimes"])) $listofmimes=explode(';',$_SESSION["listofmimes"]);
+ // Define output language
+ $outputlangs = $langs;
+ $newlang = '';
+ if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $this->param['langsmodels'];
+ if (! empty($newlang))
+ {
+ $outputlangs = new Translate("", $conf);
+ $outputlangs->setDefaultLang($newlang);
+ $outputlangs->load('other');
+ }
+
+ // Get message template
+ $arraydefaultmessage=$this->getEMailTemplate($this->db, $this->param["models"], $user, $outputlangs);
+
+
$out.= "\n\n";
if ($this->withform == 1)
{
@@ -439,7 +454,7 @@ class FormMail
}
$out.= "\n";
}
-
+
// CCC
if (! empty($this->withtoccc) || is_array($this->withtoccc))
{
@@ -492,19 +507,23 @@ class FormMail
// Topic
if (! empty($this->withtopic))
{
- $this->withtopic=make_substitutions($this->withtopic,$this->substit);
+ $defaulttopic="";
+ if (count($arraydefaultmessage) > 0 && $arraydefaultmessage['topic']) $defaulttopic=$arraydefaultmessage['topic'];
+ elseif (! is_numeric($this->withtopic)) $defaulttopic=$this->withtopic;
+
+ $defaulttopic=make_substitutions($defaulttopic,$this->substit);
$out.= '