Skip to content
Snippets Groups Projects
Commit 402fe2e4 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Merge remote-tracking branch 'origin/3.3' into develop

parents dacba745 18aff923
No related branches found
No related tags found
No related merge requests found
...@@ -141,6 +141,9 @@ if (($action == 'send' || $action == 'sendhtml') && ! GETPOST('addfile') && ! GE ...@@ -141,6 +141,9 @@ if (($action == 'send' || $action == 'sendhtml') && ! GETPOST('addfile') && ! GE
{ {
$error=0; $error=0;
$email_from=''; $email_from='';
if (! empty($_POST["fromname"])) $email_from=$_POST["fromname"].' '; if (! empty($_POST["fromname"])) $email_from=$_POST["fromname"].' ';
if (! empty($_POST["frommail"])) $email_from.='<'.$_POST["frommail"].'>'; if (! empty($_POST["frommail"])) $email_from.='<'.$_POST["frommail"].'>';
...@@ -153,6 +156,11 @@ if (($action == 'send' || $action == 'sendhtml') && ! GETPOST('addfile') && ! GE ...@@ -153,6 +156,11 @@ if (($action == 'send' || $action == 'sendhtml') && ! GETPOST('addfile') && ! GE
$body = $_POST['message']; $body = $_POST['message'];
$deliveryreceipt= $_POST["deliveryreceipt"]; $deliveryreceipt= $_POST["deliveryreceipt"];
//Check if we have to decode HTML
if (!empty($conf->global->FCKEDITOR_ENABLE_MAILING) && dol_textishtml(dol_html_entity_decode($body, ENT_COMPAT | ENT_HTML401))) {
$body=dol_html_entity_decode($body, ENT_COMPAT | ENT_HTML401);
}
// Create form object // Create form object
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db); $formmail = new FormMail($db);
......
...@@ -179,6 +179,8 @@ class Mailing extends CommonObject ...@@ -179,6 +179,8 @@ class Mailing extends CommonObject
*/ */
function fetch($rowid) function fetch($rowid)
{ {
global $conf;
$sql = "SELECT m.rowid, m.titre, m.sujet, m.body, m.bgcolor, m.bgimage"; $sql = "SELECT m.rowid, m.titre, m.sujet, m.body, m.bgcolor, m.bgimage";
$sql.= ", m.email_from, m.email_replyto, m.email_errorsto"; $sql.= ", m.email_from, m.email_replyto, m.email_errorsto";
$sql.= ", m.statut, m.nbemail"; $sql.= ", m.statut, m.nbemail";
...@@ -203,8 +205,14 @@ class Mailing extends CommonObject ...@@ -203,8 +205,14 @@ class Mailing extends CommonObject
$this->statut = $obj->statut; $this->statut = $obj->statut;
$this->nbemail = $obj->nbemail; $this->nbemail = $obj->nbemail;
$this->titre = $obj->titre; $this->titre = $obj->titre;
$this->sujet = $obj->sujet; $this->sujet = $obj->sujet;
if (!empty($conf->global->FCKEDITOR_ENABLE_MAILING) && dol_textishtml(dol_html_entity_decode($obj->body, ENT_COMPAT | ENT_HTML401))) {
$this->body = dol_html_entity_decode($obj->body, ENT_COMPAT | ENT_HTML401);
}else {
$this->body = $obj->body; $this->body = $obj->body;
}
$this->bgcolor = $obj->bgcolor; $this->bgcolor = $obj->bgcolor;
$this->bgimage = $obj->bgimage; $this->bgimage = $obj->bgimage;
......
...@@ -170,6 +170,9 @@ class DolEditor ...@@ -170,6 +170,9 @@ class DolEditor
//$skin='v2'; //$skin='v2';
$skin='kama'; $skin='kama';
if ($this->toolbarname=='dolibarr_mailings') {$htmlencode_force='true';}
else {$htmlencode_force='false';}
$out.= '<script type="text/javascript"> $out.= '<script type="text/javascript">
$(document).ready(function () { $(document).ready(function () {
/* if (CKEDITOR.loadFullCore) CKEDITOR.loadFullCore(); */ /* if (CKEDITOR.loadFullCore) CKEDITOR.loadFullCore(); */
...@@ -177,6 +180,7 @@ class DolEditor ...@@ -177,6 +180,7 @@ class DolEditor
CKEDITOR.replace(\''.$this->htmlname.'\', CKEDITOR.replace(\''.$this->htmlname.'\',
{ {
customConfig : ckeditorConfig, customConfig : ckeditorConfig,
htmlEncodeOutput :'.$htmlencode_force.',
toolbar: \''.$this->toolbarname.'\', toolbar: \''.$this->toolbarname.'\',
toolbarStartupExpanded: '.($this->toolbarstartexpanded ? 'true' : 'false').', toolbarStartupExpanded: '.($this->toolbarstartexpanded ? 'true' : 'false').',
width: '.($this->width ? '\''.$this->width.'\'' : '\'\'').', width: '.($this->width ? '\''.$this->width.'\'' : '\'\'').',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment