From 918e570e7a1bceb7b19d84d035a999e4e68c159e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Feb 2020 12:56:08 +0100 Subject: [PATCH] FIX Picture of contact not visible in tooltip --- htdocs/contact/class/contact.class.php | 11 +++++++++-- htdocs/contact/list.php | 6 ++++-- htdocs/societe/class/societe.class.php | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 465dc4a1e16..9c6602f7a2e 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -1272,9 +1272,16 @@ class Contact extends CommonObject { global $conf, $langs, $hookmanager; - $result = ''; + $result = ''; $label = ''; - $label = ''.$langs->trans("ShowContact").''; + if (!empty($this->photo) && class_exists('Form')) + { + $label .= '
'; + $label .= Form::showphoto('contact', $this, 0, 40, 0, '', 'mini', 0); // Important, we must force height so image will have height tags and if image is inside a tooltip, the tooltip manager can calculate height and position correctly the tooltip. + $label .= '
'; + } + + $label .= ''.$langs->trans("ShowContact").''; $label .= '
'.$langs->trans("Name").': '.$this->getFullName($langs); //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; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 1d0c3839f4f..9903e37cd5e 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -290,7 +290,7 @@ $title = (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("C $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,"; -$sql .= " p.socialnetworks,"; +$sql .= " p.socialnetworks, p.photo,"; $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.label as country, co.code as country_code"; // Add fields from extrafields @@ -786,7 +786,6 @@ while ($i < min($num, $limit)) { $obj = $db->fetch_object($result); - print ''; $arraysocialnetworks = (array) json_decode($obj->socialnetworks, true); $contactstatic->lastname = $obj->lastname; $contactstatic->firstname = ''; @@ -802,6 +801,9 @@ while ($i < min($num, $limit)) $contactstatic->socialnetworks = $arraysocialnetworks; $contactstatic->country = $obj->country; $contactstatic->country_code = $obj->country_code; + $contactstatic->photo = $obj->photo; + + print ''; // ID if (!empty($arrayfields['p.rowid']['checked'])) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 6f9b9ad26b8..2fa87eb8086 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2252,7 +2252,7 @@ class Societe extends CommonObject if (!empty($this->logo) && class_exists('Form')) { $label .= '
'; - $label .= Form::showphoto('societe', $this, 0, 40, 0, 'photowithmargin', 'mini', 0); // Important, we must force height so image will have height tags and if image is inside a tooltip, the tooltip manager can calculate height and position correctly the tooltip. + $label .= Form::showphoto('societe', $this, 0, 40, 0, '', 'mini', 0); // Important, we must force height so image will have height tags and if image is inside a tooltip, the tooltip manager can calculate height and position correctly the tooltip. $label .= '
'; } elseif (!empty($this->logo_squarred) && class_exists('Form'))