From c222f45bef7b091a26abc00e087c01d628081637 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 11 Oct 2010 10:28:08 +0000 Subject: [PATCH] Qual: used jquery by default --- htdocs/core/class/html.form.class.php | 49 +++++---------------------- htdocs/lib/ajax.lib.php | 31 ----------------- htdocs/product/ajaxproducts.php | 4 +-- 3 files changed, 10 insertions(+), 74 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index ceab58708f0..4f64b689aea 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -859,32 +859,10 @@ class Form if ($conf->global->PRODUIT_USE_SEARCH_TO_SELECT) { - if ($conf->global->MAIN_USE_NEW_JQUERY) - { - // mode=1 means customers products - print ajax_autocompleter('',$htmlname,DOL_URL_ROOT.'/product/ajaxproducts.php','outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished,''); - - print '
'; - print ''; - print ''; - print '
'; - } - else - { - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print '
'; - print $langs->trans("RefOrLabel").':'; - print ajax_indicator($htmlname,'working'); // Indicator is here - print '
'; - print ajax_updater($htmlname,'keysearch',DOL_URL_ROOT.'/product/ajaxproducts.php','&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished,''); // Indicator is '' to disable it as it is alreay output - print '
'; - } + // mode=1 means customers products + print ajax_autocompleter('',$htmlname,DOL_URL_ROOT.'/product/ajaxproducts.php','outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished,''); + print $langs->trans("RefOrLabel").' : '; + print '
'; } else { @@ -1144,21 +1122,10 @@ class Form global $langs,$conf; if ($conf->global->PRODUIT_USE_SEARCH_TO_SELECT) { - if ($conf->global->MAIN_USE_NEW_JQUERY) - { - // mode=2 means suppliers products - print ajax_autocompleter('',$htmlname,DOL_URL_ROOT.'/product/ajaxproducts.php','outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished,''); - - print '
'; - print ''; - print ''; - print '
'; - } - else - { - print $langs->trans("RefOrLabel").' : '; - print ajax_updater($htmlname,'keysearch',DOL_URL_ROOT.'/product/ajaxproducts.php','&socid='.$socid.'&type='.$filtertype.'&mode=2','working'); - } + // mode=2 means suppliers products + print ajax_autocompleter('',$htmlname,DOL_URL_ROOT.'/product/ajaxproducts.php','outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished,''); + print $langs->trans("RefOrLabel").' : '; + print '
'; } else { diff --git a/htdocs/lib/ajax.lib.php b/htdocs/lib/ajax.lib.php index a40e9129094..83ce3292704 100644 --- a/htdocs/lib/ajax.lib.php +++ b/htdocs/lib/ajax.lib.php @@ -119,37 +119,6 @@ function ajax_autocompleter($selected='',$htmlname,$url,$option='') return $script; } -/** - * \brief Get value of field, do Ajax process and return result. Use jQuery. - * \param selected Preselected value - * \param htmlname Name of html field - * \param url Path of source file to get values: /path/ajaxpage.php - * \param option Not used - * \return string script complet - */ -function ajax_autocompleter2($selected='', $htmlname, $url, $option='') -{ - $script = ''; - - $script.= ''; - - return $script; -} - /** * Show an ajax dialog * @param title Title of dialog box diff --git a/htdocs/product/ajaxproducts.php b/htdocs/product/ajaxproducts.php index b7f49f63f78..7fb80d54a2a 100644 --- a/htdocs/product/ajaxproducts.php +++ b/htdocs/product/ajaxproducts.php @@ -56,10 +56,10 @@ top_httphead(); dol_syslog(join(',',$_POST)); -if (! isset($_GET['keysearch']) && ! isset($_GET['idprod']) && ! isset($_GET['idprodfournprice'])) return; +if (! isset($_GET['idprod']) && ! isset($_GET['idprodfournprice'])) return; // When used from jQuery, the search term is added as GET param "term". -$searchkey=isset($_GET['keysearch'])?$_GET['keysearch']:($_GET['idprod']?$_GET['idprod']:$_GET['idprodfournprice']); +$searchkey=$_GET['idprod']?$_GET['idprod']:$_GET['idprodfournprice']; $outjson=isset($_GET['outjson'])?$_GET['outjson']:0; // Get list of product.