diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php
index 7dda6ded0e4..fc982db0bb7 100644
--- a/htdocs/admin/commande.php
+++ b/htdocs/admin/commande.php
@@ -66,7 +66,7 @@ if ($action == 'updateMask')
}
}
-if ($action == 'specimen')
+else if ($action == 'specimen')
{
$modele=GETPOST('module','alpha');
@@ -111,7 +111,8 @@ if ($action == 'specimen')
}
}
-if ($action == 'set')
+// Activate a model
+else if ($action == 'set')
{
$label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha');
@@ -128,7 +129,7 @@ if ($action == 'set')
}
}
-if ($action == 'del')
+else if ($action == 'del')
{
$type='order';
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
@@ -142,7 +143,8 @@ if ($action == 'del')
}
}
-if ($action == 'setdoc')
+// Set default model
+else if ($action == 'setdoc')
{
$label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha');
@@ -182,7 +184,7 @@ if ($action == 'setdoc')
}
}
-if ($action == 'setmod')
+else if ($action == 'setmod')
{
// TODO Verifier si module numerotation choisi peut etre active
// par appel methode canBeActivated
@@ -190,7 +192,7 @@ if ($action == 'setmod')
dolibarr_set_const($db, "COMMANDE_ADDON",$value,'chaine',0,'',$conf->entity);
}
-if ($action == 'set_COMMANDE_DRAFT_WATERMARK')
+else if ($action == 'set_COMMANDE_DRAFT_WATERMARK')
{
$draft = GETPOST("COMMANDE_DRAFT_WATERMARK");
$res = dolibarr_set_const($db, "COMMANDE_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
@@ -207,7 +209,7 @@ if ($action == 'set_COMMANDE_DRAFT_WATERMARK')
}
}
-if ($action == 'set_COMMANDE_FREE_TEXT')
+else if ($action == 'set_COMMANDE_FREE_TEXT')
{
$freetext = GETPOST("COMMANDE_FREE_TEXT"); // No alpha here, we want exact string
@@ -224,6 +226,14 @@ if ($action == 'set_COMMANDE_FREE_TEXT')
$mesg = "".$langs->trans("Error")."";
}
}
+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
+ // on passe donc par une variable pour avoir un affichage coherent
+ $conf->global->COMMANDE_ADDON_PDF_ODT_PATH = GETPOST('value1');
+ }
+}
/*
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 1d722cb938d..3270c2cf36d 100755
--- a/htdocs/core/modules/mailings/contacts2.modules.php
+++ b/htdocs/core/modules/mailings/contacts2.modules.php
@@ -1,5 +1,6 @@
+/* Copyright (C) 2011 François Cerbelle
+ * Copyright (C) 2013 Regis Houssin
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -87,7 +88,7 @@ class mailing_contacts2 extends MailingTargets
$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 ='".$filtersarray[0]."'";
+ 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);
if ($resql)
@@ -219,4 +220,4 @@ class mailing_contacts2 extends MailingTargets
}
-?>
\ No newline at end of file
+?>
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 18620fe09f7..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
@@ -927,3 +927,6 @@ 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 = __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';