Fix: Link to source was wrong

This commit is contained in:
Laurent Destailleur 2010-12-28 02:04:41 +00:00
parent 453a6cd30d
commit f0f9e5fb53
3 changed files with 41 additions and 6 deletions

View File

@ -417,7 +417,7 @@ if ($mil->fetch($_REQUEST["id"]) >= 0)
print '<td class="liste_titre">';
print '&nbsp';
print '</td>';
// Url
// Source
print '<td class="liste_titre" align="right" colspan="3">';
print '<input type="image" value="button_search" class="liste_titre" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" name="button_search" alt="'.$langs->trans("Search").'">';
print '&nbsp; <input type="image" value="button_removefilter" class="liste_titre" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/searchclear.png" name="button_removefilter" alt="'.$langs->trans("RemoveFilter").'">';
@ -439,7 +439,40 @@ if ($mil->fetch($_REQUEST["id"]) >= 0)
print '<td>'.$obj->nom.'</td>';
print '<td>'.$obj->prenom.'</td>';
print '<td>'.$obj->other.'</td>';
print '<td align="center">'.$obj->source_url.'</td>';
print '<td align="center">';
if (empty($obj->source_id) || empty($obj->source_type))
{
print $obj->source_url; // For backward compatibility
}
else
{
if ($obj->source_type == 'member')
{
include_once(DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php');
$m=new Adherent($db);
$m->id=$obj->source_id;
print $m->getNomUrl(2);
}
else if ($obj->source_type == 'user')
{
include_once(DOL_DOCUMENT_ROOT.'/user/class/user.class.php');
$m=new User($db);
$m->id=$obj->source_id;
print $m->getNomUrl(2);
}
else if ($obj->source_type == 'thirdparty')
{
include_once(DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php');
$m=new Societe($db);
$m->id=$obj->source_id;
print $m->getNomUrl(2);
}
else
{
print $obj->source_url;
}
}
print '</td>';
// Statut pour l'email destinataire (Attentioon != statut du mailing)
if ($obj->statut == 0)

View File

@ -1294,7 +1294,7 @@ class Societe extends CommonObject
/**
* \brief Renvoie nom clicable (avec eventuellement le picto)
* \param withpicto Inclut le picto dans le lien
* \param withpicto Inclut le picto dans le lien (0=No picto, 1=Inclut le picto dans le lien, 2=Picto seul)
* \param option Sur quoi pointe le lien ('', 'customer', 'supplier', 'compta')
* \param maxlen Longueur max libelle
* \return string Chaine avec URL
@ -1330,7 +1330,8 @@ class Societe extends CommonObject
$lien.=(!empty($this->canvas)?'&amp;canvas='.$this->canvas:'').'">';
$lienfin='</a>';
if ($withpicto) $result.=($lien.img_object($langs->trans("ShowCompany").': '.$this->nom,'company').$lienfin.' ');
if ($withpicto) $result.=($lien.img_object($langs->trans("ShowCompany").': '.$this->nom,'company').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' ';
$result.=$lien.($maxlen?dol_trunc($this->nom,$maxlen):$this->nom).$lienfin;
return $result;

View File

@ -1482,7 +1482,7 @@ class User extends CommonObject
/**
* \brief Return a link to the user card (with optionnaly the picto)
* \param withpicto Include picto in link
* \param withpicto Include picto in link (0=No picto, 1=Inclut le picto dans le lien, 2=Picto seul)
* \param option On what the link point to
* \return string String with URL
* \remarks Use this->id,this->nom, this->prenom
@ -1502,7 +1502,8 @@ class User extends CommonObject
$lienfin='</a>';
}
if ($withpicto) $result.=($lien.img_object($langs->trans("ShowUser"),'user').$lienfin.' ');
if ($withpicto) $result.=($lien.img_object($langs->trans("ShowUser"),'user').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' ';
$result.=$lien.$this->getFullName($langs).$lienfin;
return $result;
}