';
// wysiwyg editor
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
- $doleditor = new DolEditor('bodyemail', GETPOST('bodyemail', 'restricthtml'), '', 600, 'dolibarr_mailings', '', true, true, $conf->global->FCKEDITOR_ENABLE_MAILING, 20, '90%');
+ $doleditor = new DolEditor('bodyemail', GETPOST('bodyemail', 'restricthtmlallowunvalid'), '', 600, 'dolibarr_mailings', '', true, true, $conf->global->FCKEDITOR_ENABLE_MAILING, 20, '90%');
$doleditor->Create();
print '
';
diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php
index 04d2f7c17d8..d281fcb1a3a 100644
--- a/htdocs/comm/mailing/class/mailing.class.php
+++ b/htdocs/comm/mailing/class/mailing.class.php
@@ -208,6 +208,12 @@ class Mailing extends CommonObject
{
global $conf, $langs;
+ // Check properties
+ if ($this->body === 'InvalidHTMLString') {
+ $this->error = 'InvalidHTMLString';
+ return -1;
+ }
+
$this->db->begin();
$this->title = trim($this->title);
@@ -257,6 +263,12 @@ class Mailing extends CommonObject
*/
public function update($user)
{
+ // Check properties
+ if ($this->body === 'InvalidHTMLString') {
+ $this->error = 'InvalidHTMLString';
+ return -1;
+ }
+
$sql = "UPDATE ".MAIN_DB_PREFIX."mailing ";
$sql .= " SET titre = '".$this->db->escape($this->title)."'";
$sql .= ", sujet = '".$this->db->escape($this->sujet)."'";
diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index 8b5f757ad0e..3c0d8dd9a28 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -843,16 +843,16 @@ if (empty($reshook)) {
}
}
- if ($prod_entry_mode == 'free' && empty($idprod) && GETPOST('type') < 0) {
+ if ($prod_entry_mode == 'free' && (empty($idprod) || $idprod < 0) && GETPOST('type') < 0) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors');
$error++;
}
- if ($prod_entry_mode == 'free' && empty($idprod) && $price_ht === '' && $price_ht_devise === '') { // Unit price can be 0 but not ''. Also price can be negative for proposal.
+ if ($prod_entry_mode == 'free' && (empty($idprod) || $idprod < 0) && $price_ht === '' && $price_ht_devise === '') { // Unit price can be 0 but not ''. Also price can be negative for proposal.
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors');
$error++;
}
- if ($prod_entry_mode == 'free' && empty($idprod) && empty($product_desc)) {
+ if ($prod_entry_mode == 'free' && (empty($idprod) || $idprod < 0) && empty($product_desc)) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Description")), null, 'errors');
$error++;
}
@@ -871,7 +871,7 @@ if (empty($reshook)) {
}
}
- if (!$error && ($qty >= 0) && (!empty($product_desc) || !empty($idprod))) {
+ if (!$error && ($qty >= 0) && (!empty($product_desc) || (!empty($idprod) && $idprod > 0))) {
$pu_ht = 0;
$pu_ttc = 0;
$price_min = 0;
@@ -885,7 +885,7 @@ if (empty($reshook)) {
// Ecrase $desc par celui du produit
// Ecrase $tva_tx par celui du produit
// Replaces $fk_unit with the product unit
- if (!empty($idprod)) {
+ if (!empty($idprod) && $idprod > 0) {
$prod = new Product($db);
$prod->fetch($idprod);
@@ -2450,10 +2450,11 @@ if ($action == 'create') {
// Show object lines
$result = $object->getLinesArray();
- print '