Skip to content
Snippets Groups Projects
Commit ba8d094e authored by Juanjo Menent's avatar Juanjo Menent
Browse files

Merge pull request #1152 from atm-maxime/develop

Better fix for email text / signature integration
parents 6d1a0213 229c2d89
No related branches found
No related tags found
No related merge requests found
......@@ -148,7 +148,7 @@ print "<br>\n";
// Cas des autres parametres COMPTA_*
$list=array('COMPTA_PRODUCT_BUY_ACCOUNT','COMPTA_PRODUCT_SOLD_ACCOUNT','COMPTA_SERVICE_BUY_ACCOUNT','COMPTA_SERVICE_SOLD_ACCOUNT',
'COMPTA_VAT_ACCOUNT','COMPTA_ACCOUNT_CUSTOMER','COMPTA_ACCOUNT_SUPPLIER'
'COMPTA_VAT_ACCOUNT','COMPTA_VAT_BUY_ACCOUNT','COMPTA_ACCOUNT_CUSTOMER','COMPTA_ACCOUNT_SUPPLIER'
);
/*$sql = "SELECT rowid, name, value, type, note";
......
......@@ -117,7 +117,7 @@ if ($result)
$num = $db->num_rows($result);
// les variables
$cptfour = (! empty($conf->global->COMPTA_ACCOUNT_SUPPLIER)?$conf->global->COMPTA_ACCOUNT_SUPPLIER:$langs->trans("CodeNotDef"));
$cpttva = (! empty($conf->global->COMPTA_VAT_ACCOUNT)?$conf->global->COMPTA_VAT_ACCOUNT:$langs->trans("CodeNotDef"));
$cpttva = (! empty($conf->global->COMPTA_VAT_BUY_ACCOUNT)?$conf->global->COMPTA_VAT_BUY_ACCOUNT:$langs->trans("CodeNotDef"));
$tabfac = array();
$tabht = array();
......
......@@ -576,7 +576,14 @@ class FormMail
}
$defaultmessage=str_replace('\n',"\n",$defaultmessage);
if($conf->global->FCKEDITOR_ENABLE_MAIL) $defaultmessage=nl2br($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__'])) {
$defaultmessage = dol_nl2br($defaultmessage);
}
$defaultmessage=make_substitutions($defaultmessage,$this->substit);
if (isset($_POST["message"])) $defaultmessage=$_POST["message"];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment