New: Can link to transactions list of a bank account

This commit is contained in:
Laurent Destailleur 2011-02-07 17:51:16 +00:00
parent 966c1adeab
commit 8b70133797
2 changed files with 994 additions and 985 deletions

View File

@ -572,8 +572,8 @@ if ($account || $_GET["ref"])
} }
else if ($links[$key]['type']=='sc') { else if ($links[$key]['type']=='sc') {
} }
else { else { // Show link with label $links[$key]['label']
//print ' - '; if (! empty($objp->label) && ! empty($links[$key]['label'])) print ' - ';
print '<a href="'.$links[$key]['url'].$links[$key]['url_id'].'">'; print '<a href="'.$links[$key]['url'].$links[$key]['url_id'].'">';
if (preg_match('/^\((.*)\)$/i',$links[$key]['label'],$reg)) if (preg_match('/^\((.*)\)$/i',$links[$key]['label'],$reg))
{ {

View File

@ -844,16 +844,25 @@ class Account extends CommonObject
/** /**
* Renvoie nom clicable (avec eventuellement le picto) * Renvoie nom clicable (avec eventuellement le picto)
* @param withpicto Inclut le picto dans le lien * @param withpicto Inclut le picto dans le lien
* @param mode ''=Link to card, 'transactions'=Link to transactions card
* @return string Chaine avec URL * @return string Chaine avec URL
*/ */
function getNomUrl($withpicto=0) function getNomUrl($withpicto=0, $mode='')
{ {
global $langs; global $langs;
$result=''; $result='';
if (empty($mode))
{
$lien = '<a href="'.DOL_URL_ROOT.'/compta/bank/fiche.php?id='.$this->id.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/compta/bank/fiche.php?id='.$this->id.'">';
$lienfin='</a>'; $lienfin='</a>';
}
else if ($mode == 'transactions')
{
$lien = '<a href="'.DOL_URL_ROOT.'/compta/bank/account.php?account='.$this->id.'">';
$lienfin='</a>';
}
if ($withpicto) $result.=($lien.img_object($langs->trans("ShowAccount"),'account').$lienfin.' '); if ($withpicto) $result.=($lien.img_object($langs->trans("ShowAccount"),'account').$lienfin.' ');
$result.=$lien.$this->label.$lienfin; $result.=$lien.$this->label.$lienfin;