diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index d9fdad79f49..e84adf9f4a6 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1458,12 +1458,8 @@ if ($action == 'create') if ($conf->use_javascript_ajax) { - print ''; + print ajax_combobox('fac_replacement'); + print ajax_combobox('fac_avoir'); } print '
'; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 36bd15dde47..6d5e5e73179 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -545,7 +545,6 @@ class Form if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE s.entity = ".$conf->entity; if ($filter) $sql.= " AND ".$filter; - //if (is_numeric($selected) && $conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT) $sql.= " AND s.rowid = ".$selected; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; $sql.= " ORDER BY nom ASC"; @@ -555,71 +554,41 @@ class Form { if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT && ! $forcecombo) { - /* - $minLength = (is_numeric($conf->global->COMPANY_USE_SEARCH_TO_SELECT)?$conf->global->COMPANY_USE_SEARCH_TO_SELECT:2); - - $socid = 0; - if ($selected) + //$minLength = (is_numeric($conf->global->COMPANY_USE_SEARCH_TO_SELECT)?$conf->global->COMPANY_USE_SEARCH_TO_SELECT:2); + + $out.= ajax_combobox($htmlname); + } + + $out.= ''; - } - else - { - $out.= ''; - } - $out.= ajax_autocompleter(($socid?$socid:-1),$htmlname,DOL_URL_ROOT.'/societe/ajaxcompanies.php?filter='.urlencode($filter), '', $minLength); - $out.= ''; - $out.= ''; - $out.= '';*/ - - $out.= ''; - } - //else - //{ - $out.= ''; - //} + } + $out.= ''; } else { diff --git a/htdocs/lib/ajax.lib.php b/htdocs/lib/ajax.lib.php index 132f5f8c7a6..5be8794e3bc 100644 --- a/htdocs/lib/ajax.lib.php +++ b/htdocs/lib/ajax.lib.php @@ -197,6 +197,22 @@ function ajax_dialog($title,$message,$w=350,$h=150) return $msg; } +/** + * Convert combox + */ +function ajax_combobox($htmlname) +{ + $msg.= ''; + + $msg.= "\n"; + + return $msg; +} + /** * * Enter description here ...