diff --git a/htdocs/comm/address.php b/htdocs/comm/address.php index 0d76e41d012..0d50c372a67 100644 --- a/htdocs/comm/address.php +++ b/htdocs/comm/address.php @@ -268,12 +268,12 @@ if ($_GET["action"] == 'create' || $_POST["action"] == 'create') // Zip print ''.$langs->trans('Zip').''; - $formcompany->select_ziptown($address->cp,'zipcode',array('town','selectpays_id'),6); + print $formcompany->select_ziptown($address->cp,'zipcode',array('town','selectpays_id'),6); print ''; // Town print ''.$langs->trans('Town').''; - $formcompany->select_ziptown($address->ville,'town',array('zipcode','selectpays_id')); + print $formcompany->select_ziptown($address->ville,'town',array('zipcode','selectpays_id')); print ''; print ''.$langs->trans('Country').''; @@ -380,12 +380,12 @@ elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit') // Zip print ''.$langs->trans('Zip').''; - $formcompany->select_ziptown($address->cp,'zipcode',array('town','selectpays_id'),6); + print $formcompany->select_ziptown($address->cp,'zipcode',array('town','selectpays_id'),6); print ''; // Town print ''.$langs->trans('Town').''; - $formcompany->select_ziptown($address->ville,'town',array('zipcode','selectpays_id')); + print $formcompany->select_ziptown($address->ville,'town',array('zipcode','selectpays_id')); print ''; print ''.$langs->trans('Country').''; diff --git a/htdocs/core/ajaxziptown.php b/htdocs/core/ajaxziptown.php index 1a34dcd4f84..020fa5c6e36 100644 --- a/htdocs/core/ajaxziptown.php +++ b/htdocs/core/ajaxziptown.php @@ -103,7 +103,7 @@ if (! empty($_GET['zipcode']) || ! empty($_GET['town'])) $county = $row['fk_county']?($langs->trans($row['county_code'])!=$row['county_code']?$langs->trans($row['county_code']):($row['county']!='-'?$row['county']:'')):''; $row_array['label'] = $row['zip'].' '.$row['town']; - $row_array['label'] .= ($county || $country)?'(':''; + $row_array['label'] .= ($county || $country)?' (':''; $row_array['label'] .= $county; $row_array['label'] .= ($county && $country?' - ':''); $row_array['label'] .= $country; diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index 10a6df494a9..07e82008282 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -614,11 +614,15 @@ class FormCompany { global $conf; + $out=''; + $size=''; if (!empty($fieldsize)) $size='size="'.$fieldsize.'"'; - if ($conf->use_javascript_ajax) print ajax_multiautocompleter($htmlname,$fields,DOL_URL_ROOT.'/core/ajaxziptown.php')."\n"; - print ''."\n"; + 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/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index 8bb6d99faac..4506c185bbb 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -123,6 +123,12 @@ class ActionsCardCommon $this->object->LoadSupplierCateg(); $this->tpl['suppliercategory'] = $this->object->SupplierCategories; $this->tpl['select_suppliercategory'] = $form->selectarray("fournisseur_categorie",$this->object->SupplierCategories,$_POST["fournisseur_categorie"],1); + + // Zip + $this->tpl['select_zip'] = $formcompany->select_ziptown($this->object->cp,'zipcode',array('town','selectpays_id','departement_id'),6); + + // Town + $this->tpl['select_town'] = $formcompany->select_ziptown($this->object->ville,'town',array('zipcode','selectpays_id','departement_id')); // Country $this->tpl['select_country'] = $form->select_country($this->object->pays_id,'pays_id'); diff --git a/htdocs/societe/canvas/default/tpl/card_create.tpl.php b/htdocs/societe/canvas/default/tpl/card_create.tpl.php index 9d5bd858835..8b10e4a1db7 100644 --- a/htdocs/societe/canvas/default/tpl/card_create.tpl.php +++ b/htdocs/societe/canvas/default/tpl/card_create.tpl.php @@ -129,9 +129,9 @@ if ($this->control->tpl['fournisseur']) { trans('Zip'); ?> - control->tpl['autofilltownfromzip']; ?> + control->tpl['select_zip']; ?> trans('Town'); ?> - + control->tpl['select_town']; ?> diff --git a/htdocs/societe/canvas/default/tpl/card_edit.tpl.php b/htdocs/societe/canvas/default/tpl/card_edit.tpl.php index a26302e851e..881ddb54da1 100644 --- a/htdocs/societe/canvas/default/tpl/card_edit.tpl.php +++ b/htdocs/societe/canvas/default/tpl/card_edit.tpl.php @@ -126,9 +126,9 @@ if ($this->control->tpl['fournisseur']) { trans('Zip'); ?> - control->tpl['autofilltownfromzip']; ?> + control->tpl['select_zip']; ?> trans('Town'); ?> - + control->tpl['select_town']; ?> diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index b934e89807b..5c3c2e09765 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -768,9 +768,9 @@ else // Zip / Town print ''.$langs->trans('Zip').''; - $formcompany->select_ziptown($soc->cp,'zipcode',array('town','selectpays_id','departement_id'),6); + print $formcompany->select_ziptown($soc->cp,'zipcode',array('town','selectpays_id','departement_id'),6); print ''.$langs->trans('Town').''; - $formcompany->select_ziptown($soc->ville,'town',array('zipcode','selectpays_id','departement_id')); + print $formcompany->select_ziptown($soc->ville,'town',array('zipcode','selectpays_id','departement_id')); print ''; // Country @@ -1181,9 +1181,9 @@ else // Zip / Town print ''.$langs->trans('Zip').''; - $formcompany->select_ziptown($soc->cp,'zipcode',array('town','selectpays_id','departement_id'),6); + print $formcompany->select_ziptown($soc->cp,'zipcode',array('town','selectpays_id','departement_id'),6); print ''.$langs->trans('Town').''; - $formcompany->select_ziptown($soc->ville,'town',array('zipcode','selectpays_id','departement_id')); + print $formcompany->select_ziptown($soc->ville,'town',array('zipcode','selectpays_id','departement_id')); print ''; // Country