From 15e976f06d1b36eb593dd1fafa5cb95861bf1eea Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 6 May 2007 19:46:18 +0000 Subject: [PATCH] =?UTF-8?q?Simplification=20de=20la=20recherche=20ajax=20p?= =?UTF-8?q?our=20la=20liste=20deroulante=20des=20produits/services=20Ajout?= =?UTF-8?q?=20d'un=20indicateur=20par=20d=E9faut=20lors=20du=20traitement?= =?UTF-8?q?=20ajax?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/html.form.class.php | 16 +++++++--------- .../includes/scriptaculous/dolibarr_changes.txt | 15 +++++++++++++++ htdocs/includes/scriptaculous/lib/prototype.js | 2 ++ htdocs/langs/en_US/main.lang | 1 + htdocs/langs/fr_FR/main.lang | 1 + htdocs/product/ajaxproducts.php | 4 ++-- htdocs/theme/auguria/img/ajaxworking.gif | Bin 0 -> 2483 bytes 7 files changed, 28 insertions(+), 11 deletions(-) create mode 100644 htdocs/includes/scriptaculous/dolibarr_changes.txt create mode 100644 htdocs/theme/auguria/img/ajaxworking.gif diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index 7bef029ef88..26cdf1ceee4 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -406,12 +406,12 @@ class Form { print ''; } - print ''; + print ''; print ''; print ''; print '
'; print ''; } else @@ -821,13 +821,12 @@ class Form global $langs,$conf,$user; if ($conf->global->PRODUIT_USE_SEARCH_TO_SELECT) { - print $langs->trans("Ref").':   '; - print $langs->trans("Label").':'; + print $langs->trans("RefOrLabel").' : '; + print ''; print ''; print ''; print '
'; } @@ -844,7 +843,7 @@ class Form \param filtretype Pour filtre sur type de produit \param limit Limite sur le nombre de lignes retournées */ - function select_produits_do($selected='',$htmlname='productid',$filtretype='',$limit=20,$price_level=0,$ajaxkeyref='',$ajaxkeylabel='') + function select_produits_do($selected='',$htmlname='productid',$filtretype='',$limit=20,$price_level=0,$ajaxkeysearch='') { global $langs,$conf,$user; $user->getrights("categorie"); @@ -867,8 +866,7 @@ class Form $sql.= ' AND IFNULL(c.visible,1)=1'; } if ($filtretype && $filtretype != '') $sql.=" AND p.fk_product_type=".$filtretype; - if ($ajaxkeyref && $ajaxkeyref != '') $sql.=" AND p.ref like '%".$ajaxkeyref."%'"; - if ($ajaxkeylabel && $ajaxkeylabel != '') $sql.=" AND p.label like '%".$ajaxkeylabel."%'"; + if ($ajaxkeysearch && $ajaxkeysearch != '') $sql.=" AND p.ref like '%".$ajaxkeysearch."%' OR p.label like '%".$ajaxkeysearch."%'"; $sql.= " ORDER BY p.nbvente DESC"; if ($limit) $sql.= " LIMIT $limit"; diff --git a/htdocs/includes/scriptaculous/dolibarr_changes.txt b/htdocs/includes/scriptaculous/dolibarr_changes.txt new file mode 100644 index 00000000000..77759e9cbd0 --- /dev/null +++ b/htdocs/includes/scriptaculous/dolibarr_changes.txt @@ -0,0 +1,15 @@ +If scriptaculous files are replaced by new version, following changes must be done: + +* Edit prototype.js to set: +*************************** + +Ajax.Responders.register({ + onCreate: function() { + $('indicator').show( ); + Ajax.activeRequestCount++; + }, + onComplete: function() { + $('indicator').hide( ); + Ajax.activeRequestCount--; + } +}); \ No newline at end of file diff --git a/htdocs/includes/scriptaculous/lib/prototype.js b/htdocs/includes/scriptaculous/lib/prototype.js index 0476b8fdccc..5ccac892133 100644 --- a/htdocs/includes/scriptaculous/lib/prototype.js +++ b/htdocs/includes/scriptaculous/lib/prototype.js @@ -793,9 +793,11 @@ Object.extend(Ajax.Responders, Enumerable); Ajax.Responders.register({ onCreate: function() { + $('indicator').show( ); Ajax.activeRequestCount++; }, onComplete: function() { + $('indicator').hide( ); Ajax.activeRequestCount--; } }); diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 6eb7268d95e..d1b646e9192 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -110,6 +110,7 @@ Note=Note CurrentNote=Current note Title=Title Label=Label +RefOrLabel=Ref. or label Info=Log Family=Family Description=Description diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index 9ac514b7ef5..36985f16ef8 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -111,6 +111,7 @@ Note=Note CurrentNote=Note actuelle Title=Titre Label=Libellé +RefOrLabel=Réf. ou libellé Info=Suivi Family=Famille Description=Description diff --git a/htdocs/product/ajaxproducts.php b/htdocs/product/ajaxproducts.php index fb3f9609758..aaedbef8c56 100644 --- a/htdocs/product/ajaxproducts.php +++ b/htdocs/product/ajaxproducts.php @@ -39,10 +39,10 @@ print "\n"; // Generation liste de produits -if(isset($_GET['keyref']) && !empty($_GET['keyref']) || isset($_GET['keylabel']) && !empty($_GET['keylabel'])) +if(isset($_GET['keysearch']) && !empty($_GET['keysearch'])) { $form = new Form($db); - $form->select_produits_do("",$_GET["htmlname"],"","",$_GET["price_level"],$_GET["keyref"],$_GET["keylabel"]); + $form->select_produits_do("",$_GET["htmlname"],"","",$_GET["price_level"],$_GET["keysearch"]); } print ""; diff --git a/htdocs/theme/auguria/img/ajaxworking.gif b/htdocs/theme/auguria/img/ajaxworking.gif new file mode 100644 index 0000000000000000000000000000000000000000..1e421c3113fbe4f3ddc96bb743cecc8530fd4c21 GIT binary patch literal 2483 zcmeH|@oyVv8ONXZeece1&S&?vbM3s$lyl~-*J8@i1mUio^x92YZ_6TgOKH&h!?{#d z3kbPTXg~tqa~zVewRml!B@m%YP}VMOB}dv1o4Oy)skT*xv4DgW2~`}UAec~b)d@1G zES%e4x@vy`+Iv5obUK|r&*%9*&+U0)cXoRz3Q_nEgSEA_8#iuTyLRo;rArG73)9on zV`F0{PMkP=`0&1c`+9nMy1KeLJ3C{s7{nkr!TYV-r{_}x{}%>QYvKOhfoFH+ioM&m zS_B0}r9PD85HQHJ3T%xD(B~n=ff)c2)iAr#G%!Ru5}H@G1zw|8%@lJUgfv=Qwi}g- zv}xn&OU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