From 9c7c1ddceb31d8878482c16e6e57a89f67008665 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Thu, 6 Jun 2019 11:20:10 +0200 Subject: [PATCH] Fix multicurrency setup page --- htdocs/admin/multicurrency.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/htdocs/admin/multicurrency.php b/htdocs/admin/multicurrency.php index 54ba9e6b1ce..b8479735d18 100644 --- a/htdocs/admin/multicurrency.php +++ b/htdocs/admin/multicurrency.php @@ -49,15 +49,14 @@ $action = GETPOST('action', 'alpha'); if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg)) { $code=$reg[1]; - $value=(GETPOST($code, 'alpha') ? GETPOST($code, 'alpha') : 1); + $value=GETPOST($code, 'alpha'); if (dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity) > 0) { - header("Location: ".$_SERVER["PHP_SELF"]); - exit; + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - dol_print_error($db); + setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -66,12 +65,11 @@ if (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg)) $code=$reg[1]; if (dolibarr_del_const($db, $code, 0) > 0) { - header("Location: ".$_SERVER["PHP_SELF"]); - exit; + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { - dol_print_error($db); + setEventMessages($langs->trans("Error"), null, 'errors'); } }