From 98aaec18a72e96ee98cb6bda909c7f84e8ca1202 Mon Sep 17 00:00:00 2001 From: fhenry Date: Mon, 8 Apr 2013 18:08:38 +0200 Subject: [PATCH 1/3] Fix [ bug #810 ] Cannot update ODT template path --- htdocs/admin/commande.php | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) 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'); + } +} /* From 8118332dfb0419b68e07f93bd3330d3f9649a143 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 10 Apr 2013 13:00:05 +0200 Subject: [PATCH 2/3] Fix: security Conflicts: htdocs/core/modules/mailings/contacts2.modules.php --- htdocs/core/modules/mailings/contacts2.modules.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 +?> From 38e30836a5972bea3621cb080801ef94c76f4dc3 Mon Sep 17 00:00:00 2001 From: fhenry Date: Wed, 10 Apr 2013 15:08:03 +0200 Subject: [PATCH 3/3] Fix bug with multicompany (SYSLOG_FILE on wrong entity) --- htdocs/admin/syslog.php | 4 ++-- htdocs/install/mysql/migration/3.2.0-3.3.0.sql | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) 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/install/mysql/migration/3.2.0-3.3.0.sql b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql index b756659d987..76f48ed7d61 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='PRODUIT_MULTI_PRICES' where name='PRODUIT_MUTLI_PRICES'; + +DELETE FROM llx_const WHERE entity<>0 AND name IN ('SYSLOG_HANDLERS','SYSLOG_LEVEL'); +UPDATE llx_const SET entity=0 WHERE name = 'SYSLOG_FILE';