FIX Picture of contact not visible in tooltip

This commit is contained in:
Laurent Destailleur 2020-02-10 12:56:08 +01:00
parent 07fbaa02d1
commit 918e570e7a
3 changed files with 14 additions and 5 deletions

View File

@ -1272,9 +1272,16 @@ class Contact extends CommonObject
{
global $conf, $langs, $hookmanager;
$result = '';
$result = ''; $label = '';
$label = '<u>'.$langs->trans("ShowContact").'</u>';
if (!empty($this->photo) && class_exists('Form'))
{
$label .= '<div class="photointooltip">';
$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 .= '</div><div style="clear: both;"></div>';
}
$label .= '<u>'.$langs->trans("ShowContact").'</u>';
$label .= '<br><b>'.$langs->trans("Name").':</b> '.$this->getFullName($langs);
//if ($this->civility_id) $label.= '<br><b>' . $langs->trans("Civility") . ':</b> '.$this->civility_id; // TODO Translate cibilty_id code
if (!empty($this->poste)) $label .= '<br><b>'.$langs->trans("Poste").':</b> '.$this->poste;

View File

@ -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 '<tr class="oddeven">';
$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 '<tr class="oddeven">';
// ID
if (!empty($arrayfields['p.rowid']['checked']))

View File

@ -2252,7 +2252,7 @@ class Societe extends CommonObject
if (!empty($this->logo) && class_exists('Form'))
{
$label .= '<div class="photointooltip">';
$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 .= '</div><div style="clear: both;"></div>';
}
elseif (!empty($this->logo_squarred) && class_exists('Form'))