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.address, c.cp, c.ville,";
|
||||||
$sql.= " c.fk_pays, p.libelle as pays, p.code as pays_code,";
|
$sql.= " c.fk_pays, p.libelle as pays, p.code as pays_code,";
|
||||||
$sql.= " c.birthday as birthday, c.poste,";
|
$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.= " 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."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;
|
$sql.= " WHERE c.idp = ". $id;
|
||||||
|
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
@ -486,6 +488,8 @@ class Contact
|
|||||||
$this->birthday_alert = $obj->birthday_alert;
|
$this->birthday_alert = $obj->birthday_alert;
|
||||||
$this->note = $obj->note;
|
$this->note = $obj->note;
|
||||||
|
|
||||||
|
$this->user_id = $obj->user_id;
|
||||||
|
$this->user_login = $obj->user_login;
|
||||||
}
|
}
|
||||||
$this->db->free($resql);
|
$this->db->free($resql);
|
||||||
|
|
||||||
|
|||||||
@ -290,9 +290,9 @@ if ($_GET["action"] == 'create')
|
|||||||
elseif ($_GET["action"] == 'edit')
|
elseif ($_GET["action"] == 'edit')
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Fiche en mode edition
|
* Fiche en mode edition
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
print '<form method="post" action="fiche.php?id='.$_GET["id"].'">';
|
print '<form method="post" action="fiche.php?id='.$_GET["id"].'">';
|
||||||
print '<input type="hidden" name="id" value="'.$_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 $form->selectyesno("facturation",$contact->facturation);
|
||||||
print '</td></tr>';
|
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 '<tr><td colspan="4" align="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></td></tr>';
|
||||||
print "</table><br>";
|
print '</table>';
|
||||||
|
|
||||||
print "</form>";
|
print "</form>";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Visualisation de la fiche
|
* Fiche en mode visualisation
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -427,6 +432,11 @@ else
|
|||||||
print yn($contact->facturation);
|
print yn($contact->facturation);
|
||||||
print '</td></tr>';
|
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 "</table>";
|
||||||
|
|
||||||
print "</div>";
|
print "</div>";
|
||||||
|
|||||||
@ -112,3 +112,5 @@ NoParentCompany=None
|
|||||||
ExportImport=Import-Export
|
ExportImport=Import-Export
|
||||||
ExportCardToFormat=Export card to format
|
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
|
||||||
@ -112,3 +112,5 @@ NoParentCompany=Aucune
|
|||||||
ExportImport=Import-Export
|
ExportImport=Import-Export
|
||||||
ExportCardToFormat=Exporter fiche au format
|
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