New: Affiche lien vers fiche utilisateur sur fiche contact (pour les contacts qui ont un compte Dolibarr)
This commit is contained in:
parent
064817f98b
commit
2d35b0ae1b
@ -440,9 +440,11 @@ class Contact
|
||||
$sql.= " c.address, c.cp, c.ville,";
|
||||
$sql.= " c.fk_pays, p.libelle as pays, p.code as pays_code,";
|
||||
$sql.= " c.birthday as birthday, c.poste,";
|
||||
$sql.= " c.phone, c.phone_perso, c.phone_mobile, c.fax, c.email, c.jabberid, c.note";
|
||||
$sql.= " c.phone, c.phone_perso, c.phone_mobile, c.fax, c.email, c.jabberid, c.note,";
|
||||
$sql.= " u.rowid as user_id, u.login as user_login";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p ON c.fk_pays = p.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON c.idp = u.fk_socpeople";
|
||||
$sql.= " WHERE c.idp = ". $id;
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
@ -485,7 +487,9 @@ class Contact
|
||||
$this->birthday = $obj->birthday;
|
||||
$this->birthday_alert = $obj->birthday_alert;
|
||||
$this->note = $obj->note;
|
||||
|
||||
|
||||
$this->user_id = $obj->user_id;
|
||||
$this->user_login = $obj->user_login;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
||||
|
||||
@ -290,9 +290,9 @@ if ($_GET["action"] == 'create')
|
||||
elseif ($_GET["action"] == 'edit')
|
||||
{
|
||||
/*
|
||||
* Fiche en mode edition
|
||||
*
|
||||
*/
|
||||
* Fiche en mode edition
|
||||
*
|
||||
*/
|
||||
|
||||
print '<form method="post" action="fiche.php?id='.$_GET["id"].'">';
|
||||
print '<input type="hidden" name="id" value="'.$_GET["id"].'">';
|
||||
@ -352,15 +352,20 @@ elseif ($_GET["action"] == 'edit')
|
||||
print $form->selectyesno("facturation",$contact->facturation);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("DolibarrLogin").'</td><td colspan="3">';
|
||||
if ($contact->user_id) print '<a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$contact->user_id.'">'.$contact->user_login.'</a>';
|
||||
else print $langs->trans("NoDolibarrAccess");
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td colspan="4" align="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></td></tr>';
|
||||
print "</table><br>";
|
||||
print '</table>';
|
||||
|
||||
print "</form>";
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Visualisation de la fiche
|
||||
* Fiche en mode visualisation
|
||||
*
|
||||
*/
|
||||
|
||||
@ -370,7 +375,7 @@ else
|
||||
{
|
||||
$objsoc = new Societe($db);
|
||||
$objsoc->fetch($contact->socid);
|
||||
|
||||
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td colspan="3">'.$objsoc->nom_url.'</td></tr>';
|
||||
}
|
||||
else
|
||||
@ -399,7 +404,7 @@ else
|
||||
print '<tr><td>'.$langs->trans("Country").'</td><td colspan="3">';
|
||||
print $contact->pays;
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
print '<tr><td>Tel Pro</td><td>'.$contact->phone_pro.'</td>';
|
||||
print '<td>Tel Perso</td><td>'.$contact->phone_perso.'</td></tr>';
|
||||
|
||||
@ -427,6 +432,11 @@ else
|
||||
print yn($contact->facturation);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("DolibarrLogin").'</td><td colspan="3">';
|
||||
if ($contact->user_id) print '<a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$contact->user_id.'">'.$contact->user_login.'</a>';
|
||||
else print $langs->trans("NoDolibarrAccess");
|
||||
print '</td></tr>';
|
||||
|
||||
print "</table>";
|
||||
|
||||
print "</div>";
|
||||
|
||||
@ -111,4 +111,6 @@ NoRIB=No RIB defined
|
||||
NoParentCompany=None
|
||||
ExportImport=Import-Export
|
||||
ExportCardToFormat=Export card to format
|
||||
ContactNotLinkedToCompany=Contact not linked to any company
|
||||
ContactNotLinkedToCompany=Contact not linked to any company
|
||||
DolibarrLogin=Dolibarr login
|
||||
NoDolibarrAccess=No Dolibarr access
|
||||
@ -111,4 +111,6 @@ NoRIB=Aucun RIB d
|
||||
NoParentCompany=Aucune
|
||||
ExportImport=Import-Export
|
||||
ExportCardToFormat=Exporter fiche au format
|
||||
ContactNotLinkedToCompany=Contact non lié à une société
|
||||
ContactNotLinkedToCompany=Contact non lié à une société
|
||||
DolibarrLogin=Login Dolibarr
|
||||
NoDolibarrAccess=Pas d'accès Dolibarr
|
||||
Loading…
Reference in New Issue
Block a user