Reduce number of new to save memory usage.

Fight table to replace with div
This commit is contained in:
Laurent Destailleur 2015-02-01 00:54:26 +01:00
parent 34cbcad9da
commit 1e38227c2d
2 changed files with 19 additions and 12 deletions

View File

@ -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.= '<br><br>';
$label.= '</div><div style="padding: 10px">';
//if (! is_object($form)) $form = new Form($db);
$label.= Form::showphoto('societe', $this, 80);
}

View File

@ -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 = '<u>' . $langs->trans("User") . '</u>';
$label.= '<table class="login" width="100%">';
$label.= '<tr>';
$label.= '<td valign="top">';
$label.= '<div width="100%">';
$label .= '<b>' . $langs->trans('Name') . ':</b> ' . $this->getFullName($langs,'','',24);
if (! empty($this->login))
$label .= '<br><b>' . $langs->trans('Login') . ':</b> ' . $this->login;
@ -1808,14 +1807,17 @@ class User extends CommonObject
}
$type=($this->societe_id?$langs->trans("External").$company:$langs->trans("Internal"));
$label .= '<br><b>' . $langs->trans("Type") . ':</b> ' . $type;
if (! empty($this->photo)) {
$form = new Form($db);
$label .= '<td>&nbsp;&nbsp;</td><td align="right">' . $form->showphoto('userphoto', $this, 80) . '</td>';
if (! empty($this->photo))
{
$label.= '</div><div style="padding: 10px">';
//if (! is_object($form)) $form = new Form($db);
$label.= Form::showphoto('userphoto', $this, 80);
}
$label.= '</tr></table>';
$label.= '</div>';
// Info Login
if ($infologin) {
if ($infologin)
{
$label.= '<br>';
$label.= '<br><u>'.$langs->trans("Connection").'</u>';
$label.= '<br><b>'.$langs->trans("IPAddress").'</b>: '.$_SERVER["REMOTE_ADDR"];
@ -1833,10 +1835,13 @@ class User extends CommonObject
}
$lien = '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lien = '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$this->id.'"';
$lien.= ($notooltip?'':' title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip"');
$lien.= '>';
$lienfin='</a>';
if ($withpicto) {
if ($withpicto)
{
$result.=($lien.img_object($label, 'user', 'class="classfortooltip"').$lienfin);
if ($withpicto != 2) $result.=' ';
}