diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 21cc57e86e2..56c32847e62 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1918,16 +1918,16 @@ function top_menu_user($hideloginname = 0, $urllogout = '') '; if ($conf->theme != 'md') { - $btnUser .= ' - $("#topmenu-login-dropdown .dropdown-toggle").on("click", function(event) { - console.log("toggle login dropdown"); - event.preventDefault(); - $("#topmenu-login-dropdown").toggleClass("open"); - }); + $btnUser .= ' + $("#topmenu-login-dropdown .dropdown-toggle").on("click", function(event) { + console.log("toggle login dropdown"); + event.preventDefault(); + $("#topmenu-login-dropdown").toggleClass("open"); + }); - $("#topmenuloginmoreinfo-btn").on("click", function() { - $("#topmenuloginmoreinfo").slideToggle(); - });'; + $("#topmenuloginmoreinfo-btn").on("click", function() { + $("#topmenuloginmoreinfo").slideToggle(); + });'; } $btnUser .= ' diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 89b0d0acf12..29fd1d99980 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -766,38 +766,38 @@ class MyObject extends CommonObject $result .= $linkstart; - if (empty($this->showphoto_on_popup)) { - if ($withpicto) $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); - } else { - if ($withpicto) { - require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; + if (empty($this->showphoto_on_popup)) { + if ($withpicto) $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); + } else { + if ($withpicto) { + require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; - list($class, $module) = explode('@', $this->picto); - $upload_dir = $conf->$module->multidir_output[$conf->entity] . "/$class/" . dol_sanitizeFileName($this->ref); - $filearray = dol_dir_list($upload_dir, "files"); - $filename = $filearray[0]['name']; - if(!empty($filename)){ - $pospoint = strpos($filearray[0]['name'], '.'); + list($class, $module) = explode('@', $this->picto); + $upload_dir = $conf->$module->multidir_output[$conf->entity] . "/$class/" . dol_sanitizeFileName($this->ref); + $filearray = dol_dir_list($upload_dir, "files"); + $filename = $filearray[0]['name']; + if(!empty($filename)){ + $pospoint = strpos($filearray[0]['name'], '.'); - $pathtophoto = $class . '/' . $this->ref . '/thumbs/' . substr($filename, 0, $pospoint) . '_mini' . substr($filename, $pospoint); - if (empty($conf->global->{strtoupper($module.'_'.$class).'_FORMATLISTPHOTOSASUSERS'})) { - $result .= '
No photo
'; - } - else { - $result .= '
No photo
'; - } + $pathtophoto = $class . '/' . $this->ref . '/thumbs/' . substr($filename, 0, $pospoint) . '_mini' . substr($filename, $pospoint); + if (empty($conf->global->{strtoupper($module.'_'.$class).'_FORMATLISTPHOTOSASUSERS'})) { + $result .= '
No photo
'; + } + else { + $result .= '
No photo
'; + } - $result .= ''; - } - else { - $result.=img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1); - } - } - } + $result .= ''; + } + else { + $result.=img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1); + } + } + } - if ($withpicto != 2) $result .= $this->ref; + if ($withpicto != 2) $result .= $this->ref; - $result .= $linkend; + $result .= $linkend; //if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : ''); global $action, $hookmanager;