From 1e38227c2d74719480d0cd856e884326aae27331 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 1 Feb 2015 00:54:26 +0100 Subject: [PATCH] Reduce number of new to save memory usage. Fight table to replace with div --- htdocs/societe/class/societe.class.php | 4 +++- htdocs/user/class/user.class.php | 27 +++++++++++++++----------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index fbba2bce18b..25242e4160f 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1709,6 +1709,8 @@ class Societe extends CommonObject $name=$this->name?$this->name:$this->nom; + if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; + if ($conf->global->SOCIETE_ADD_REF_IN_LIST && (!empty($withpicto))) { if (($this->client) && (! empty ( $this->code_client ))) { $code = $this->code_client . ' - '; @@ -1766,7 +1768,7 @@ class Societe extends CommonObject if (! empty($this->logo)) { - $label.= '

'; + $label.= '
'; //if (! is_object($form)) $form = new Form($db); $label.= Form::showphoto('societe', $this, 80); } diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index ee43d8c48af..96d3a26e9a9 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1778,9 +1778,10 @@ class User extends CommonObject * @param int $withpicto Include picto in link (0=No picto, 1=Inclut le picto dans le lien, 2=Picto seul) * @param string $option On what the link point to * @param boolean $infologin Add connection info to the tooltip + * @param string $notooltip 1=Disable tooltip * @return string String with URL */ - function getNomUrl($withpicto=0, $option='', $infologin=0) + function getNomUrl($withpicto=0, $option='', $infologin=0, $notooltip=0) { global $langs, $conf, $db; global $dolibarr_main_authentication, $dolibarr_main_demo; @@ -1790,9 +1791,7 @@ class User extends CommonObject $companylink = ''; $label = '' . $langs->trans("User") . ''; - $label.= ''; - $label.= ''; - $label.= ''; + if (! empty($this->photo)) + { + $label.= '
'; + //if (! is_object($form)) $form = new Form($db); + $label.= Form::showphoto('userphoto', $this, 80); } - $label.= '
'; + $label.= '
'; // Info Login - if ($infologin) { + if ($infologin) + { $label.= '
'; $label.= '
'.$langs->trans("Connection").''; $label.= '
'.$langs->trans("IPAddress").': '.$_SERVER["REMOTE_ADDR"]; @@ -1833,10 +1835,13 @@ class User extends CommonObject } - $lien = ''; + $lien = '