Skip to content
Snippets Groups Projects
Commit 6263e90d authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

More info on contact popup

parent 87e07a30
Branches
Tags
No related merge requests found
......@@ -918,6 +918,11 @@ class Contact extends CommonObject
$result='';
$label = '<u>' . $langs->trans("ShowContact") . '</u>';
$label.= '<br><b>' . $langs->trans("Name") . ':</b> '.$this->getFullName($langs);
//if ($this->cibility_id) $label.= '<br><b>' . $langs->trans("Civility") . ':</b> '.$this->civility_id; // TODO Translate cibilty_id code
$label.= '<br><b>' . $langs->trans("Poste") . ':</b> '.$this->poste;
$label.= '<br><b>' . $langs->trans("EMail") . ':</b> '.$this->email;
$label.= '<br><b>' . $langs->trans("Phone") . ':</b> '.join(', ',array($this->phone_pro,$this->phone_mobile,$this->phone_perso));
$label.= '<br><b>' . $langs->trans("Address") . ':</b> '.dol_format_address($this, 1, ' ', $langs);
$link = '<a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$this->id.$moreparam.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>';
......
......@@ -666,7 +666,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
print "</tr>";
$sql = "SELECT p.rowid, p.lastname, p.firstname, p.fk_pays as country_id, p.poste, p.phone, p.phone_mobile, p.phone_perso, p.fax, p.email, p.skype, p.statut ";
$sql = "SELECT p.rowid, p.lastname, p.firstname, p.fk_pays as country_id, p.civility, p.poste, p.phone as phone_pro, p.phone_mobile, p.phone_perso, p.fax, p.email, p.skype, p.statut ";
$sql .= ", p.civility as civility_id, p.address, p.zip, p.town";
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p";
$sql .= " WHERE p.fk_soc = ".$object->id;
......@@ -676,6 +676,8 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
dol_syslog('core/lib/company.lib.php :: show_contacts', LOG_DEBUG);
$result = $db->query($sql);
if (! $result) dol_print_error($db);
$num = $db->num_rows($result);
$var=true;
......@@ -695,6 +697,14 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
$contactstatic->lastname = $obj->lastname;
$contactstatic->firstname = $obj->firstname;
$contactstatic->civility_id = $obj->civility_id;
$contactstatic->poste = $obj->poste;
$contactstatic->address = $obj->address;
$contactstatic->zip = $obj->zip;
$contactstatic->town = $obj->town;
$contactstatic->phone_pro = $obj->phone_pro;
$contactstatic->phone_mobile = $obj->phone_mobile;
$contactstatic->phone_perso = $obj->phone_perso;
$contactstatic->email = $obj->email;
print $contactstatic->getNomUrl(1,'',0,'&backtopage='.urlencode($backtopage));
print '</td><td>';
if ($obj->poste) print $obj->poste;
......@@ -719,11 +729,13 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
print '</a> ';
}
if ($coords) { print dol_print_address($coords,'address_contact_'.$obj->rowid, 'contact', $obj->rowid); $outdone++; }
if ($obj->phone || $obj->phone_mobile || $obj->phone_perso) print ($outdone?'<br>':'');
if ($obj->phone) { print dol_print_phone($obj->phone,$country_code['code'],$obj->rowid,$object->id,'AC_TEL','&nbsp;','phone'); $outdone++; }
if ($obj->phone_pro || $obj->phone_mobile || $obj->phone_perso || $obj->fax) print ($outdone?'<br>':'');
if ($obj->phone_pro) { print dol_print_phone($obj->phone_pro,$country_code['code'],$obj->rowid,$object->id,'AC_TEL','&nbsp;','phone'); $outdone++; }
if ($obj->phone_mobile) { print dol_print_phone($obj->phone_mobile,$country_code['code'],$obj->rowid,$object->id,'AC_TEL','&nbsp;','phone'); $outdone++; }
if ($obj->phone_perso) { print dol_print_phone($obj->phone_perso,$country_code['code'],$obj->rowid,$object->id,'AC_TEL','&nbsp;','phone'); $outdone++; }
if ($obj->fax) { print dol_print_phone($obj->fax,$country_code['code'],$obj->rowid,$object->id,'AC_FAX','&nbsp;','fax'); $outdone++; }
print '<div style="clear: both;"></div>';
$outdone=0;
if ($obj->email) print dol_print_email($obj->email,$obj->rowid,$object->id,'AC_EMAIL',0,0,1);
......
......@@ -877,6 +877,7 @@ function dol_bc($var,$moreclass='')
* @param string $sep Separator to use to build string
* @param Translate $outputlangs Object lang that contains language for text translation.
* @return string Formated string
* @see dol_print_address
*/
function dol_format_address($object,$withcountry=0,$sep="\n",$outputlangs='')
{
......@@ -1604,6 +1605,7 @@ function dol_user_country()
* @param int $mode thirdparty|contact|member|other
* @param int $id Id of object
* @return void
* @see dol_format_address
*/
function dol_print_address($address, $htmlid, $mode, $id)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment