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

This commit is contained in:
Laurent Destailleur 2023-12-17 22:53:22 +01:00
commit 6c873e66da

View file

@ -75,8 +75,13 @@ if ($reshook < 0) {
if (($action == 'update' && !GETPOST("cancel", 'alpha'))
|| ($action == 'updateedit')) {
$tmparray = getCountry(GETPOST('country_id', 'int'), 'all', $db, $langs, 0);
$tmparray = getCountry(GETPOSTINT('country_id'), 'all', $db, $langs, 0);
if (!empty($tmparray['id'])) {
if ($tmparray['code'] == 'FR' && $tmparray['id'] != $mysoc->country_id) {
// For FR, default value of option to show profid SIREN is on by default
$res = dolibarr_set_const($db, "MAIN_PROFID1_IN_ADDRESS", 1, 'chaine', 0, '', $conf->entity);
}
$mysoc->country_id = $tmparray['id'];
$mysoc->country_code = $tmparray['code'];
$mysoc->country_label = $tmparray['label'];
@ -84,11 +89,6 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha'))
$s = $mysoc->country_id.':'.$mysoc->country_code.':'.$mysoc->country_label;
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_COUNTRY", $s, 'chaine', 0, '', $conf->entity);
if($mysoc->country_code == 'FR' && !isset($conf->global->MAIN_PROFID1_IN_ADDRESS)){
// For FR, default value of option to show profid SIREN is on by default
$res = dolibarr_set_const($db, "MAIN_PROFID1_IN_ADDRESS", 1, 'chaine', 0, '', $conf->entity);
}
activateModulesRequiredByCountry($mysoc->country_code);
}