diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index 2fb9285379f..c57f1ac00da 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -51,19 +51,15 @@ $formcompany = new FormCompany($db); include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; if ($action == 'setcodeclient') { - if (dolibarr_set_const($db, "SOCIETE_CODECLIENT_ADDON", $value, 'chaine', 0, '', $conf->entity) > 0) { - header("Location: ".$_SERVER["PHP_SELF"]); - exit; - } else { + $result = dolibarr_set_const($db, "SOCIETE_CODECLIENT_ADDON", $value, 'chaine', 0, '', $conf->entity); + if ($result <= 0) { dol_print_error($db); } } if ($action == 'setcodecompta') { - if (dolibarr_set_const($db, "SOCIETE_CODECOMPTA_ADDON", $value, 'chaine', 0, '', $conf->entity) > 0) { - header("Location: ".$_SERVER["PHP_SELF"]); - exit; - } else { + $result = dolibarr_set_const($db, "SOCIETE_CODECOMPTA_ADDON", $value, 'chaine', 0, '', $conf->entity); + if ($result <= 0) { dol_print_error($db); } } @@ -273,10 +269,8 @@ if ($action == 'setprofid') { $status = GETPOST('status', 'alpha'); $idprof = "SOCIETE_".$value."_UNIQUE"; - if (dolibarr_set_const($db, $idprof, $status, 'chaine', 0, '', $conf->entity) > 0) { - //header("Location: ".$_SERVER["PHP_SELF"]); - //exit; - } else { + $result = dolibarr_set_const($db, $idprof, $status, 'chaine', 0, '', $conf->entity); + if ($result <= 0) { dol_print_error($db); } } @@ -286,10 +280,8 @@ if ($action == 'setprofidmandatory') { $status = GETPOST('status', 'alpha'); $idprof = "SOCIETE_".$value."_MANDATORY"; - if (dolibarr_set_const($db, $idprof, $status, 'chaine', 0, '', $conf->entity) > 0) { - //header("Location: ".$_SERVER["PHP_SELF"]); - //exit; - } else { + $result = dolibarr_set_const($db, $idprof, $status, 'chaine', 0, '', $conf->entity); + if ($result <= 0) { dol_print_error($db); } } @@ -299,10 +291,8 @@ if ($action == 'setprofidinvoicemandatory') { $status = GETPOST('status', 'alpha'); $idprof = "SOCIETE_".$value."_INVOICE_MANDATORY"; - if (dolibarr_set_const($db, $idprof, $status, 'chaine', 0, '', $conf->entity) > 0) { - //header("Location: ".$_SERVER["PHP_SELF"]); - //exit; - } else { + $result = dolibarr_set_const($db, $idprof, $status, 'chaine', 0, '', $conf->entity); + if ($result <= 0) { dol_print_error($db); } } @@ -311,10 +301,8 @@ if ($action == 'setprofidinvoicemandatory') { if ($action == 'sethideinactivethirdparty') { $status = GETPOST('status', 'alpha'); - if (dolibarr_set_const($db, "COMPANY_HIDE_INACTIVE_IN_COMBOBOX", $status, 'chaine', 0, '', $conf->entity) > 0) { - header("Location: ".$_SERVER["PHP_SELF"]); - exit; - } else { + $result = dolibarr_set_const($db, "COMPANY_HIDE_INACTIVE_IN_COMBOBOX", $status, 'chaine', 0, '', $conf->entity); + if ($result <= 0) { dol_print_error($db); } } @@ -331,6 +319,7 @@ if ($action == 'setonsearchandlistgooncustomerorsuppliercard') { } } + /* * View */ @@ -575,7 +564,7 @@ foreach ($dirsociete as $dirroot) { if ($modulequalified) { print '