From 5d94b0c5768607928d567b5e55591d1d0f3d291c Mon Sep 17 00:00:00 2001 From: fhenry Date: Wed, 10 Apr 2013 16:34:06 +0200 Subject: [PATCH] Fix bug : change path of ODT template for commande and propal module --- htdocs/admin/commande.php | 2 +- htdocs/admin/propal.php | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) 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);