From 180fb2c91a66a4cf3b9f901be827fefa55be576f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Jan 2013 15:22:07 +0100 Subject: [PATCH] Fix: Option COMPANY_USE_SEARCH_TO_SELECT was not working for third party selection when autocomplete is on. --- htdocs/core/class/html.form.class.php | 17 +++++++++++++++-- htdocs/core/js/lib_head.js | 8 +++++++- htdocs/core/lib/ajax.lib.php | 3 ++- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index e71a0f6eafe..f31cb0f741e 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -688,8 +688,21 @@ 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); - - $out.= ajax_combobox($htmlname, $event); + $out.= ajax_combobox($htmlname, $event, $conf->global->COMPANY_USE_SEARCH_TO_SELECT); + /* + if ($selected && empty($selected_input_value)) + { + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; + $product = new Product($this->db); + $product->fetch($selected); + $selected_input_value=$product->ref; + } + // mode=1 means customers products + $ajaxoptions=array(); + $urloption='htmlname='.$htmlname.'&outjson=1&filter='.urlencode($filter).'&showtype='.$showtype; + $out.=ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); + $out.=''; + */ } $out.= '