New: add getNomUrl() method

This commit is contained in:
Regis Houssin 2012-03-14 19:17:04 +01:00
parent 43929ab3f9
commit 5d0a8945c1
8 changed files with 30 additions and 13 deletions

View File

@ -189,11 +189,11 @@ if ($id > 0 || ! empty($ref))
if ($action == 'editdelivery_address')
{
$formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,GETPOST('socid','int'),'fk_address','propal',$object->id);
$formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,$object->socid,'fk_address','propal',$object->id);
}
else
{
$formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,GETPOST('socid','int'),'none','propal',$object->id);
$formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,$object->socid,'none','propal',$object->id);
}
print '</td></tr>';
}

View File

@ -720,7 +720,7 @@ class FormOther
}
/**
* Show form to select addresse
* Show form to select address
*
* @param int $page Page
* @param string $selected Id condition pre-selectionne

View File

@ -631,8 +631,7 @@ function show_addresses($conf,$langs,$db,$object,$backtopage='')
print '<td>'.$langs->trans("Town").'</td>';
print '<td>'.$langs->trans("Country").'</td>';
print '<td>'.$langs->trans("Tel").'</td>';
print '<td>'.$langs->trans("Fax").'</td>';
//print '<td>'.$langs->trans("EMail").'</td>';
print '<td>'.$langs->trans("Fax").'</td>';
print "<td>&nbsp;</td>";
print "</tr>";
@ -647,8 +646,9 @@ function show_addresses($conf,$langs,$db,$object,$backtopage='')
print "<tr ".$bc[$var].">";
print '<td>';
print $address->label;
//print $addressstatic->getNomUrl(1);
$addressstatic->id = $address->id;
$addressstatic->label = $address->label;
print $addressstatic->getNomUrl(1);
print '</td>';
print '<td>'.$address->name.'</td>';
@ -664,12 +664,7 @@ function show_addresses($conf,$langs,$db,$object,$backtopage='')
print '</td>';
print '<td>';
print dol_print_phone($address->fax,$address->country_code,$address->id,$object->id,'AC_FAX');
print '</td>';
/*
print '<td>';
print dol_print_email($address->email,$address->id,$object->id,'AC_EMAIL');
print '</td>';
*/
print '</td>';
if ($user->rights->societe->creer)
{

View File

@ -433,6 +433,28 @@ class Address
print $this->db->error() . '<br>' . $sql;
}
}
/**
* Return name of address with link (and eventually picto)
* Use $this->id, $this->label, $this->socid
*
* @param int $withpicto Include picto with link
* @param string $option Where the link point to
* @return string String with URL
*/
function getNomUrl($withpicto=0,$option='')
{
global $langs;
$result='';
$lien = '<a href="'.DOL_URL_ROOT.'/comm/address.php?id='.$this->id.'&socid='.$this->socid.'">';
$lienfin='</a>';
if ($withpicto) $result.=($lien.img_object($langs->trans("ShowAddress").': '.$this->label,'address').$lienfin.' ');
$result.=$lien.$this->label.$lienfin;
return $result;
}
/**

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB