2
0
forked from Wavyzz/dolibarr

More info on contact popup

This commit is contained in:
Laurent Destailleur
2015-06-14 17:38:28 +02:00
parent 87e07a3038
commit 6263e90ddb
3 changed files with 22 additions and 3 deletions

View File

@@ -918,6 +918,11 @@ class Contact extends CommonObject
$result=''; $result='';
$label = '<u>' . $langs->trans("ShowContact") . '</u>'; $label = '<u>' . $langs->trans("ShowContact") . '</u>';
$label.= '<br><b>' . $langs->trans("Name") . ':</b> '.$this->getFullName($langs); $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">'; $link = '<a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$this->id.$moreparam.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>'; $linkend='</a>';

View File

@@ -666,7 +666,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
print "</tr>"; 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 .= ", p.civility as civility_id, p.address, p.zip, p.town";
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p"; $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p";
$sql .= " WHERE p.fk_soc = ".$object->id; $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); dol_syslog('core/lib/company.lib.php :: show_contacts', LOG_DEBUG);
$result = $db->query($sql); $result = $db->query($sql);
if (! $result) dol_print_error($db);
$num = $db->num_rows($result); $num = $db->num_rows($result);
$var=true; $var=true;
@@ -695,6 +697,14 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
$contactstatic->lastname = $obj->lastname; $contactstatic->lastname = $obj->lastname;
$contactstatic->firstname = $obj->firstname; $contactstatic->firstname = $obj->firstname;
$contactstatic->civility_id = $obj->civility_id; $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 $contactstatic->getNomUrl(1,'',0,'&backtopage='.urlencode($backtopage));
print '</td><td>'; print '</td><td>';
if ($obj->poste) print $obj->poste; if ($obj->poste) print $obj->poste;
@@ -719,11 +729,13 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
print '</a> '; print '</a> ';
} }
if ($coords) { print dol_print_address($coords,'address_contact_'.$obj->rowid, 'contact', $obj->rowid); $outdone++; } 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_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->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++; } 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>'; print '<div style="clear: both;"></div>';
$outdone=0; $outdone=0;
if ($obj->email) print dol_print_email($obj->email,$obj->rowid,$object->id,'AC_EMAIL',0,0,1); if ($obj->email) print dol_print_email($obj->email,$obj->rowid,$object->id,'AC_EMAIL',0,0,1);

View File

@@ -877,6 +877,7 @@ function dol_bc($var,$moreclass='')
* @param string $sep Separator to use to build string * @param string $sep Separator to use to build string
* @param Translate $outputlangs Object lang that contains language for text translation. * @param Translate $outputlangs Object lang that contains language for text translation.
* @return string Formated string * @return string Formated string
* @see dol_print_address
*/ */
function dol_format_address($object,$withcountry=0,$sep="\n",$outputlangs='') 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 $mode thirdparty|contact|member|other
* @param int $id Id of object * @param int $id Id of object
* @return void * @return void
* @see dol_format_address
*/ */
function dol_print_address($address, $htmlid, $mode, $id) function dol_print_address($address, $htmlid, $mode, $id)
{ {