diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php
index 04fe70c8489..8a72c2d50f3 100644
--- a/htdocs/comm/fiche.php
+++ b/htdocs/comm/fiche.php
@@ -33,6 +33,7 @@ require_once("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
require_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php");
require_once(DOL_DOCUMENT_ROOT."/contact.class.php");
+require_once(DOL_DOCUMENT_ROOT."/facture.class.php");
if ($conf->propal->enabled) require_once(DOL_DOCUMENT_ROOT."/propal.class.php");
if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT."/commande/commande.class.php");
if ($conf->contrat->enabled) require_once(DOL_DOCUMENT_ROOT."/contrat/contrat.class.php");
@@ -68,13 +69,16 @@ if (!$user->rights->commercial->client->voir && $socid && !$user->societe_id > 0
}
}
-
$sortorder=$_GET["sortorder"];
$sortfield=$_GET["sortfield"];
if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="nom";
+/*
+ * Actions
+ */
+
if ($_GET["action"] == 'attribute_prefix' && $user->rights->societe->creer)
{
$societe = new Societe($db, $_GET["socid"]);
@@ -167,14 +171,18 @@ if ($mode == 'search') {
-llxHeader('',$langs->trans('CustomerCard'));
-
-
/*********************************************************************************
*
* Mode fiche
*
*********************************************************************************/
+
+llxHeader('',$langs->trans('CustomerCard'));
+
+$actionstatic=new ActionComm($db);
+$facturestatic=new Facture($db);
+$contactstatic = new Contact($db);
+
if ($socid > 0)
{
// On recupere les donnees societes par l'objet
@@ -696,10 +704,10 @@ if ($socid > 0)
$var = !$var;
print "
";
- print '| ';
- print '';
- print img_object($langs->trans("Show"),"contact");
- print ' '.$obj->firstname.' '. $obj->name.' ';
+ $contactstatic->id=$obj->idp;
+ $contactstatic->name=$obj->name;
+ $contactstatic->firstname=$obj->firstname;
+ print ' | '.$contactstatic->getNomUrl(1).' | ';
if (trim($obj->note))
{
@@ -737,8 +745,6 @@ if ($socid > 0)
print "
";
- $actionstatic=new ActionComm($db);
-
/*
* Listes des actions a faire
*
@@ -819,20 +825,22 @@ 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) {
+ if ($obj->fk_contact > 0)
+ {
$contact = new Contact($db);
$contact->fetch($obj->fk_contact);
- print ''.img_object($langs->trans("ShowContact"),"contact").' '.$contact->fullname.' | ';
- } else {
+ print ''.$contact->getNomUrl(1).' | ';
+ }
+ else
+ {
print ' | ';
}
@@ -890,7 +898,7 @@ if ($socid > 0)
$oldyear='';
$oldmonth='';
$var=true;
-
+
while ($i < $num)
{
$var = !$var;
@@ -929,11 +937,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é
@@ -946,9 +953,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 '';
@@ -957,11 +965,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
{
diff --git a/htdocs/contact.class.php b/htdocs/contact.class.php
index 2f7d31625d9..fa59dd0c3ac 100644
--- a/htdocs/contact.class.php
+++ b/htdocs/contact.class.php
@@ -756,6 +756,7 @@ class Contact
* \param withpicto Inclut le picto dans le lien
* \param option Sur quoi pointe le lien
* \return string Chaine avec URL
+ * \remarks Utilise $this->id, $this->name et $this->firstname
*/
function getNomUrl($withpicto=0,$option='')
{