forked from Wavyzz/dolibarr
Fix warnings
This commit is contained in:
@@ -361,7 +361,7 @@ require_once 'master.inc.php';
|
||||
// include DOL_DOCUMENT_ROOT.'/core/lib/phpsessionindb.inc.php
|
||||
|
||||
// If software has been locked. Only login $conf->global->MAIN_ONLY_LOGIN_ALLOWED is allowed.
|
||||
if (!empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED)) {
|
||||
if (getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')) {
|
||||
$ok = 0;
|
||||
if ((!session_id() || !isset($_SESSION["dol_login"])) && !isset($_POST["username"]) && !empty($_SERVER["GATEWAY_INTERFACE"])) {
|
||||
$ok = 1; // We let working pages if not logged and inside a web browser (login form, to allow login by admin)
|
||||
@@ -377,11 +377,11 @@ if (!empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED)) {
|
||||
if (!$ok) {
|
||||
if (session_id() && isset($_SESSION["dol_login"]) && $_SESSION["dol_login"] != $conf->global->MAIN_ONLY_LOGIN_ALLOWED) {
|
||||
print 'Sorry, your application is offline.'."\n";
|
||||
print 'You are logged with user "'.$_SESSION["dol_login"].'" and only administrator user "'.$conf->global->MAIN_ONLY_LOGIN_ALLOWED.'" is allowed to connect for the moment.'."\n";
|
||||
print 'You are logged with user "'.$_SESSION["dol_login"].'" and only administrator user "' . getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED').'" is allowed to connect for the moment.'."\n";
|
||||
$nexturl = DOL_URL_ROOT.'/user/logout.php?token='.newToken();
|
||||
print 'Please try later or <a href="'.$nexturl.'">click here to disconnect and change login user</a>...'."\n";
|
||||
} else {
|
||||
print 'Sorry, your application is offline. Only administrator user "'.$conf->global->MAIN_ONLY_LOGIN_ALLOWED.'" is allowed to connect for the moment.'."\n";
|
||||
print 'Sorry, your application is offline. Only administrator user "' . getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED').'" is allowed to connect for the moment.'."\n";
|
||||
$nexturl = DOL_URL_ROOT.'/';
|
||||
print 'Please try later or <a href="'.$nexturl.'">click here to change login user</a>...'."\n";
|
||||
}
|
||||
@@ -399,7 +399,7 @@ if (isModEnabled('debugbar') && !GETPOST('dol_use_jmobile') && empty($_SESSION['
|
||||
include_once DOL_DOCUMENT_ROOT.'/debugbar/class/DebugBar.php';
|
||||
$debugbar = new DolibarrDebugBar();
|
||||
$renderer = $debugbar->getRenderer();
|
||||
if (empty($conf->global->MAIN_HTML_HEADER)) {
|
||||
if (!getDolGlobalString('MAIN_HTML_HEADER')) {
|
||||
$conf->global->MAIN_HTML_HEADER = '';
|
||||
}
|
||||
$conf->global->MAIN_HTML_HEADER .= $renderer->renderHead();
|
||||
@@ -486,21 +486,21 @@ if (!defined('NOREQUIREAJAX')) {
|
||||
}
|
||||
|
||||
// If install or upgrade process not done or not completely finished, we call the install page.
|
||||
if (!empty($conf->global->MAIN_NOT_INSTALLED) || !empty($conf->global->MAIN_NOT_UPGRADED)) {
|
||||
if (getDolGlobalString('MAIN_NOT_INSTALLED') || getDolGlobalString('MAIN_NOT_UPGRADED')) {
|
||||
dol_syslog("main.inc: A previous install or upgrade was not complete. Redirect to install page.", LOG_WARNING);
|
||||
header("Location: ".DOL_URL_ROOT."/install/index.php");
|
||||
exit;
|
||||
}
|
||||
// If an upgrade process is required, we call the install page.
|
||||
if ((!empty($conf->global->MAIN_VERSION_LAST_UPGRADE) && ($conf->global->MAIN_VERSION_LAST_UPGRADE != DOL_VERSION))
|
||||
|| (empty($conf->global->MAIN_VERSION_LAST_UPGRADE) && !empty($conf->global->MAIN_VERSION_LAST_INSTALL) && ($conf->global->MAIN_VERSION_LAST_INSTALL != DOL_VERSION))) {
|
||||
$versiontocompare = empty($conf->global->MAIN_VERSION_LAST_UPGRADE) ? $conf->global->MAIN_VERSION_LAST_INSTALL : $conf->global->MAIN_VERSION_LAST_UPGRADE;
|
||||
if ((getDolGlobalString('MAIN_VERSION_LAST_UPGRADE') && ($conf->global->MAIN_VERSION_LAST_UPGRADE != DOL_VERSION))
|
||||
|| (!getDolGlobalString('MAIN_VERSION_LAST_UPGRADE') && getDolGlobalString('MAIN_VERSION_LAST_INSTALL') && ($conf->global->MAIN_VERSION_LAST_INSTALL != DOL_VERSION))) {
|
||||
$versiontocompare = !getDolGlobalString('MAIN_VERSION_LAST_UPGRADE') ? $conf->global->MAIN_VERSION_LAST_INSTALL : $conf->global->MAIN_VERSION_LAST_UPGRADE;
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
$dolibarrversionlastupgrade = preg_split('/[.-]/', $versiontocompare);
|
||||
$dolibarrversionprogram = preg_split('/[.-]/', DOL_VERSION);
|
||||
$rescomp = versioncompare($dolibarrversionprogram, $dolibarrversionlastupgrade);
|
||||
if ($rescomp > 0) { // Programs have a version higher than database.
|
||||
if (empty($conf->global->MAIN_NO_UPGRADE_REDIRECT_ON_LEVEL_3_CHANGE) || $rescomp < 3) {
|
||||
if (!getDolGlobalString('MAIN_NO_UPGRADE_REDIRECT_ON_LEVEL_3_CHANGE') || $rescomp < 3) {
|
||||
// We did not add "&& $rescomp < 3" because we want upgrade process for build upgrades
|
||||
dol_syslog("main.inc: database version ".$versiontocompare." is lower than programs version ".DOL_VERSION.". Redirect to install/upgrade page.", LOG_WARNING);
|
||||
header("Location: ".DOL_URL_ROOT."/install/index.php");
|
||||
@@ -582,8 +582,8 @@ if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && getDolGlobalInt(
|
||||
dol_syslog("--- Access to ".(empty($_SERVER["REQUEST_METHOD"]) ? '' : $_SERVER["REQUEST_METHOD"].' ').$_SERVER["PHP_SELF"]." refused by CSRF protection (POST method or GET with a sensible value for 'action' parameter) in main.inc.php. Token not provided.", LOG_WARNING);
|
||||
print "Access to this page this way (POST method or GET with a sensible value for 'action' parameter) is refused by CSRF protection in main.inc.php. Token not provided.\n";
|
||||
print "If you access your server behind a proxy using url rewriting and the parameter is provided by caller, you might check that all HTTP header are propagated (or add the line \$dolibarr_nocsrfcheck=1 into your conf.php file or MAIN_SECURITY_CSRF_WITH_TOKEN to 0";
|
||||
if (!empty($conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN)) {
|
||||
print " instead of ".$conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN;
|
||||
if (getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN')) {
|
||||
print " instead of " . getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN');
|
||||
}
|
||||
print " into setup).\n";
|
||||
}
|
||||
@@ -740,7 +740,7 @@ if (!defined('NOLOGIN')) {
|
||||
}
|
||||
|
||||
// Verification security graphic code
|
||||
if ($test && GETPOST("username", "alpha", 2) && !empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA) && !isset($_SESSION['dol_bypass_antispam'])) {
|
||||
if ($test && GETPOST("username", "alpha", 2) && getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA') && !isset($_SESSION['dol_bypass_antispam'])) {
|
||||
$sessionkey = 'dol_antispam_value';
|
||||
$ok = (array_key_exists($sessionkey, $_SESSION) === true && (strtolower($_SESSION[$sessionkey]) === strtolower(GETPOST('code', 'restricthtml'))));
|
||||
|
||||
@@ -809,7 +809,7 @@ if (!defined('NOLOGIN')) {
|
||||
if (!is_object($langs)) { // This can occurs when calling page with NOREQUIRETRAN defined, however we need langs for error messages.
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/translate.class.php';
|
||||
$langs = new Translate("", $conf);
|
||||
$langcode = (GETPOST('lang', 'aZ09', 1) ?GETPOST('lang', 'aZ09', 1) : (empty($conf->global->MAIN_LANG_DEFAULT) ? 'auto' : $conf->global->MAIN_LANG_DEFAULT));
|
||||
$langcode = (GETPOST('lang', 'aZ09', 1) ?GETPOST('lang', 'aZ09', 1) : (!getDolGlobalString('MAIN_LANG_DEFAULT') ? 'auto' : $conf->global->MAIN_LANG_DEFAULT));
|
||||
if (defined('MAIN_LANG_DEFAULT')) {
|
||||
$langcode = constant('MAIN_LANG_DEFAULT');
|
||||
}
|
||||
@@ -1183,7 +1183,7 @@ if (!defined('NOLOGIN')) {
|
||||
}
|
||||
|
||||
// Change landing page if defined.
|
||||
$landingpage = (empty($user->conf->MAIN_LANDING_PAGE) ? (empty($conf->global->MAIN_LANDING_PAGE) ? '' : $conf->global->MAIN_LANDING_PAGE) : $user->conf->MAIN_LANDING_PAGE);
|
||||
$landingpage = (empty($user->conf->MAIN_LANDING_PAGE) ? (!getDolGlobalString('MAIN_LANDING_PAGE') ? '' : $conf->global->MAIN_LANDING_PAGE) : $user->conf->MAIN_LANDING_PAGE);
|
||||
if (!empty($landingpage)) { // Example: /index.php
|
||||
$newpath = dol_buildpath($landingpage, 1);
|
||||
if ($_SERVER["PHP_SELF"] != $newpath) { // not already on landing page (avoid infinite loop)
|
||||
@@ -1204,14 +1204,14 @@ if (!defined('NOLOGIN')) {
|
||||
$user->rights->user->self->password = 1;
|
||||
|
||||
//Required if advanced permissions are used with MAIN_USE_ADVANCED_PERMS
|
||||
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
|
||||
if (empty($user->rights->user->user_advance)) {
|
||||
if (getDolGlobalString('MAIN_USE_ADVANCED_PERMS')) {
|
||||
if (!$user->hasRight('user', 'user_advance')) {
|
||||
$user->rights->user->user_advance = new stdClass(); // To avoid warnings
|
||||
}
|
||||
if (empty($user->rights->user->self_advance)) {
|
||||
if (!$user->hasRight('user', 'self_advance')) {
|
||||
$user->rights->user->self_advance = new stdClass(); // To avoid warnings
|
||||
}
|
||||
if (empty($user->rights->user->group_advance)) {
|
||||
if (!$user->hasRight('user', 'group_advance')) {
|
||||
$user->rights->user->group_advance = new stdClass(); // To avoid warnings
|
||||
}
|
||||
|
||||
@@ -1239,7 +1239,7 @@ if (!defined('NOLOGIN')) {
|
||||
}
|
||||
|
||||
// Replace conf->css by personalized value if theme not forced
|
||||
if (empty($conf->global->MAIN_FORCETHEME) && !empty($user->conf->MAIN_THEME)) {
|
||||
if (!getDolGlobalString('MAIN_FORCETHEME') && !empty($user->conf->MAIN_THEME)) {
|
||||
$conf->theme = $user->conf->MAIN_THEME;
|
||||
$conf->css = "/theme/".$conf->theme."/style.css.php";
|
||||
}
|
||||
@@ -1267,7 +1267,7 @@ if (GETPOST('nojs', 'int')) { // If javascript was not disabled on URL
|
||||
}
|
||||
|
||||
// Set MAIN_OPTIMIZEFORTEXTBROWSER for user (must be after login part)
|
||||
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && !empty($user->conf->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
||||
if (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') && !empty($user->conf->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
||||
$conf->global->MAIN_OPTIMIZEFORTEXTBROWSER = $user->conf->MAIN_OPTIMIZEFORTEXTBROWSER;
|
||||
}
|
||||
|
||||
@@ -1299,7 +1299,7 @@ if (!empty($conf->browser->layout) && $conf->browser->layout != 'classic') {
|
||||
if ((!empty($conf->browser->layout) && $conf->browser->layout == 'phone')
|
||||
|| (!empty($_SESSION['dol_screenwidth']) && $_SESSION['dol_screenwidth'] < 400)
|
||||
|| (!empty($_SESSION['dol_screenheight']) && $_SESSION['dol_screenheight'] < 400
|
||||
|| !empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||
|| getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER'))
|
||||
) {
|
||||
$conf->dol_optimize_smallscreen = 1;
|
||||
|
||||
@@ -1394,10 +1394,10 @@ $heightforframes = 50;
|
||||
// Init menu manager
|
||||
if (!defined('NOREQUIREMENU')) {
|
||||
if (empty($user->socid)) { // If internal user or not defined
|
||||
$conf->standard_menu = (empty($conf->global->MAIN_MENU_STANDARD_FORCED) ? (empty($conf->global->MAIN_MENU_STANDARD) ? 'eldy_menu.php' : $conf->global->MAIN_MENU_STANDARD) : $conf->global->MAIN_MENU_STANDARD_FORCED);
|
||||
$conf->standard_menu = (!getDolGlobalString('MAIN_MENU_STANDARD_FORCED') ? (!getDolGlobalString('MAIN_MENU_STANDARD') ? 'eldy_menu.php' : $conf->global->MAIN_MENU_STANDARD) : $conf->global->MAIN_MENU_STANDARD_FORCED);
|
||||
} else {
|
||||
// If external user
|
||||
$conf->standard_menu = (empty($conf->global->MAIN_MENUFRONT_STANDARD_FORCED) ? (empty($conf->global->MAIN_MENUFRONT_STANDARD) ? 'eldy_menu.php' : $conf->global->MAIN_MENUFRONT_STANDARD) : $conf->global->MAIN_MENUFRONT_STANDARD_FORCED);
|
||||
$conf->standard_menu = (!getDolGlobalString('MAIN_MENUFRONT_STANDARD_FORCED') ? (!getDolGlobalString('MAIN_MENUFRONT_STANDARD') ? 'eldy_menu.php' : $conf->global->MAIN_MENUFRONT_STANDARD) : $conf->global->MAIN_MENUFRONT_STANDARD_FORCED);
|
||||
}
|
||||
|
||||
// Load the menu manager (only if not already done)
|
||||
@@ -1487,14 +1487,14 @@ if (!function_exists("llxHeader")) {
|
||||
|
||||
$tmpcsstouse = 'sidebar-collapse'.($morecssonbody ? ' '.$morecssonbody : '');
|
||||
// If theme MD and classic layer, we open the menulayer by default.
|
||||
if ($conf->theme == 'md' && !in_array($conf->browser->layout, array('phone', 'tablet')) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
||||
if ($conf->theme == 'md' && !in_array($conf->browser->layout, array('phone', 'tablet')) && !getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
|
||||
global $mainmenu;
|
||||
if ($mainmenu != 'website') {
|
||||
$tmpcsstouse = $morecssonbody; // We do not use sidebar-collpase by default to have menuhider open by default.
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($conf->global->MAIN_OPTIMIZEFORCOLORBLIND)) {
|
||||
if (getDolGlobalString('MAIN_OPTIMIZEFORCOLORBLIND')) {
|
||||
$tmpcsstouse .= ' colorblind-'.strip_tags($conf->global->MAIN_OPTIMIZEFORCOLORBLIND);
|
||||
}
|
||||
|
||||
@@ -1719,9 +1719,9 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
|
||||
print '<link rel="manifest" href="'.$manifest.'" />'."\n";
|
||||
}
|
||||
|
||||
if (!empty($conf->global->THEME_ELDY_TOPMENU_BACK1)) {
|
||||
if (getDolGlobalString('THEME_ELDY_TOPMENU_BACK1')) {
|
||||
// TODO: use auto theme color switch
|
||||
print '<meta name="theme-color" content="rgb('.$conf->global->THEME_ELDY_TOPMENU_BACK1.')">'."\n";
|
||||
print '<meta name="theme-color" content="rgb(' . getDolGlobalString('THEME_ELDY_TOPMENU_BACK1').')">'."\n";
|
||||
}
|
||||
|
||||
// Auto refresh page
|
||||
@@ -1731,13 +1731,13 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
|
||||
|
||||
// Displays title
|
||||
$appli = constant('DOL_APPLICATION_TITLE');
|
||||
if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
|
||||
if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
|
||||
$appli = $conf->global->MAIN_APPLICATION_TITLE;
|
||||
}
|
||||
|
||||
print '<title>';
|
||||
$titletoshow = '';
|
||||
if ($title && !empty($conf->global->MAIN_HTML_TITLE) && preg_match('/noapp/', $conf->global->MAIN_HTML_TITLE)) {
|
||||
if ($title && getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/noapp/', $conf->global->MAIN_HTML_TITLE)) {
|
||||
$titletoshow = dol_htmlentities($title);
|
||||
} elseif ($title) {
|
||||
$titletoshow = dol_htmlentities($appli.' - '.$title);
|
||||
@@ -1791,7 +1791,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
|
||||
$themeparam .= '&THEME_SATURATE_RATIO='.GETPOST('THEME_SATURATE_RATIO', 'int');
|
||||
}
|
||||
|
||||
if (!empty($conf->global->MAIN_ENABLE_FONT_ROBOTO)) {
|
||||
if (getDolGlobalString('MAIN_ENABLE_FONT_ROBOTO')) {
|
||||
print '<link rel="preconnect" href="https://fonts.gstatic.com">'."\n";
|
||||
print '<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@200;300;400;500;600&display=swap" rel="stylesheet">'."\n";
|
||||
}
|
||||
@@ -1799,7 +1799,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
|
||||
if (!defined('DISABLE_JQUERY') && !$disablejs && $conf->use_javascript_ajax) {
|
||||
print '<!-- Includes CSS for JQuery (Ajax library) -->'."\n";
|
||||
$jquerytheme = 'base';
|
||||
if (!empty($conf->global->MAIN_USE_JQUERY_THEME)) {
|
||||
if (getDolGlobalString('MAIN_USE_JQUERY_THEME')) {
|
||||
$jquerytheme = $conf->global->MAIN_USE_JQUERY_THEME;
|
||||
}
|
||||
if (constant('JS_JQUERY_UI')) {
|
||||
@@ -1810,8 +1810,8 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
|
||||
if (!defined('DISABLE_JQUERY_JNOTIFY')) {
|
||||
print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/jnotify/jquery.jnotify-alt.min.css'.($ext ? '?'.$ext : '').'">'."\n"; // JNotify
|
||||
}
|
||||
if (!defined('DISABLE_SELECT2') && (!empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT'))) { // jQuery plugin "mutiselect", "multiple-select", "select2"...
|
||||
$tmpplugin = empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) ?constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT;
|
||||
if (!defined('DISABLE_SELECT2') && (getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT'))) { // jQuery plugin "mutiselect", "multiple-select", "select2"...
|
||||
$tmpplugin = !getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') ?constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT;
|
||||
print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/'.$tmpplugin.'/dist/css/'.$tmpplugin.'.css'.($ext ? '?'.$ext : '').'">'."\n";
|
||||
}
|
||||
}
|
||||
@@ -1838,7 +1838,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
|
||||
|
||||
//print 'themepath='.$themepath.' themeparam='.$themeparam;exit;
|
||||
print '<link rel="stylesheet" type="text/css" href="'.$themepath.$themeparam.'">'."\n";
|
||||
if (!empty($conf->global->MAIN_FIX_FLASH_ON_CHROME)) {
|
||||
if (getDolGlobalString('MAIN_FIX_FLASH_ON_CHROME')) {
|
||||
print '<!-- Includes CSS that does not exists as a workaround of flash bug of chrome -->'."\n".'<link rel="stylesheet" type="text/css" href="filethatdoesnotexiststosolvechromeflashbug">'."\n";
|
||||
}
|
||||
|
||||
@@ -1904,7 +1904,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
|
||||
print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery-ui.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
|
||||
}
|
||||
// jQuery jnotify
|
||||
if (empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) && !defined('DISABLE_JQUERY_JNOTIFY')) {
|
||||
if (!getDolGlobalString('MAIN_DISABLE_JQUERY_JNOTIFY') && !defined('DISABLE_JQUERY_JNOTIFY')) {
|
||||
print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jnotify/jquery.jnotify.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
|
||||
}
|
||||
// Table drag and drop lines
|
||||
@@ -1912,12 +1912,12 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
|
||||
print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/tablednd/jquery.tablednd.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
|
||||
}
|
||||
// Chart
|
||||
if (empty($disableforlogin) && (empty($conf->global->MAIN_JS_GRAPH) || getDolGlobalString('MAIN_JS_GRAPH') == 'chart') && !defined('DISABLE_JS_GRAPH')) {
|
||||
if (empty($disableforlogin) && (!getDolGlobalString('MAIN_JS_GRAPH') || getDolGlobalString('MAIN_JS_GRAPH') == 'chart') && !defined('DISABLE_JS_GRAPH')) {
|
||||
print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/nnnick/chartjs/dist/chart.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
|
||||
}
|
||||
|
||||
// jQuery jeditable for Edit In Place features
|
||||
if (!empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && !defined('DISABLE_JQUERY_JEDITABLE')) {
|
||||
if (getDolGlobalString('MAIN_USE_JQUERY_JEDITABLE') && !defined('DISABLE_JQUERY_JEDITABLE')) {
|
||||
print '<!-- JS to manage editInPlace feature -->'."\n";
|
||||
print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
|
||||
print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.ui-datepicker.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
|
||||
@@ -1936,13 +1936,13 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
|
||||
print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.ckeditor.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
|
||||
}
|
||||
// jQuery Timepicker
|
||||
if (!empty($conf->global->MAIN_USE_JQUERY_TIMEPICKER) || defined('REQUIRE_JQUERY_TIMEPICKER')) {
|
||||
if (getDolGlobalString('MAIN_USE_JQUERY_TIMEPICKER') || defined('REQUIRE_JQUERY_TIMEPICKER')) {
|
||||
print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/timepicker/jquery-ui-timepicker-addon.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
|
||||
print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/core/js/timepicker.js.php?lang='.$langs->defaultlang.($ext ? '&'.$ext : '').'"></script>'."\n";
|
||||
}
|
||||
if (!defined('DISABLE_SELECT2') && (!empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT'))) {
|
||||
if (!defined('DISABLE_SELECT2') && (getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT'))) {
|
||||
// jQuery plugin "mutiselect", "multiple-select", "select2", ...
|
||||
$tmpplugin = empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) ?constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT;
|
||||
$tmpplugin = !getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') ?constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT;
|
||||
print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/'.$tmpplugin.'/dist/js/'.$tmpplugin.'.full.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n"; // We include full because we need the support of containerCssClass
|
||||
}
|
||||
if (!defined('DISABLE_MULTISELECT')) { // jQuery plugin "mutiselect" to select with checkboxes. Can be removed once we have an enhanced search tool
|
||||
@@ -1952,7 +1952,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
|
||||
|
||||
if (!$disablejs && !empty($conf->use_javascript_ajax)) {
|
||||
// CKEditor
|
||||
if (empty($disableforlogin) && (isModEnabled('fckeditor') && (empty($conf->global->FCKEDITOR_EDITORNAME) || getDolGlobalString('FCKEDITOR_EDITORNAME') == 'ckeditor') && !defined('DISABLE_CKEDITOR')) || defined('FORCE_CKEDITOR')) {
|
||||
if (empty($disableforlogin) && (isModEnabled('fckeditor') && (!getDolGlobalString('FCKEDITOR_EDITORNAME') || getDolGlobalString('FCKEDITOR_EDITORNAME') == 'ckeditor') && !defined('DISABLE_CKEDITOR')) || defined('FORCE_CKEDITOR')) {
|
||||
print '<!-- Includes JS for CKEditor -->'."\n";
|
||||
$pathckeditor = DOL_URL_ROOT.'/includes/ckeditor/ckeditor/';
|
||||
$jsckeditor = 'ckeditor.js';
|
||||
@@ -1980,7 +1980,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
|
||||
// Browser notifications (if NOREQUIREMENU is on, it is mostly a page for popup, so we do not enable notif too. We hide also for public pages).
|
||||
if (!defined('NOBROWSERNOTIF') && !defined('NOREQUIREMENU') && !defined('NOLOGIN')) {
|
||||
$enablebrowsernotif = false;
|
||||
if (isModEnabled('agenda') && !empty($conf->global->AGENDA_REMINDER_BROWSER)) {
|
||||
if (isModEnabled('agenda') && getDolGlobalString('AGENDA_REMINDER_BROWSER')) {
|
||||
$enablebrowsernotif = true;
|
||||
}
|
||||
if ($conf->browser->layout == 'phone') {
|
||||
@@ -2027,7 +2027,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
|
||||
}
|
||||
|
||||
//If you want to load custom javascript file from your selected theme directory
|
||||
if (!empty($conf->global->ALLOW_THEME_JS)) {
|
||||
if (getDolGlobalString('ALLOW_THEME_JS')) {
|
||||
$theme_js = dol_buildpath('/theme/'.$conf->theme.'/'.$conf->theme.'.js', 0);
|
||||
if (file_exists($theme_js)) {
|
||||
print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/'.$conf->theme.'.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
|
||||
@@ -2037,8 +2037,8 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
|
||||
if (!empty($head)) {
|
||||
print $head."\n";
|
||||
}
|
||||
if (!empty($conf->global->MAIN_HTML_HEADER)) {
|
||||
print $conf->global->MAIN_HTML_HEADER."\n";
|
||||
if (getDolGlobalString('MAIN_HTML_HEADER')) {
|
||||
print getDolGlobalString('MAIN_HTML_HEADER') . "\n";
|
||||
}
|
||||
|
||||
$parameters = array();
|
||||
@@ -2102,14 +2102,14 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
|
||||
print '<header id="id-top" class="side-nav-vert'.(GETPOST('dol_invisible_topmenu', 'int') ? ' hidden' : '').'">'; // dol_invisible_topmenu differs from dol_hide_topmenu: dol_invisible_topmenu means we output menu but we make it invisible.
|
||||
|
||||
// Show menu entries
|
||||
print '<div id="tmenu_tooltip'.(empty($conf->global->MAIN_MENU_INVERT) ? '' : 'invert').'" class="tmenu">'."\n";
|
||||
print '<div id="tmenu_tooltip'.(!getDolGlobalString('MAIN_MENU_INVERT') ? '' : 'invert').'" class="tmenu">'."\n";
|
||||
$menumanager->atarget = $target;
|
||||
$menumanager->showmenu('top', array('searchform'=>$searchform)); // This contains a \n
|
||||
print "</div>\n";
|
||||
|
||||
// Define link to login card
|
||||
$appli = constant('DOL_APPLICATION_TITLE');
|
||||
if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
|
||||
if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
|
||||
$appli = $conf->global->MAIN_APPLICATION_TITLE;
|
||||
if (preg_match('/\d\.\d/', $appli)) {
|
||||
if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) {
|
||||
@@ -2128,7 +2128,7 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
|
||||
|
||||
$logouttext = '';
|
||||
$logouthtmltext = '';
|
||||
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
||||
if (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
|
||||
//$logouthtmltext=$appli.'<br>';
|
||||
$stringforfirstkey = $langs->trans("KeyboardShortcut");
|
||||
if ($conf->browser->name == 'chrome') {
|
||||
@@ -2176,7 +2176,7 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
|
||||
}
|
||||
|
||||
// Link to print main content area
|
||||
if (empty($conf->global->MAIN_PRINT_DISABLELINK) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
||||
if (!getDolGlobalString('MAIN_PRINT_DISABLELINK') && !getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
|
||||
$qs = dol_escape_htmltag($_SERVER["QUERY_STRING"]);
|
||||
|
||||
if (isset($_POST) && is_array($_POST)) {
|
||||
@@ -2195,7 +2195,7 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
|
||||
}
|
||||
|
||||
// Link to Dolibarr wiki pages
|
||||
if (empty($conf->global->MAIN_HELP_DISABLELINK) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
||||
if (!getDolGlobalString('MAIN_HELP_DISABLELINK') && !getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
|
||||
$langs->load("help");
|
||||
|
||||
$helpbaseurl = '';
|
||||
@@ -2241,13 +2241,13 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
|
||||
}
|
||||
|
||||
// Version
|
||||
if (!empty($conf->global->MAIN_SHOWDATABASENAMEINHELPPAGESLINK)) {
|
||||
if (getDolGlobalString('MAIN_SHOWDATABASENAMEINHELPPAGESLINK')) {
|
||||
$langs->load('admin');
|
||||
$appli .= '<br>'.$langs->trans("Database").': '.$db->database_name;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
||||
if (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
|
||||
$text = '<span class="aversion"><span class="hideonsmartphone small">'.DOL_VERSION.'</span></span>';
|
||||
$toprightmenu .= $form->textwithtooltip('', $appli, 2, 1, $text, 'login_block_elem', 2);
|
||||
}
|
||||
@@ -2265,12 +2265,12 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
|
||||
$mode = -1;
|
||||
$toprightmenu .= '<div class="inline-block login_block_elem login_block_elem_name nowrap centpercent" style="padding: 0px;">';
|
||||
|
||||
if (!empty($conf->global->MAIN_USE_TOP_MENU_SEARCH_DROPDOWN)) {
|
||||
if (getDolGlobalString('MAIN_USE_TOP_MENU_SEARCH_DROPDOWN')) {
|
||||
// Add search dropdown
|
||||
$toprightmenu .= top_menu_search();
|
||||
}
|
||||
|
||||
if (!empty($conf->global->MAIN_USE_TOP_MENU_QUICKADD_DROPDOWN)) {
|
||||
if (getDolGlobalString('MAIN_USE_TOP_MENU_QUICKADD_DROPDOWN')) {
|
||||
// Add search dropdown
|
||||
$toprightmenu .= top_menu_quickadd();
|
||||
}
|
||||
@@ -2386,7 +2386,7 @@ function top_menu_user($hideloginname = 0, $urllogout = '')
|
||||
|
||||
$dropdownBody .= '<br><u>'.$langs->trans("Session").'</u>';
|
||||
$dropdownBody .= '<br><b>'.$langs->trans("IPAddress").'</b>: '.dol_escape_htmltag($_SERVER["REMOTE_ADDR"]);
|
||||
if (!empty($conf->global->MAIN_MODULE_MULTICOMPANY)) {
|
||||
if (getDolGlobalString('MAIN_MODULE_MULTICOMPANY')) {
|
||||
$dropdownBody .= '<br><b>'.$langs->trans("ConnectedOnMultiCompany").':</b> '.$conf->entity.' (user entity '.$user->entity.')';
|
||||
}
|
||||
$dropdownBody .= '<br><b>'.$langs->trans("AuthenticationMode").':</b> '.$_SESSION["dol_authmode"].(empty($dolibarr_main_demo) ? '' : ' (demo)');
|
||||
@@ -2454,7 +2454,7 @@ function top_menu_user($hideloginname = 0, $urllogout = '')
|
||||
|
||||
// Define version to show
|
||||
$appli = constant('DOL_APPLICATION_TITLE');
|
||||
if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
|
||||
if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
|
||||
$appli = $conf->global->MAIN_APPLICATION_TITLE;
|
||||
if (preg_match('/\d\.\d/', $appli)) {
|
||||
if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) {
|
||||
@@ -2467,7 +2467,7 @@ function top_menu_user($hideloginname = 0, $urllogout = '')
|
||||
$appli .= " ".DOL_VERSION;
|
||||
}
|
||||
|
||||
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
||||
if (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
|
||||
$btnUser = '<!-- div for user link -->
|
||||
<div id="topmenu-login-dropdown" class="userimg atoplogin dropdown user user-menu inline-block">
|
||||
<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$user->id.'" class="dropdown-toggle login-dropdown-a" data-toggle="dropdown">
|
||||
@@ -2729,7 +2729,7 @@ function printDropdownQuickadd()
|
||||
"title" => "NewSupplierOrderShort@orders",
|
||||
"name" => "SupplierOrder@orders",
|
||||
"picto" => "supplier_order",
|
||||
"activation" => (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "commande", "write")) || (isModEnabled("supplier_order") && $user->hasRight("supplier_invoice", "write")), // vs hooking
|
||||
"activation" => (isModEnabled("fournisseur") && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight("fournisseur", "commande", "write")) || (isModEnabled("supplier_order") && $user->hasRight("supplier_invoice", "write")), // vs hooking
|
||||
"position" => 80,
|
||||
),
|
||||
array(
|
||||
@@ -2737,7 +2737,7 @@ function printDropdownQuickadd()
|
||||
"title" => "NewBill@bills",
|
||||
"name" => "SupplierBill@bills",
|
||||
"picto" => "supplier_invoice",
|
||||
"activation" => (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "write")) || (isModEnabled("supplier_invoice") && $user->hasRight("supplier_invoice", "write")), // vs hooking
|
||||
"activation" => (isModEnabled("fournisseur") && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight("fournisseur", "facture", "write")) || (isModEnabled("supplier_invoice") && $user->hasRight("supplier_invoice", "write")), // vs hooking
|
||||
"position" => 90,
|
||||
),
|
||||
array(
|
||||
@@ -2839,7 +2839,7 @@ function top_menu_bookmark()
|
||||
$html = '';
|
||||
|
||||
// Define $bookmarks
|
||||
if (!isModEnabled('bookmark') || empty($user->rights->bookmark->lire)) {
|
||||
if (!isModEnabled('bookmark') || !$user->hasRight('bookmark', 'lire')) {
|
||||
return $html;
|
||||
}
|
||||
|
||||
@@ -2858,7 +2858,7 @@ function top_menu_bookmark()
|
||||
include_once DOL_DOCUMENT_ROOT.'/bookmarks/bookmarks.lib.php';
|
||||
$langs->load("bookmarks");
|
||||
|
||||
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
||||
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
|
||||
$html .= '<div id="topmenu-bookmark-dropdown" class="dropdown inline-block">';
|
||||
$html .= printDropdownBookmarksList();
|
||||
$html .= '</div>';
|
||||
@@ -3113,7 +3113,7 @@ function left_menu($menu_array_before, $helppagename = '', $notused = '', $menu_
|
||||
$form = new Form($db);
|
||||
}
|
||||
$selected = -1;
|
||||
if (empty($conf->global->MAIN_USE_TOP_MENU_SEARCH_DROPDOWN)) {
|
||||
if (!getDolGlobalString('MAIN_USE_TOP_MENU_SEARCH_DROPDOWN')) {
|
||||
// Select into select2 is awfull on smartphone. TODO Is this still true with select2 v4 ?
|
||||
if ($conf->browser->layout == 'phone') {
|
||||
$conf->global->MAIN_USE_OLD_SEARCH_FORM = 1;
|
||||
@@ -3123,7 +3123,7 @@ function left_menu($menu_array_before, $helppagename = '', $notused = '', $menu_
|
||||
$arrayresult = array();
|
||||
include DOL_DOCUMENT_ROOT.'/core/ajax/selectsearchbox.php'; // This make initHooks('searchform') then set $arrayresult
|
||||
|
||||
if ($conf->use_javascript_ajax && empty($conf->global->MAIN_USE_OLD_SEARCH_FORM)) {
|
||||
if ($conf->use_javascript_ajax && !getDolGlobalString('MAIN_USE_OLD_SEARCH_FORM')) {
|
||||
// accesskey is for Windows or Linux: ALT + key for chrome, ALT + SHIFT + KEY for firefox
|
||||
// accesskey is for Mac: CTRL + key for all browsers
|
||||
$stringforfirstkey = $langs->trans("KeyboardShortcut");
|
||||
@@ -3135,7 +3135,7 @@ function left_menu($menu_array_before, $helppagename = '', $notused = '', $menu_
|
||||
$stringforfirstkey .= ' CTL +';
|
||||
}
|
||||
|
||||
$searchform .= $form->selectArrayFilter('searchselectcombo', $arrayresult, $selected, 'accesskey="s"', 1, 0, (empty($conf->global->MAIN_SEARCHBOX_CONTENT_LOADED_BEFORE_KEY) ? 1 : 0), 'vmenusearchselectcombo', 1, $langs->trans("Search"), 1, $stringforfirstkey.' s');
|
||||
$searchform .= $form->selectArrayFilter('searchselectcombo', $arrayresult, $selected, 'accesskey="s"', 1, 0, (!getDolGlobalString('MAIN_SEARCHBOX_CONTENT_LOADED_BEFORE_KEY') ? 1 : 0), 'vmenusearchselectcombo', 1, $langs->trans("Search"), 1, $stringforfirstkey.' s');
|
||||
} else {
|
||||
if (is_array($arrayresult)) {
|
||||
foreach ($arrayresult as $key => $val) {
|
||||
@@ -3154,10 +3154,10 @@ function left_menu($menu_array_before, $helppagename = '', $notused = '', $menu_
|
||||
}
|
||||
|
||||
// Force special value for $searchform for text browsers or very old search form
|
||||
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) || empty($conf->use_javascript_ajax)) {
|
||||
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') || empty($conf->use_javascript_ajax)) {
|
||||
$urltosearch = DOL_URL_ROOT.'/core/search_page.php?showtitlebefore=1';
|
||||
$searchform = '<div class="blockvmenuimpair blockvmenusearchphone"><div id="divsearchforms1"><a href="'.$urltosearch.'" accesskey="s" alt="'.dol_escape_htmltag($langs->trans("ShowSearchFields")).'">'.$langs->trans("Search").'...</a></div></div>';
|
||||
} elseif ($conf->use_javascript_ajax && !empty($conf->global->MAIN_USE_OLD_SEARCH_FORM)) {
|
||||
} elseif ($conf->use_javascript_ajax && getDolGlobalString('MAIN_USE_OLD_SEARCH_FORM')) {
|
||||
$searchform = '<div class="blockvmenuimpair blockvmenusearchphone"><div id="divsearchforms1"><a href="#" alt="'.dol_escape_htmltag($langs->trans("ShowSearchFields")).'">'.$langs->trans("Search").'...</a></div><div id="divsearchforms2" style="display: none">'.$searchform.'</div>';
|
||||
$searchform .= '<script>
|
||||
jQuery(document).ready(function () {
|
||||
@@ -3191,7 +3191,7 @@ function left_menu($menu_array_before, $helppagename = '', $notused = '', $menu_
|
||||
// Left column
|
||||
print '<!-- Begin left menu -->'."\n";
|
||||
|
||||
print '<div class="vmenu"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' title="Left menu"').'>'."\n\n";
|
||||
print '<div class="vmenu"'.(!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') ? '' : ' title="Left menu"').'>'."\n\n";
|
||||
|
||||
// Show left menu with other forms
|
||||
$menumanager->menu_array = $menu_array_before;
|
||||
@@ -3204,7 +3204,7 @@ function left_menu($menu_array_before, $helppagename = '', $notused = '', $menu_
|
||||
print '<div id="blockvmenuhelp" class="blockvmenuhelp">'."\n";
|
||||
|
||||
// Version
|
||||
if (!empty($conf->global->MAIN_SHOW_VERSION)) { // Version is already on help picto and on login page.
|
||||
if (getDolGlobalString('MAIN_SHOW_VERSION')) { // Version is already on help picto and on login page.
|
||||
$doliurl = 'https://www.dolibarr.org';
|
||||
//local communities
|
||||
if (preg_match('/fr/i', $langs->defaultlang)) {
|
||||
@@ -3224,7 +3224,7 @@ function left_menu($menu_array_before, $helppagename = '', $notused = '', $menu_
|
||||
}
|
||||
|
||||
$appli = constant('DOL_APPLICATION_TITLE');
|
||||
if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
|
||||
if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
|
||||
$appli = $conf->global->MAIN_APPLICATION_TITLE; $doliurl = '';
|
||||
if (preg_match('/\d\.\d/', $appli)) {
|
||||
if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) {
|
||||
@@ -3252,7 +3252,7 @@ function left_menu($menu_array_before, $helppagename = '', $notused = '', $menu_
|
||||
}
|
||||
|
||||
// Link to bugtrack
|
||||
if (!empty($conf->global->MAIN_BUGTRACK_ENABLELINK)) {
|
||||
if (getDolGlobalString('MAIN_BUGTRACK_ENABLELINK')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
if (getDolGlobalString('MAIN_BUGTRACK_ENABLELINK') == 'github') {
|
||||
@@ -3290,7 +3290,7 @@ function left_menu($menu_array_before, $helppagename = '', $notused = '', $menu_
|
||||
|
||||
$bugbaseurl .= urlencode("\n");
|
||||
$bugbaseurl .= urlencode("## Report\n");
|
||||
} elseif (!empty($conf->global->MAIN_BUGTRACK_ENABLELINK)) {
|
||||
} elseif (getDolGlobalString('MAIN_BUGTRACK_ENABLELINK')) {
|
||||
$bugbaseurl = $conf->global->MAIN_BUGTRACK_ENABLELINK;
|
||||
} else {
|
||||
$bugbaseurl = "";
|
||||
@@ -3358,12 +3358,12 @@ function main_area($title = '')
|
||||
$reshook = $hookmanager->executeHooks('printMainArea', $parameters); // Note that $action and $object may have been modified by some hooks
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
if (!empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED)) {
|
||||
if (getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')) {
|
||||
print info_admin($langs->trans("WarningYouAreInMaintenanceMode", $conf->global->MAIN_ONLY_LOGIN_ALLOWED), 0, 0, 1, 'warning maintenancemode');
|
||||
}
|
||||
|
||||
// Permit to add user company information on each printed document by setting SHOW_SOCINFO_ON_PRINT
|
||||
if (!empty($conf->global->SHOW_SOCINFO_ON_PRINT) && GETPOST('optioncss', 'aZ09') == 'print' && empty(GETPOST('disable_show_socinfo_on_print', 'az09'))) {
|
||||
if (getDolGlobalString('SHOW_SOCINFO_ON_PRINT') && GETPOST('optioncss', 'aZ09') == 'print' && empty(GETPOST('disable_show_socinfo_on_print', 'az09'))) {
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('showSocinfoOnPrint', $parameters);
|
||||
if (empty($reshook)) {
|
||||
@@ -3372,19 +3372,19 @@ function main_area($title = '')
|
||||
print '<table class="centpercent div-table-responsive">'."\n";
|
||||
print '<tbody>';
|
||||
print '<tr><td rowspan="0" class="width20p">';
|
||||
if ($conf->global->MAIN_SHOW_LOGO && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && !empty($conf->global->MAIN_INFO_SOCIETE_LOGO)) {
|
||||
if ($conf->global->MAIN_SHOW_LOGO && !getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') && getDolGlobalString('MAIN_INFO_SOCIETE_LOGO')) {
|
||||
print '<img id="mysoc-info-header-logo" style="max-width:100%" alt="" src="'.DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_LOGO)).'">';
|
||||
}
|
||||
print '</td><td rowspan="0" class="width50p"></td></tr>'."\n";
|
||||
print '<tr><td class="titre bold">'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_NOM).'</td></tr>'."\n";
|
||||
print '<tr><td>'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_ADDRESS).'<br>'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_ZIP).' '.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_TOWN).'</td></tr>'."\n";
|
||||
if (!empty($conf->global->MAIN_INFO_SOCIETE_TEL)) {
|
||||
if (getDolGlobalString('MAIN_INFO_SOCIETE_TEL')) {
|
||||
print '<tr><td style="padding-left: 1em" class="small">'.$langs->trans("Phone").' : '.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_TEL).'</td></tr>';
|
||||
}
|
||||
if (!empty($conf->global->MAIN_INFO_SOCIETE_MAIL)) {
|
||||
if (getDolGlobalString('MAIN_INFO_SOCIETE_MAIL')) {
|
||||
print '<tr><td style="padding-left: 1em" class="small">'.$langs->trans("Email").' : '.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_MAIL).'</td></tr>';
|
||||
}
|
||||
if (!empty($conf->global->MAIN_INFO_SOCIETE_WEB)) {
|
||||
if (getDolGlobalString('MAIN_INFO_SOCIETE_WEB')) {
|
||||
print '<tr><td style="padding-left: 1em" class="small">'.$langs->trans("Web").' : '.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_WEB).'</td></tr>';
|
||||
}
|
||||
print '</tbody>';
|
||||
@@ -3581,7 +3581,7 @@ if (!function_exists("llxFooter")) {
|
||||
}
|
||||
|
||||
// Core error message
|
||||
if (!empty($conf->global->MAIN_CORE_ERROR)) {
|
||||
if (getDolGlobalString('MAIN_CORE_ERROR')) {
|
||||
// Ajax version
|
||||
if ($conf->use_javascript_ajax) {
|
||||
$title = img_warning().' '.$langs->trans('CoreErrorTitle');
|
||||
@@ -3667,7 +3667,7 @@ if (!function_exists("llxFooter")) {
|
||||
//print '<!-- instance_unique_id='.$conf->file->instance_unique_id.' MAIN_FIRST_PING_OK_ID='.$conf->global->MAIN_FIRST_PING_OK_ID.' -->';
|
||||
$hash_unique_id = md5('dolibarr'.$conf->file->instance_unique_id); // Do not use dol_hash(), must not change if salt changes.
|
||||
|
||||
if (empty($conf->global->MAIN_FIRST_PING_OK_DATE)
|
||||
if (!getDolGlobalString('MAIN_FIRST_PING_OK_DATE')
|
||||
|| (!empty($conf->file->instance_unique_id) && ($hash_unique_id != $conf->global->MAIN_FIRST_PING_OK_ID) && ($conf->global->MAIN_FIRST_PING_OK_ID != 'disabled'))
|
||||
|| $forceping) {
|
||||
// No ping done if we are into an alpha version
|
||||
@@ -3676,14 +3676,14 @@ if (!function_exists("llxFooter")) {
|
||||
} elseif (empty($_COOKIE['DOLINSTALLNOPING_'.$hash_unique_id]) || $forceping) { // Cookie is set when we uncheck the checkbox in the installation wizard.
|
||||
// MAIN_LAST_PING_KO_DATE
|
||||
// Disable ping if MAIN_LAST_PING_KO_DATE is set and is recent (this month)
|
||||
if (!empty($conf->global->MAIN_LAST_PING_KO_DATE) && substr($conf->global->MAIN_LAST_PING_KO_DATE, 0, 6) == dol_print_date(dol_now(), '%Y%m') && !$forceping) {
|
||||
if (getDolGlobalString('MAIN_LAST_PING_KO_DATE') && substr($conf->global->MAIN_LAST_PING_KO_DATE, 0, 6) == dol_print_date(dol_now(), '%Y%m') && !$forceping) {
|
||||
print "\n<!-- NO JS CODE TO ENABLE the anonymous Ping. An error already occured this month, we will try later. -->\n";
|
||||
} else {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
print "\n".'<!-- Includes JS for Ping of Dolibarr forceping='.$forceping.' MAIN_FIRST_PING_OK_DATE='.getDolGlobalString("MAIN_FIRST_PING_OK_DATE").' MAIN_FIRST_PING_OK_ID='.getDolGlobalString("MAIN_FIRST_PING_OK_ID").' MAIN_LAST_PING_KO_DATE='.getDolGlobalString("MAIN_LAST_PING_KO_DATE").' -->'."\n";
|
||||
print "\n<!-- JS CODE TO ENABLE the anonymous Ping -->\n";
|
||||
$url_for_ping = (empty($conf->global->MAIN_URL_FOR_PING) ? "https://ping.dolibarr.org/" : $conf->global->MAIN_URL_FOR_PING);
|
||||
$url_for_ping = (!getDolGlobalString('MAIN_URL_FOR_PING') ? "https://ping.dolibarr.org/" : $conf->global->MAIN_URL_FOR_PING);
|
||||
// Try to guess the distrib used
|
||||
$distrib = 'standard';
|
||||
if ($_SERVER["SERVER_ADMIN"] == 'doliwamp@localhost') {
|
||||
|
||||
Reference in New Issue
Block a user