Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0

This commit is contained in:
Laurent Destailleur 2019-06-12 10:06:43 +02:00
commit 1b6b471cb7

View File

@ -49,15 +49,14 @@ $action = GETPOST('action', 'alpha');
if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg)) if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg))
{ {
$code=$reg[1]; $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) if (dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity) > 0)
{ {
header("Location: ".$_SERVER["PHP_SELF"]); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
exit;
} }
else 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]; $code=$reg[1];
if (dolibarr_del_const($db, $code, 0) > 0) if (dolibarr_del_const($db, $code, 0) > 0)
{ {
header("Location: ".$_SERVER["PHP_SELF"]); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
exit;
} }
else else
{ {
dol_print_error($db); setEventMessages($langs->trans("Error"), null, 'errors');
} }
} }