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

This commit is contained in:
Laurent Destailleur 2013-02-26 20:05:23 +01:00
commit 402fe2e417
3 changed files with 23 additions and 3 deletions

View File

@ -140,6 +140,9 @@ if (($action == 'send' || $action == 'sendhtml') && GETPOST('cancel'))
if (($action == 'send' || $action == 'sendhtml') && ! GETPOST('addfile') && ! GETPOST('addfilehtml') && ! GETPOST('removedfile') && ! GETPOST('cancel')) if (($action == 'send' || $action == 'sendhtml') && ! GETPOST('addfile') && ! GETPOST('addfilehtml') && ! GETPOST('removedfile') && ! GETPOST('cancel'))
{ {
$error=0; $error=0;
$email_from=''; $email_from='';
if (! empty($_POST["fromname"])) $email_from=$_POST["fromname"].' '; if (! empty($_POST["fromname"])) $email_from=$_POST["fromname"].' ';
@ -152,7 +155,12 @@ if (($action == 'send' || $action == 'sendhtml') && ! GETPOST('addfile') && ! GE
$subject = $_POST['subject']; $subject = $_POST['subject'];
$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);

View File

@ -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
$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->body = $obj->body; $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->bgcolor = $obj->bgcolor;
$this->bgimage = $obj->bgimage; $this->bgimage = $obj->bgimage;

View File

@ -169,6 +169,9 @@ class DolEditor
//$skin='office2003'; //$skin='office2003';
//$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 () {
@ -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.'\'' : '\'\'').',