diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index 26cdf1ceee4..c6927f5ab3c 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -406,13 +406,9 @@ class Form { print ''; } - print ''; - print ''; - print ''; - print '
'; - print ''; + + print ajax_autocompleter($pays_id,'pays','/societe/ajaxcountries.php','ajaxworking'); + } else { @@ -821,14 +817,8 @@ class Form global $langs,$conf,$user; if ($conf->global->PRODUIT_USE_SEARCH_TO_SELECT) { - print $langs->trans("RefOrLabel").' : '; - print ''; - print ''; - print ''; - print ''; + print $langs->trans("RefOrLabel").' : '; + print ajax_updater($htmlname,'keysearch','/product/ajaxproducts.php','&price_level='.$price_level.'','ajaxworking'); } else { diff --git a/htdocs/includes/scriptaculous/dolibarr_changes.txt b/htdocs/includes/scriptaculous/dolibarr_changes.txt deleted file mode 100644 index 77759e9cbd0..00000000000 --- a/htdocs/includes/scriptaculous/dolibarr_changes.txt +++ /dev/null @@ -1,15 +0,0 @@ -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 5ccac892133..0476b8fdccc 100644 --- a/htdocs/includes/scriptaculous/lib/prototype.js +++ b/htdocs/includes/scriptaculous/lib/prototype.js @@ -793,11 +793,9 @@ Object.extend(Ajax.Responders, Enumerable); Ajax.Responders.register({ onCreate: function() { - $('indicator').show( ); Ajax.activeRequestCount++; }, onComplete: function() { - $('indicator').hide( ); Ajax.activeRequestCount--; } }); diff --git a/htdocs/lib/functions.inc.php b/htdocs/lib/functions.inc.php index 0254d402297..6a782d1e82b 100644 --- a/htdocs/lib/functions.inc.php +++ b/htdocs/lib/functions.inc.php @@ -2598,5 +2598,66 @@ function num_open_day($timestampStart, $timestampEnd,$inhour=0,$lastday=0) return $nbOpenDay; } +/** + \brief Récupère la valeur d'un champ, effectue un traitement Ajax et affiche le résultat + \param htmlname nom et id du champ + \param keysearch nom et id complémentaire du champ de collecte + \param url chemin du fichier de réponse : /chemin/fichier.php + \param option champ supplémentaire de recherche dans les paramètres + \param indicator nom de l'image gif + \return script script complet +*/ +function ajax_updater($htmlname,$keysearch,$url,$option='',$indicator='ajaxworking') +{ + $script = ''; + $script.= ''; + $script.= ''; + $script.= ''; + + return $script; +} + +/** + \brief Récupère la valeur d'un champ, effectue un traitement Ajax et affiche le résultat + \param htmlname nom et id du champ + \param url chemin du fichier de réponse : /chemin/fichier.php + \param indicator nom de l'image gif + \return script script complet +*/ +function ajax_autocompleter($selected='',$htmlname,$url,$indicator='ajaxworking') +{ + $script.= ''; + $script.= ''; + $script.= ''; + $script.= ''; + $script.= ''; + + return $script; +} ?> diff --git a/htdocs/soc.php b/htdocs/soc.php index 62e52c27b47..e51ca29dd2f 100644 --- a/htdocs/soc.php +++ b/htdocs/soc.php @@ -426,7 +426,6 @@ if ($_POST["getcustomercode"] || $_POST["getsuppliercode"] || print '