Fix: move ajaxziptown in core
This commit is contained in:
parent
5ba0f139a5
commit
ab8e470251
@ -268,12 +268,12 @@ if ($_GET["action"] == 'create' || $_POST["action"] == 'create')
|
||||
|
||||
// Zip
|
||||
print '<tr><td>'.$langs->trans('Zip').'</td><td>';
|
||||
$formcompany->select_ziptown($address->cp,'zipcode',array('town','selectpays_id'),6);
|
||||
print $formcompany->select_ziptown($address->cp,'zipcode',array('town','selectpays_id'),6);
|
||||
print '</td></tr>';
|
||||
|
||||
// Town
|
||||
print '<tr><td>'.$langs->trans('Town').'</td><td>';
|
||||
$formcompany->select_ziptown($address->ville,'town',array('zipcode','selectpays_id'));
|
||||
print $formcompany->select_ziptown($address->ville,'town',array('zipcode','selectpays_id'));
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td width="25%">'.$langs->trans('Country').'</td><td colspan="3">';
|
||||
@ -380,12 +380,12 @@ elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit')
|
||||
|
||||
// Zip
|
||||
print '<tr><td>'.$langs->trans('Zip').'</td><td>';
|
||||
$formcompany->select_ziptown($address->cp,'zipcode',array('town','selectpays_id'),6);
|
||||
print $formcompany->select_ziptown($address->cp,'zipcode',array('town','selectpays_id'),6);
|
||||
print '</td></tr>';
|
||||
|
||||
// Town
|
||||
print '<tr><td>'.$langs->trans('Town').'</td><td>';
|
||||
$formcompany->select_ziptown($address->ville,'town',array('zipcode','selectpays_id'));
|
||||
print $formcompany->select_ziptown($address->ville,'town',array('zipcode','selectpays_id'));
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">';
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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 '<input id="'.$htmlname.'" type="text" name="'.$htmlname.'" '.$size.' value="'.$selected.'">'."\n";
|
||||
if ($conf->use_javascript_ajax) $out.= ajax_multiautocompleter($htmlname,$fields,DOL_URL_ROOT.'/core/ajaxziptown.php')."\n";
|
||||
$out.= '<input id="'.$htmlname.'" type="text" name="'.$htmlname.'" '.$size.' value="'.$selected.'">'."\n";
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -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');
|
||||
|
||||
@ -129,9 +129,9 @@ if ($this->control->tpl['fournisseur']) {
|
||||
|
||||
<tr>
|
||||
<td><?php echo $langs->trans('Zip'); ?></td>
|
||||
<td><input size="6" type="text" name="cp" value="<?php echo $this->control->tpl['cp']; ?>"><?php echo $this->control->tpl['autofilltownfromzip']; ?></td>
|
||||
<td><?php echo $this->control->tpl['select_zip']; ?></td>
|
||||
<td><?php echo $langs->trans('Town'); ?></td>
|
||||
<td><input type="text" name="ville" value="<?php echo $this->control->tpl['ville']; ?>"></td>
|
||||
<td><?php echo $this->control->tpl['select_town']; ?></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
|
||||
@ -126,9 +126,9 @@ if ($this->control->tpl['fournisseur']) {
|
||||
|
||||
<tr>
|
||||
<td><?php echo $langs->trans('Zip'); ?></td>
|
||||
<td><input size="6" type="text" name="cp" value="<?php echo $this->control->tpl['cp']; ?>"><?php echo $this->control->tpl['autofilltownfromzip']; ?></td>
|
||||
<td><?php echo $this->control->tpl['select_zip']; ?></td>
|
||||
<td><?php echo $langs->trans('Town'); ?></td>
|
||||
<td><input type="text" name="ville" value="<?php echo $this->control->tpl['ville']; ?>"></td>
|
||||
<td><?php echo $this->control->tpl['select_town']; ?></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
|
||||
@ -768,9 +768,9 @@ else
|
||||
|
||||
// Zip / Town
|
||||
print '<tr><td>'.$langs->trans('Zip').'</td><td>';
|
||||
$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 '</td><td>'.$langs->trans('Town').'</td><td>';
|
||||
$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 '</td></tr>';
|
||||
|
||||
// Country
|
||||
@ -1181,9 +1181,9 @@ else
|
||||
|
||||
// Zip / Town
|
||||
print '<tr><td>'.$langs->trans('Zip').'</td><td>';
|
||||
$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 '</td><td>'.$langs->trans('Town').'</td><td>';
|
||||
$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 '</td></tr>';
|
||||
|
||||
// Country
|
||||
|
||||
Loading…
Reference in New Issue
Block a user