diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index e1403b25578..fc77bd64356 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -1162,11 +1162,11 @@ class Contact extends CommonObject //if ($this->civility_id) $label.= '
' . $langs->trans("Civility") . ': '.$this->civility_id; // TODO Translate cibilty_id code if (! empty($this->poste)) $label.= '
' . $langs->trans("Poste") . ': '.$this->poste; $label.= '
' . $langs->trans("EMail") . ': '.$this->email; - $phonelist=array(); - if ($this->phone_pro) $phonelist[]=$this->phone_pro; - if ($this->phone_mobile) $phonelist[]=$this->phone_mobile; - if ($this->phone_perso) $phonelist[]=$this->phone_perso; - $label.= '
' . $langs->trans("Phone") . ': '.join(', ', $phonelist); + $phonelist = array(); + if ($this->phone_pro) $phonelist[] = dol_print_phone($this->phone_pro, $this->country_code, $this->id, 0, '', ' ', 'phone'); + if ($this->phone_mobile) $phonelist[] = dol_print_phone($this->phone_mobile, $this->country_code, $this->id, 0, '', ' ', 'mobile'); + if ($this->phone_perso) $phonelist[] = dol_print_phone($this->phone_perso, $this->country_code, $this->id, 0, '', ' ', 'phone'); + $label.= '
' . $langs->trans("Phone") . ': '.implode(' ', $phonelist); $label.= '
' . $langs->trans("Address") . ': '.dol_format_address($this, 1, ' ', $langs); $url = DOL_URL_ROOT.'/contact/card.php?id='.$this->id; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index d31766578b2..a08af2a0fdb 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -277,7 +277,7 @@ $title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans(" $sql = "SELECT s.rowid as socid, s.nom as name,"; $sql.= " p.rowid, p.lastname as lastname, p.statut, p.firstname, p.zip, p.town, p.poste, p.email, p.no_email, p.skype,"; $sql.= " p.phone as phone_pro, p.phone_mobile, p.phone_perso, p.fax, p.fk_pays, p.priv, p.datec as date_creation, p.tms as date_update,"; -$sql.= " co.code as country_code"; +$sql.= " co.label as country, co.code as country_code"; // Add fields from extrafields if (! empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : ''); @@ -796,6 +796,8 @@ while ($i < min($num, $limit)) $contactstatic->phone_mobile=$obj->phone_mobile; $contactstatic->zip=$obj->zip; $contactstatic->town=$obj->town; + $contactstatic->country = $obj->country; + $contactstatic->country_code = $obj->country_code; // ID if (! empty($arrayfields['p.rowid']['checked'])) diff --git a/htdocs/core/boxes/box_contacts.php b/htdocs/core/boxes/box_contacts.php index 82db6c9f240..09e33c5f6a8 100644 --- a/htdocs/core/boxes/box_contacts.php +++ b/htdocs/core/boxes/box_contacts.php @@ -86,7 +86,9 @@ class box_contacts extends ModeleBoxes $sql.= ", sp.address, sp.zip, sp.town, sp.phone, sp.phone_perso, sp.phone_mobile, sp.email as spemail"; $sql.= ", s.nom as socname, s.name_alias, s.email as semail"; $sql.= ", s.client, s.fournisseur, s.code_client, s.code_fournisseur"; + $sql.= ", co.label as country, co.code as country_code"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON sp.fk_pays = co.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON sp.fk_soc = s.rowid"; if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE sp.entity IN (".getEntity('socpeople').")"; @@ -121,6 +123,8 @@ class box_contacts extends ModeleBoxes $contactstatic->address = $objp->address; $contactstatic->zip = $objp->zip; $contactstatic->town = $objp->town; + $contactstatic->country = $objp->country; + $contactstatic->country_code = $objp->country_code; $societestatic->id = $objp->fk_soc; $societestatic->name = $objp->socname;