Fix: javascript DOM problem

This commit is contained in:
Regis Houssin 2012-03-14 18:25:05 +01:00
parent 9b7afbc29b
commit 43929ab3f9
3 changed files with 6 additions and 5 deletions

View File

@ -655,7 +655,8 @@ function show_addresses($conf,$langs,$db,$object,$backtopage='')
print '<td>'.$address->town.'</td>';
print '<td>'.$address->country.'</td>';
$img=picto_from_langcode($address->country_code);
print '<td>'.($img?$img.' ':'').$address->country.'</td>';
// Lien click to dial
print '<td>';

View File

@ -296,7 +296,7 @@ class Address
$line->town = $objp->town;
$line->country_id = $objp->country_id;
$line->country_code = $objp->country_id?$objp->country_code:'';
$line->country = $objp->country_id?($langs->trans('Country'.$objp->country_code)!='Country'.$objp->country_code?strtoupper($langs->trans('Country'.$objp->country_code)):$objp->country):'';
$line->country = $objp->country_id?($langs->trans('Country'.$objp->country_code)!='Country'.$objp->country_code?$langs->trans('Country'.$objp->country_code):$objp->country):'';
$line->phone = $objp->tel;
$line->fax = $objp->fax;
$line->note = $objp->note;

View File

@ -1646,12 +1646,12 @@ else
print '</td>';
// VAT Code
print '<td nowrap="nowrpa">'.$langs->trans('VATIntra').'</td><td>';
print '<td nowrap="nowrap">'.$langs->trans('VATIntra').'</td><td>';
if ($object->tva_intra)
{
$s='';
$s.=$object->tva_intra;
$s.='<input type="hidden" name="tva_intra" size="12" maxlength="20" value="'.$object->tva_intra.'">';
$s.='<input type="hidden" id="tva_intra" name="tva_intra" size="12" maxlength="20" value="'.$object->tva_intra.'">';
if (empty($conf->global->MAIN_DISABLEVATCHECK))
{
@ -1666,7 +1666,7 @@ else
print "}\n";
print '</script>';
print "\n";
$s.='<a href="#" onclick="javascript: CheckVAT(document.formsoc.tva_intra.value);">'.$langs->trans("VATIntraCheck").'</a>';
$s.='<a href="#" onclick="javascript: CheckVAT( $(\'#tva_intra\').val() );">'.$langs->trans("VATIntraCheck").'</a>';
$s = $form->textwithpicto($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1);
}
else