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 '
'; +print ''; +print ''; + print ''; print ''; print "\n"; @@ -706,9 +714,6 @@ print ''."\n"; // Utilisation formulaire Ajax sur choix societe $var=!$var; -print ''; -print ''; -print ''; print ""; print ''; if (! $conf->use_javascript_ajax) @@ -727,35 +732,13 @@ else ); print $form->selectarray("activate_COMPANY_USE_SEARCH_TO_SELECT",$arrval,$conf->global->COMPANY_USE_SEARCH_TO_SELECT); print '"; } print ''; -print ''; $var=!$var; print ""; -print ''; -if (!empty($conf->global->SOCIETE_ADD_REF_IN_LIST)) -{ - print ''; -} -else -{ - print ''; -} -print ''; - - -$var=!$var; -print ''; -print ''; -print ''; -print ""; print ''; if (! $conf->use_javascript_ajax) { @@ -773,11 +756,30 @@ else ); print $form->selectarray("activate_CONTACT_USE_SEARCH_TO_SELECT",$arrval,$conf->global->CONTACT_USE_SEARCH_TO_SELECT); print '"; } print ''; + +$var=!$var; +print ""; +print ''; +if (!empty($conf->global->SOCIETE_ADD_REF_IN_LIST)) +{ + print ''; +} +else +{ + print ''; +} +print ''; + + /* // COMPANY_USE_SEARCH_TO_SELECT $var=!$var; @@ -800,6 +802,7 @@ print ''; print '
".$langs->trans("Parameters")." 
'.$langs->trans("UseSearchToSelectCompany").''; - print ''; + print ''; print "
'.$langs->trans("AddRefInList").''; - print img_picto($langs->trans("Activated"),'switch_on'); - print ''; - print img_picto($langs->trans("Disabled"),'switch_off'); - print '
'.$langs->trans("UseSearchToSelectContact").''; - print ''; + print ''; print "
'.$langs->trans("AddRefInList").''; + print img_picto($langs->trans("Activated"),'switch_on'); + print ''; + print img_picto($langs->trans("Disabled"),'switch_off'); + print '
'; +print ''; dol_fiche_end();