diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php
index fc982db0bb7..bb82c0d9ee1 100644
--- a/htdocs/admin/commande.php
+++ b/htdocs/admin/commande.php
@@ -226,7 +226,7 @@ else if ($action == 'set_COMMANDE_FREE_TEXT')
$mesg = "".$langs->trans("Error")."";
}
}
-else if ($action='setModuleOptions') {
+else if ($action=='setModuleOptions') {
if (dolibarr_set_const($db, "COMMANDE_ADDON_PDF_ODT_PATH",GETPOST('value1'),'chaine',0,'',$conf->entity))
{
// La constante qui a ete lue en avant du nouveau set
diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php
index 04f429f50bb..46da115c360 100644
--- a/htdocs/admin/propal.php
+++ b/htdocs/admin/propal.php
@@ -162,6 +162,36 @@ if ($action == 'setdefaultduration')
}
}
+// Define constants for submodules that contains parameters (forms with param1, param2, ... and value1, value2, ...)
+if ($action == 'setModuleOptions')
+{
+ $post_size=count($_POST);
+
+ $db->begin();
+
+ for($i=0;$i < $post_size;$i++)
+ {
+ if (array_key_exists('param'.$i,$_POST))
+ {
+ $param=GETPOST("param".$i,'alpha');
+ $value=GETPOST("value".$i,'alpha');
+ if ($param) $res = dolibarr_set_const($db,$param,$value,'chaine',0,'',$conf->entity);
+ if (! $res > 0) $error++;
+ }
+ }
+ if (! $error)
+ {
+ $db->commit();
+ $mesg = "".$langs->trans("SetupSaved")."";
+ }
+ else
+ {
+ $db->rollback();
+ $mesg = "".$langs->trans("Error")."";
+ }
+}
+
+
/*if ($action == 'setusecustomercontactasrecipient')
{
dolibarr_set_const($db, "PROPALE_USE_CUSTOMER_CONTACT_AS_RECIPIENT",$_POST["value"],'chaine',0,'',$conf->entity);
diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php
index 5bb0e85de84..075f975adb2 100644
--- a/htdocs/admin/syslog.php
+++ b/htdocs/admin/syslog.php
@@ -98,14 +98,14 @@ if ($action == 'set')
if ($_POST[$option['constant']])
{
dolibarr_del_const($db, $option['constant'], 0);
- dolibarr_set_const($db, $option['constant'], $_POST[$option['constant']], 'chaine');
+ dolibarr_set_const($db, $option['constant'], $_POST[$option['constant']], 'chaine',0, '', 0);
}
}
}
}
}
- dolibarr_set_const($db, 'SYSLOG_HANDLERS', json_encode($activeModules), 'chaine');
+ dolibarr_set_const($db, 'SYSLOG_HANDLERS', json_encode($activeModules), 'chaine',0,'',0);
if (! $error)
{
diff --git a/htdocs/core/modules/mailings/contacts2.modules.php b/htdocs/core/modules/mailings/contacts2.modules.php
index 3270c2cf36d..0096b855fe0 100755
--- a/htdocs/core/modules/mailings/contacts2.modules.php
+++ b/htdocs/core/modules/mailings/contacts2.modules.php
@@ -81,13 +81,12 @@ class mailing_contacts2 extends MailingTargets
$sql = "SELECT sp.rowid as id, sp.email as email, sp.rowid as fk_contact,";
$sql.= " sp.name as name, sp.firstname as firstname, sp.civilite,";
$sql.= " s.nom as companyname";
- $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp,";
- $sql.= " ".MAIN_DB_PREFIX."societe as s";
- $sql.= " WHERE s.rowid = sp.fk_soc";
+ $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp";
+ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = sp.fk_soc";
+ $sql.= " WHERE sp.entity IN (".getEntity('societe', 1).")";
$sql.= " AND sp.email != ''"; // Note that null != '' is false
$sql.= " AND sp.no_email = 0";
//$sql.= " AND sp.poste != ''";
- $sql.= " AND sp.entity IN (".getEntity('societe', 1).")";
if ($filtersarray[0]<>'all') $sql.= " AND sp.poste ='".$this->db->escape($filtersarray[0])."'";
$sql.= " ORDER BY sp.name, sp.firstname";
$resql = $this->db->query($sql);
@@ -163,10 +162,9 @@ class mailing_contacts2 extends MailingTargets
// Number with a filter are show in the combo list for each filter.
// If we want a filter "a position is defined", we must add it into formFilter
$sql = "SELECT count(distinct(sp.email)) as nb";
- $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp,";
- $sql.= " ".MAIN_DB_PREFIX."societe as s";
- $sql.= " WHERE s.rowid = sp.fk_soc";
- $sql.= " AND sp.entity IN (".getEntity('societe', 1).")";
+ $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp";
+ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = sp.fk_soc";
+ $sql.= " WHERE sp.entity IN (".getEntity('societe', 1).")";
$sql.= " AND sp.email != ''"; // Note that null != '' is false
$sql.= " AND sp.no_email = 0";
//$sql.= " AND sp.poste != ''";
@@ -188,10 +186,9 @@ class mailing_contacts2 extends MailingTargets
$langs->load("companies");
$sql = "SELECT sp.poste, count(distinct(sp.email)) AS nb";
- $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp,";
- $sql.= " ".MAIN_DB_PREFIX."societe as s";
- $sql.= " WHERE s.rowid = sp.fk_soc";
- $sql.= " AND sp.entity IN (".getEntity('societe', 1).")";
+ $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp";
+ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = sp.fk_soc";
+ $sql.= " WHERE sp.entity IN (".getEntity('societe', 1).")";
$sql.= " AND sp.email != ''"; // Note that null != '' is false
$sql.= " AND sp.no_email = 0";
$sql.= " AND (sp.poste IS NOT NULL AND sp.poste != '')";
diff --git a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql
index b756659d987..eaf395a6204 100755
--- a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql
+++ b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql
@@ -89,7 +89,7 @@ ALTER TABLE llx_commande CHANGE COLUMN fk_demand_reason fk_input_reason integer
ALTER TABLE llx_propal CHANGE COLUMN fk_demand_reason fk_input_reason integer NULL DEFAULT NULL;
ALTER TABLE llx_commande_fournisseur CHANGE COLUMN fk_methode_commande fk_input_method integer NULL DEFAULT 0;
-INSERT INTO llx_const (name, value, type, note, visible) values ('PRODUCT_CODEPRODUCT_ADDON','mod_codeproduct_leopard','yesno','Module to control product codes',0);
+INSERT INTO llx_const (name, value, type, note, visible) values (__ENCRYPT('PRODUCT_CODEPRODUCT_ADDON')__, __ENCRYPT('mod_codeproduct_leopard')__, 'yesno', 'Module to control product codes', 0);
ALTER TABLE llx_c_barcode_type ADD UNIQUE INDEX uk_c_barcode_type(code, entity);
@@ -926,4 +926,7 @@ UPDATE llx_c_departements SET ncc='ALAVA', nom='Álava' WHERE code_departement='
ALTER TABLE llx_product_fournisseur_price DROP FOREIGN KEY fk_product_fournisseur;
-UPDATE llx_const set name='PRODUIT_MULTI_PRICES' where name='PRODUIT_MUTLI_PRICES';
+UPDATE llx_const SET name = __ENCRYPT('PRODUIT_MULTI_PRICES')__ WHERE __DECRYPT('name')__ = 'PRODUIT_MUTLI_PRICES';
+
+DELETE FROM llx_const WHERE entity <> 0 AND __DECRYPT('name')__ IN ('SYSLOG_HANDLERS','SYSLOG_LEVEL');
+UPDATE llx_const SET entity = 0 WHERE __DECRYPT('name')__ = 'SYSLOG_FILE';