diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 13f49552dc0..44b90d0d79b 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -115,20 +115,6 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit') /** * Edition des paramètres */ - if ($conf->use_javascript) - { - print ' - - '; - } print '
'; print ''; @@ -155,7 +141,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit') $var=!$var; print ''.$langs->trans("Country").''; - $form->select_pays($conf->global->MAIN_INFO_SOCIETE_PAYS,'pays_id',($conf->use_javascript?' onChange="save_refresh()"':'')); + $form->select_pays($conf->global->MAIN_INFO_SOCIETE_PAYS,'pays_id',($conf->use_javascript?' onChange="company_save_refresh()"':'')); print ''; $var=!$var; diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index 0ce30b18155..613da1f37ba 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -327,15 +327,21 @@ class Form $pays_id = $obj->rowid?$obj->rowid:''; // On applique un delai d'execution pour le bon fonctionnement - $mode = substr($htmloption,-9,6); - if ($mode == 'create') + $mode_create = substr($htmloption,-9,6); + $mode_edit = substr($htmloption,-7,4); + $mode_company = substr($htmloption,-10,7); + if ($mode_create == 'create') { $htmloption = 'onChange="ac_delay(\'autofilltownfromzip_save_refresh_create()\',\'500\')"'; } - else + else if ($mode_edit == 'edit') { $htmloption = 'onChange="ac_delay(\'autofilltownfromzip_save_refresh_edit()\',\'500\')"'; } + else if ($mode_company == 'refresh') + { + $htmloption = 'onChange="ac_delay(\'company_save_refresh()\',\'500\')"'; + } print '
'; print ''; diff --git a/htdocs/lib/lib_head.js b/htdocs/lib/lib_head.js index c9296e110df..3a13eaa2874 100644 --- a/htdocs/lib/lib_head.js +++ b/htdocs/lib/lib_head.js @@ -35,6 +35,12 @@ function autofilltownfromzip_save_refresh_create() document.formsoc.submit(); } +function company_save_refresh() +{ + document.form_index.action.value="updateedit"; + document.form_index.submit(); +} + /*=================================================================