Link in bank transaction view are picto.

This allow to show full label.
This commit is contained in:
Laurent Destailleur 2008-10-23 18:09:52 +00:00
parent fab9a7ff17
commit 5a8eca23c1
2 changed files with 31 additions and 43 deletions

View File

@ -289,8 +289,8 @@ class ChargeSociales
/**
* \brief Renvoie nom clicable (avec eventuellement le picto)
* \param withpicto Inclut le picto dans le lien
* \param maxlen Longueur max libelle
* \param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* \param maxlen Longueur max libelle
* \return string Chaine avec URL
*/
function getNomUrl($withpicto=0,$maxlen=0)
@ -303,7 +303,8 @@ class ChargeSociales
$lienfin='</a>';
if ($withpicto) $result.=($lien.img_object($langs->trans("ShowSocialContribution"),'bill').$lienfin.' ');
$result.=$lien.($maxlen?dolibarr_trunc($this->lib,$maxlen):$this->lib).$lienfin;
if ($withpicto && $withpicto != 2) $result.=' ';
if ($withpicto != 2) $result.=$lien.($maxlen?dolibarr_trunc($this->lib,$maxlen):$this->lib).$lienfin;
return $result;
}

View File

@ -32,10 +32,14 @@ require_once(DOL_DOCUMENT_ROOT."/lib/bank.lib.php");
require_once(DOL_DOCUMENT_ROOT."/societe.class.php");
require_once(DOL_DOCUMENT_ROOT."/adherents/adherent.class.php");
require_once(DOL_DOCUMENT_ROOT."/chargesociales.class.php");
require_once(DOL_DOCUMENT_ROOT."/paiement.class.php");
require_once(DOL_DOCUMENT_ROOT."/fourn/facture/paiementfourn.class.php");
// Security check
if (!$user->rights->banque->lire)
accessforbidden();
$langs->load("bills");
@ -111,9 +115,12 @@ if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"]=='yes' && $user->r
*/
llxHeader();
$societestatic=new Societe($db);
$chargestatic=new ChargeSociales($db);
$memberstatic=new Adherent($db);
$paymentstatic=new Paiement($db);
$paymentsupplierstatic=new PaiementFourn($db);
$html = new Form($db);
@ -414,13 +421,13 @@ if ($account || $_GET["ref"])
}
if ($mode_search && $conf->adherent->enabled)
{
// \TODO Mettre jointure sur adherent
// \TODO Mettre jointure sur adherent pour recherche sur un adherent
//$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu ON bu.fk_bank = b.rowid AND bu.type='company'";
//$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON bu.url_id = s.rowid";
}
if ($mode_search && $conf->tax->enabled)
{
// \TODO Mettre jointure sur charges sociales
// \TODO Mettre jointure sur charges sociales pour recherche sur une charge
//$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu ON bu.fk_bank = b.rowid AND bu.type='company'";
//$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON bu.url_id = s.rowid";
}
@ -474,13 +481,16 @@ if ($account || $_GET["ref"])
$isbanktransfert=false;
foreach($links as $key=>$val) { if ($val['type']=='banktransfert') $isbanktransfert=true; }
$issocialcontrib=false;
//foreach($links as $key=>$val) { if ($val['type']=='sc') $issocialcontrib=true; }
if (sizeof($links) == 0 || $isbanktransfert || $issocialcontrib)
foreach($links as $key=>$val) { if ($val['type']=='sc') $issocialcontrib=true; }
$showlabel=true;
//if (sizeof($links) == 0) $showlabel=true;
//if ($isbanktransfert || $issocialcontrib) $showlabel=true;
if ($showlabel)
{
if (eregi('^\((.*)\)$',$objp->label,$reg))
{
// Label générique car entre parenthèses. On l'affiche en le traduisant
// Genereic description because between (). We show it after translating.
print $langs->trans($reg[1]);
}
else
@ -489,56 +499,33 @@ if ($account || $_GET["ref"])
}
}
/*
* Ajout les liens autres que tiers
*/
// Add links in description field
foreach($links as $key=>$val)
{
if ($links[$key]['type']=='payment') {
//print ' - ';
print '<a href="'.DOL_URL_ROOT.'/compta/paiement/fiche.php?id='.$links[$key]['url_id'].'">';
if (eregi('^\((.*)\)$',$links[$key]['label'],$reg))
{
// Label générique car entre parenthèses. On l'affiche en le traduisant
if ($reg[1]=='paiement') $reg[1]='CustomerInvoicePayment';
print $langs->trans($reg[1]);
}
else
{
print $links[$key]['label'];
}
print '</a>';
$paymentstatic->rowid=$links[$key]['url_id'];
print ' '.$paymentstatic->getNomUrl(2);
}
else if ($links[$key]['type']=='payment_supplier') {
//print ' - ';
print '<a href="'.DOL_URL_ROOT.'/fourn/paiement/fiche.php?id='.$links[$key]['url_id'].'">';
if (eregi('^\((.*)\)$',$links[$key]['label'],$reg))
{
// Label générique car entre parenthèses. On l'affiche en le traduisant
if ($reg[1]=='paiement') $reg[1]='SupplierInvoicePayment';
print $langs->trans($reg[1]);
}
else
{
print $links[$key]['label'];
}
print '</a>';
$paymentsupplierstatic->rowid=$links[$key]['url_id'];
print ' '.$paymentsupplierstatic->getNomUrl(2);
}
else if ($links[$key]['type']=='company') {
}
else if ($links[$key]['type']=='sc') { // This is waitin for card to link to payment_sc
print '<a href="'.DOL_URL_ROOT.'/compta/sociales/charges.php?id='.$links[$key]['url_id'].'">';
//print img_object($langs->trans('ShowPayment'),'payment').' ';
print $langs->trans("SocialContribution");
print '</a>';
else if ($links[$key]['type']=='sc') { // This is waiting for card to link to payment_sc
$chargestatic->id=$links[$key]['url_id'];
print ' '.$chargestatic->getNomUrl(2);
}
else if ($links[$key]['type']=='payment_sc')
{
//print ' - ';
/*
print '<a href="'.DOL_URL_ROOT.'/compta/sociales/xxx.php?id='.$links[$key]['url_id'].'">';
//print img_object($langs->trans('ShowPayment'),'payment').' ';
print $langs->trans("SocialContributionPayment");
print '</a>';
*/
}
else if ($links[$key]['type']=='banktransfert') {
/* Do not show this link (avoid confusion). Can already be accessed from transaction detail */