From 03ffa40e8523eaf5990b5f778a5fda90e96719ea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 24 Oct 2006 23:53:01 +0000 Subject: [PATCH] Qual: Utilisation des methodes communes plutot que code en dur --- htdocs/compta/fiche.php | 54 +++++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/htdocs/compta/fiche.php b/htdocs/compta/fiche.php index e8fbffe3249..b9a6ab1bc12 100644 --- a/htdocs/compta/fiche.php +++ b/htdocs/compta/fiche.php @@ -95,11 +95,17 @@ if ($mode == 'search') } -llxHeader(); /* * Mode fiche */ + +llxHeader(); + +$actionstatic=new ActionComm($db); +$facturestatic=new Facture($db); +$contactstatic = new Contact($db); + if ($socid > 0) { $societe = new Societe($db); @@ -433,8 +439,6 @@ if ($socid > 0) print "
"; - $actionstatic=new ActionComm($db); - /* * Listes des actions a faire * @@ -509,21 +513,23 @@ if ($socid > 0) } else { - print ''.img_object($langs->trans("ShowAction"),"task"); - $transcode=$langs->trans("Action".$obj->acode); - $libelle=($transcode!="Action".$obj->acode?$transcode:$obj->libelle); - print $libelle; - print ''; + $actionstatic->code=$obj->acode; + $actionstatic->libelle=$obj->libelle; + $actionstatic->id=$obj->id; + print ''.$actionstatic->getNomUrl(1,16).''; } print ''.$obj->label.''; // Contact pour cette action - if ($obj->fk_contact) { - $contact = new Contact($db); - $contact->fetch($obj->fk_contact); - print ''.img_object($langs->trans("ShowContact"),"contact").' '.$contact->fullname.''; - } else { + if ($obj->fk_contact > 0) + { + $contact = new Contact($db); + $contact->fetch($obj->fk_contact); + print ''.$contact->getNomUrl(1).''; + } + else + { print ' '; } @@ -602,11 +608,10 @@ if ($socid > 0) // Action print ''; - print ''.img_object($langs->trans("ShowTask"),"task"); - $transcode=$langs->trans("Action".$obj->acode); - $libelle=($transcode!="Action".$obj->acode?$transcode:$obj->libelle); - print $libelle; - print ''; + $actionstatic->code=$obj->acode; + $actionstatic->libelle=$obj->libelle; + $actionstatic->id=$obj->id; + print $actionstatic->getNomUrl(1,16); print ''; // Objet lié @@ -619,9 +624,10 @@ if ($socid > 0) } if ($obj->fk_facture) { - print ''.img_object($langs->trans("ShowBill"),"bill"); - print $langs->trans("Invoice"); - print ''; + $facturestatic->ref=$langs->trans("Invoice"); + $facturestatic->id=$obj->rowid; + $facturestatic->type=$obj->type; + print $facturestatic->getNomUrl(1,'compta'); } else print ' '; print ''; @@ -630,11 +636,11 @@ if ($socid > 0) print "$obj->label"; // Contact pour cette action - if ($obj->fk_contact) + if ($obj->fk_contact > 0) { $contact = new Contact($db); $contact->fetch($obj->fk_contact); - print ''.img_object($langs->trans("ShowContact"),"contact").' '.$contact->fullname.''; + print ''.$contact->getNomUrl(1).''; } else { @@ -656,7 +662,7 @@ if ($socid > 0) { dolibarr_print_error($db); } - print ""; + print "
"; } else {