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

Merge pull request #683 from FHenry/3.3

Fix [ bug #733 ]
parents c4948ea3 af6bb94f
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
{
$error=0;
$email_from='';
if (! empty($_POST["fromname"])) $email_from=$_POST["fromname"].' ';
if (! empty($_POST["frommail"])) $email_from.='<'.$_POST["frommail"].'>';
......@@ -153,6 +156,11 @@ if (($action == 'send' || $action == 'sendhtml') && ! GETPOST('addfile') && ! GE
$body = $_POST['message'];
$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
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
......
......@@ -179,6 +179,8 @@ class Mailing extends CommonObject
*/
function fetch($rowid)
{
global $conf;
$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.statut, m.nbemail";
......@@ -203,8 +205,14 @@ class Mailing extends CommonObject
$this->statut = $obj->statut;
$this->nbemail = $obj->nbemail;
$this->titre = $obj->titre;
$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->bgcolor = $obj->bgcolor;
$this->bgimage = $obj->bgimage;
......
......@@ -170,6 +170,9 @@ class DolEditor
//$skin='v2';
$skin='kama';
if ($this->toolbarname=='dolibarr_mailings') {$htmlencode_force='true';}
else {$htmlencode_force='false';}
$out.= '<script type="text/javascript">
$(document).ready(function () {
/* if (CKEDITOR.loadFullCore) CKEDITOR.loadFullCore(); */
......@@ -177,6 +180,7 @@ class DolEditor
CKEDITOR.replace(\''.$this->htmlname.'\',
{
customConfig : ckeditorConfig,
htmlEncodeOutput :'.$htmlencode_force.',
toolbar: \''.$this->toolbarname.'\',
toolbarStartupExpanded: '.($this->toolbarstartexpanded ? 'true' : 'false').',
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