From c96915b3ce6d6bb371c386fbad28a33b394d7491 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 31 Oct 2010 20:09:50 +0000 Subject: [PATCH] Fix: Pb with autocompletefor records with no country and state --- htdocs/core/class/html.formcompany.class.php | 30 ++++++++--------- htdocs/lib/ajax.lib.php | 35 +++++++++++++++----- htdocs/public/paybox/paymentko.php | 2 ++ htdocs/public/paybox/paymentok.php | 2 ++ htdocs/public/paypal/expresscheckout.php | 6 ++-- htdocs/public/paypal/newpayment.php | 8 +++++ htdocs/public/paypal/paymentko.php | 2 ++ htdocs/public/paypal/paymentok.php | 2 ++ 8 files changed, 61 insertions(+), 26 deletions(-) diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index 307f39b0be9..6f83620fcf2 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -174,7 +174,7 @@ class FormCompany print ''; print ''; } - + /** * \brief Retourne la liste deroulante des departements/province/cantons tout pays confondu ou pour un pays donne. * \remarks Dans le cas d'une liste tout pays confondus, l'affichage fait une rupture sur le pays. @@ -207,7 +207,7 @@ class FormCompany dol_syslog("FormCompany::select_departement selected=$selected, pays_code=$pays_code",LOG_DEBUG); $langs->load("dict"); - + $out=''; // On recherche les departements/cantons/province active d'une region et pays actif @@ -272,7 +272,7 @@ class FormCompany { dol_print_error($this->db); } - + return $out; } @@ -337,7 +337,7 @@ class FormCompany dol_print_error($this->db); } } - + /** * \brief Retourne la liste deroulante des civilite actives * \param selected civilite pre-selectionnee @@ -357,7 +357,7 @@ class FormCompany { global $conf,$langs,$user; $langs->load("dict"); - + $out=''; $sql = "SELECT rowid, code, civilite, active FROM ".MAIN_DB_PREFIX."c_civilite"; @@ -397,10 +397,10 @@ class FormCompany { dol_print_error($this->db); } - + return $out; } - + /** * \brief Retourne la liste deroulante des formes juridiques tous pays confondus ou pour un pays donne. * \remarks Dans le cas d'une liste tous pays confondu, on affiche une rupture sur le pays @@ -422,7 +422,7 @@ class FormCompany { global $conf,$langs,$user; $langs->load("dict"); - + $out=''; // On recherche les formes juridiques actives des pays actifs @@ -484,7 +484,7 @@ class FormCompany { dol_print_error($this->db); } - + return $out; } @@ -523,7 +523,7 @@ class FormCompany if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT) { $minLength = (is_numeric($conf->global->COMPANY_USE_SEARCH_TO_SELECT)?$conf->global->COMPANY_USE_SEARCH_TO_SELECT:2); - + $socid=0; if ($selected) { @@ -609,22 +609,22 @@ class FormCompany } print "\n"; } - + /** * Retourne la liste deroulante des codes postaux et des villes associƩes */ function select_ziptown($selected='',$htmlname='zipcode',$fields='',$fieldsize=0) { global $conf; - + $out=''; - + $size=''; if (!empty($fieldsize)) $size='size="'.$fieldsize.'"'; - + if ($conf->use_javascript_ajax) $out.= ajax_multiautocompleter($htmlname,$fields,DOL_URL_ROOT.'/core/ajaxziptown.php')."\n"; $out.= ''."\n"; - + return $out; } diff --git a/htdocs/lib/ajax.lib.php b/htdocs/lib/ajax.lib.php index 691b3de54f0..28c3a5cd9b1 100644 --- a/htdocs/lib/ajax.lib.php +++ b/htdocs/lib/ajax.lib.php @@ -88,6 +88,7 @@ function ajax_multiautocompleter($htmlname,$fields,$url,$option='') $fields = php2js($fields); + $script.= ''."\n"; $script.= '