diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index 98f8e79fd1c..9834959273c 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -68,33 +68,36 @@ if ($action == 'setcodecompta') } } -if ($action == 'COMPANY_USE_SEARCH_TO_SELECT') +if ($action == 'updateoptions') { - $companysearch = GETPOST('activate_COMPANY_USE_SEARCH_TO_SELECT','alpha'); - $res = dolibarr_set_const($db, "COMPANY_USE_SEARCH_TO_SELECT", $companysearch,'chaine',0,'',$conf->entity); - if (! $res > 0) $error++; - if (! $error) - { - $mesg = "".$langs->trans("SetupSaved").""; - } - else - { - $mesg = "".$langs->trans("Error").""; - } -} - -if ($action == 'CONTACT_USE_SEARCH_TO_SELECT') -{ - $contactsearch = GETPOST('activate_CONTACT_USE_SEARCH_TO_SELECT','alpha'); - $res = dolibarr_set_const($db, "CONTACT_USE_SEARCH_TO_SELECT", $contactsearch,'chaine',0,'',$conf->entity); - if (! $res > 0) $error++; - if (! $error) + if (GETPOST('COMPANY_USE_SEARCH_TO_SELECT')) { - $mesg = "".$langs->trans("SetupSaved").""; + $companysearch = GETPOST('activate_COMPANY_USE_SEARCH_TO_SELECT','alpha'); + $res = dolibarr_set_const($db, "COMPANY_USE_SEARCH_TO_SELECT", $companysearch,'chaine',0,'',$conf->entity); + if (! $res > 0) $error++; + if (! $error) + { + $mesg = "".$langs->trans("SetupSaved").""; + } + else + { + $mesg = "".$langs->trans("Error").""; + } } - else + + if (GETPOST('CONTACT_USE_SEARCH_TO_SELECT')) { - $mesg = "".$langs->trans("Error").""; + $contactsearch = GETPOST('activate_CONTACT_USE_SEARCH_TO_SELECT','alpha'); + $res = dolibarr_set_const($db, "CONTACT_USE_SEARCH_TO_SELECT", $contactsearch,'chaine',0,'',$conf->entity); + if (! $res > 0) $error++; + if (! $error) + { + $mesg = "".$langs->trans("SetupSaved").""; + } + else + { + $mesg = "".$langs->trans("Error").""; + } } } @@ -698,6 +701,11 @@ print_titre($langs->trans("Other")); // Autres options $form=new Form($db); $var=true; + +print '
'; dol_fiche_end();