From a72e36cd013bb95c23a0e0d422621713a51a39db Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 10 Jun 2019 20:05:49 +0200 Subject: [PATCH] Fix show version removed from left menu --- htdocs/main.inc.php | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 319ee2dc363..d283abd7d15 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1695,12 +1695,8 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead if ($mode == 'wiki') $text.=sprintf($helpbaseurl, urlencode(html_entity_decode($helppage))); else $text.=sprintf($helpbaseurl, $helppage); $text.='">'; - //$text.=img_picto('', 'helpdoc_top').' '; $text.=''; - //$toprightmenu.=$langs->trans($mode == 'wiki' ? 'OnlineHelp': 'Help'); - //if ($mode == 'wiki') $text.=' ('.dol_trunc(strtr($helppage,'_',' '),8).')'; $text.=''; - //$toprightmenu.=''."\n"; $toprightmenu.=@Form::textwithtooltip('', $title, 2, 1, $text, 'login_block_elem', 2); } } @@ -1815,6 +1811,19 @@ function top_menu_user(User $user, Translate $langs) $profilName = ' '.$profilName; } + // Define version to show + $appli=constant('DOL_APPLICATION_TITLE'); + if (! empty($conf->global->MAIN_APPLICATION_TITLE)) + { + $appli=$conf->global->MAIN_APPLICATION_TITLE; + if (preg_match('/\d\.\d/', $appli)) + { + if (! preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) $appli.=" (".DOL_VERSION.")"; // If new title contains a version that is different than core + } + else $appli.=" ".DOL_VERSION; + } + else $appli.=" ".DOL_VERSION; + $btnUser = '