Skip to content
Snippets Groups Projects
Commit d49d264b authored by Laurent Destailleur's avatar Laurent Destailleur Committed by GitHub
Browse files

Merge pull request #6608 from LordVan/patch-2

NEW Add phone numbers of project contacts as ODT vars
parents 67cf3a1e a76ddc8b
Branches
No related tags found
No related merge requests found
......@@ -186,6 +186,25 @@ class doc_generic_project_odt extends ModelePDFProjects
{
global $conf;
// adding phone numbers if external
$phone_pro = '';
$phone_perso = '';
$phone_mobile = '';
$ct = new Contact($this->db);
if ($contact['source']=='external') {
$ct = new Contact($this->db);
$ct->fetch($contact['id']);
$phone_pro = $ct->phone_pro;
$phone_perso = $ct->phone_perso;
$phone_mobile = $ct->phone_mobile;
} elseif ($contact['source']=='internal') {
$ct = new User($this->db);
$ct->fetch($contact['id']);
$phone_pro = $ct->office_phone;
$phone_mobile = $ct->user_mobile;
}
return array(
'projcontacts_id'=>$contact['id'],
'projcontacts_rowid'=>$contact['rowid'],
......@@ -194,7 +213,10 @@ class doc_generic_project_odt extends ModelePDFProjects
'projcontacts_firstname'=>$contact['firstname'],
'projcontacts_fullcivname'=>$contact['fullname'],
'projcontacts_socname'=>$contact['socname'],
'projcontacts_email'=>$contact['email']
'projcontacts_email'=>$contact['email'],
'projcontacts_phone_pro'=>$phone_pro,
'projcontacts_phone_perso'=>$phone_perso,
'projcontacts_phone_mobile'=>$phone_mobile
);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment