diff --git a/pandora_console/general/main_menu.php b/pandora_console/general/main_menu.php index 13e3f2c38c..60bffeb27f 100644 --- a/pandora_console/general/main_menu.php +++ b/pandora_console/general/main_menu.php @@ -349,7 +349,7 @@ echo ''; const id = table_hover[0].id; const classes = $(`#${id}`).attr('class'); - if (id === 'icon_about') { + if (id === 'icon_about' || id === 'icon_about_operation') { return; } diff --git a/pandora_console/include/functions_menu.php b/pandora_console/include/functions_menu.php index d7a464491d..4878333071 100644 --- a/pandora_console/include/functions_menu.php +++ b/pandora_console/include/functions_menu.php @@ -458,8 +458,9 @@ function menu_print_menu(&$menu) ($main['sec2'] ?? null), ] ) === false + || $mainsec === 'about_operation' ) { - if ($count_sub_access > 0) { + if ($count_sub_access > 0 || $mainsec === 'about_operation') { // If any susection have access but main section not, we change main link to first subsection found $main['sec2'] = $first_sub_sec2; } else { @@ -484,7 +485,7 @@ function menu_print_menu(&$menu) if ($menuTypeClass === 'collapsed') { $div = '
'; } else { - if ($id === 'about') { + if ($id === 'about' || $id === 'about_operation') { $div = '
'.$main['text'].''; } else { $div = '
'.$main['text'].'
'; @@ -861,12 +862,18 @@ function menu_pepare_acl_select_data($pages, $sec) if (is_ajax()) { $about = (bool) get_parameter('about'); + $about_operation = (bool) get_parameter('about_operation'); if ($about) { global $config; global $pandora_version; global $build_version; $product_name = io_safe_output(get_product_name()); $license_expiry_date = substr($config['license_expiry_date'], 0, 4).'/'.substr($config['license_expiry_date'], 4, 2).'/'.substr($config['license_expiry_date'], 6, 2); + $license_expired = false; + $timestamp = strtotime($license_expiry_date); + if ($timestamp < time() || enterprise_installed() === false) { + $license_expired = true; + } include_once $config['homedir'].'/include/class/Diagnostics.class.php'; $d = new Diagnostics; @@ -954,14 +961,28 @@ if (is_ajax()) { - logo + + logo +

'.$product_name.'

'.__('Version').' '.$pandora_version.$lts_name.' - '.(enterprise_installed() ? 'Enterprise' : 'Community').'

'.__('MR version').' MR'.$config['MR'].'

-

Build'.$build_version.'

-

'.__('Support expires').''.$license_expiry_date.'

'; +

Build'.$build_version.'

'; + if (enterprise_installed() === true) { + $dialog .= '

'.__('Support expires').''.$license_expiry_date.'

'; + } + + if ($license_expired === false) { + $dialog .= '

'.__('This system has official support, warranty and official updates.').'

'; + } else if (enterprise_installed() === true) { + $dialog .= '

'.__('This system has no active support contract, and has no support, upgrades or warranty.').'

'; + $dialog .= '

'.__('Contact Pandora FMS for expand your support contract.').'

'; + } else { + $dialog .= '

'.__('The OpenSource version has no support or warranty of any kind.').'

'; + $dialog .= '

'.__('Contact Pandora FMS for official support contract.').'

'; + } if (((bool) check_acl($config['id_user'], 0, 'PM') === true) && (is_metaconsole() === false)) { $dialogButtons = []; @@ -1004,7 +1025,7 @@ if (is_ajax()) { - +
@@ -1224,4 +1245,104 @@ if (is_ajax()) { echo $dialog; } + + if ($about_operation) { + global $config; + global $pandora_version; + global $build_version; + $product_name = io_safe_output(get_product_name()); + $license_expiry_date = substr($config['license_expiry_date'], 0, 4).'/'.substr($config['license_expiry_date'], 4, 2).'/'.substr($config['license_expiry_date'], 6, 2); + $license_expired = false; + $timestamp = strtotime($license_expiry_date); + if ($timestamp < time() || enterprise_installed() === false) { + $license_expired = true; + } + + $lts_name = ''; + if (empty($config['lts_name']) === false) { + $lts_name = ' '.$config['lts_name'].''; + } + + $image_about = ui_get_full_url('/images/custom_logo/logo-default-pandorafms.png', false, false, false); + if (enterprise_installed() === false) { + if ($config['style'] === 'pandora_black') { + $image_about = 'images/custom_logo/'.HEADER_LOGO_BLACK_CLASSIC; + } else if ($config['style'] === 'pandora') { + $image_about = 'images/custom_logo/'.HEADER_LOGO_DEFAULT_CLASSIC; + } + } else { + if ($config['style'] === 'pandora_black' && $config['custom_logo'] === HEADER_LOGO_DEFAULT_CLASSIC) { + $config['custom_logo'] = HEADER_LOGO_BLACK_CLASSIC; + } else if ($config['style'] === 'pandora' && $config['custom_logo'] === HEADER_LOGO_BLACK_CLASSIC) { + $config['custom_logo'] = HEADER_LOGO_DEFAULT_CLASSIC; + } + + $image_about = 'images/custom_logo/'.$config['custom_logo']; + + if (file_exists(ENTERPRISE_DIR.'/'.$image_about) === true) { + $image_about = ENTERPRISE_DIR.'/'.$image_about; + } + } + + if (is_metaconsole() === true) { + $image_about = ui_get_full_url('/enterprise/images/custom_logo/pandoraFMS_metaconsole_full.svg', false, false, false); + + if ($config['meta_custom_logo'] === 'pandoraFMS_metaconsole_full.svg') { + $image_about = 'images/custom_logo/'.$config['meta_custom_logo']; + } else { + $image_about = '../images/custom_logo/'.$config['meta_custom_logo']; + } + + if (file_exists(ENTERPRISE_DIR.'/'.$image_about) === true) { + $image_about = $image_about; + } + } + + + $dialog = ' +
+ + + + + + +
+ + logo + + +

'.$product_name.'

+

'.__('Version').' '.$pandora_version.$lts_name.' - '.(enterprise_installed() ? 'Enterprise' : 'Community').'

+

'.__('MR version').' MR'.$config['MR'].'

+

Build'.$build_version.'

'; + if (enterprise_installed() === true) { + $dialog .= '

'.__('Support expires').''.$license_expiry_date.'

'; + } + + if ($license_expired === false) { + $dialog .= '

'.__('This system has official support, warranty and official updates.').'

'; + } else if (enterprise_installed() === true) { + $dialog .= '

'.__('This system has no active support contract, and has no support, upgrades or warranty.').'

'; + $dialog .= '

'.__('Contact Pandora FMS for expand your support contract.').'

'; + } else { + $dialog .= '

'.__('The OpenSource version has no support or warranty of any kind.').'

'; + $dialog .= '

'.__('Contact Pandora FMS for official support contract.').'

'; + } + + $dialog .= '
+ +
+ + '; + + echo $dialog; + } } diff --git a/pandora_console/include/javascript/pandora.js b/pandora_console/include/javascript/pandora.js index 9353c8f29d..af212f454e 100644 --- a/pandora_console/include/javascript/pandora.js +++ b/pandora_console/include/javascript/pandora.js @@ -2308,16 +2308,21 @@ var formatterDataVerticalBar = function(value, ctx) { // Show about section $(document).ready(function() { - $("#icon_about").click(function() { - $("#icon_about").addClass("selected"); + $("[id^='icon_about']").click(function() { + $("[id^='icon_about']").addClass("selected"); // Hidden tips modal. $(".window").css("display", "none"); + var type_about = "about_operation"; + if ($(this).attr("id") === "icon_about") { + type_about = "about"; + } + jQuery.post( "ajax.php", { page: "include/functions_menu", - about: "true" + [type_about]: "true" }, function(data) { $("div.ui-dialog").remove(); @@ -2331,35 +2336,66 @@ $(document).ready(function() { ); }); - function openAbout() { - $("#about-tabs").dialog({ - // title: "About", - resizable: false, - draggable: false, - modal: true, - show: { - effect: "fade", - duration: 200 - }, - hide: { - effect: "fade", - duration: 200 - }, - closeOnEscape: true, - width: 700, - height: 450, + function openAbout(section = "management") { + if (section === "management") { + $("#about-tabs").dialog({ + // title: "About", + resizable: false, + draggable: false, + modal: true, + show: { + effect: "fade", + duration: 200 + }, + hide: { + effect: "fade", + duration: 200 + }, + closeOnEscape: true, + width: 700, + height: 450, - create: function() { - $("#about-tabs").tabs({}); - $(".ui-dialog-titlebar").remove(); + create: function() { + $("#about-tabs").tabs({}); + $(".ui-dialog-titlebar").remove(); - $("#about-close").click(function() { - $("#about-tabs").dialog("close"); - $("div.ui-dialog").remove(); - $("#icon_about").removeClass("selected"); - }); - } - }); + $("#about-close").click(function() { + $("#about-tabs").dialog("close"); + $("div.ui-dialog").remove(); + $("#icon_about").removeClass("selected"); + }); + } + }); + } else if (section === "operation") { + $("#about-tabs").dialog({ + // title: "About", + resizable: false, + draggable: false, + modal: true, + show: { + effect: "fade", + duration: 200 + }, + hide: { + effect: "fade", + duration: 200 + }, + closeOnEscape: true, + width: 700, + height: 450, + + create: function() { + $("#about-tabs").tabs({}); + $(".ui-dialog-titlebar").remove(); + + $("#about-close").click(function() { + $("#about-tabs").dialog("close"); + $("div.ui-dialog").remove(); + $("#icon_about_operation").removeClass("selected"); + }); + } + }); + } } }); diff --git a/pandora_console/include/styles/menu.css b/pandora_console/include/styles/menu.css index 7ba7dd27a0..537dd90cf2 100644 --- a/pandora_console/include/styles/menu.css +++ b/pandora_console/include/styles/menu.css @@ -357,6 +357,11 @@ background-size: 18px; } +.icon_about_operation { + background: url(../../images/menu/about.svg) no-repeat 50% 50%; + background-size: 18px; +} + #menu_container { z-index: 3; position: absolute; diff --git a/pandora_console/operation/menu.php b/pandora_console/operation/menu.php index f79a4a611a..3641a79f80 100644 --- a/pandora_console/operation/menu.php +++ b/pandora_console/operation/menu.php @@ -825,9 +825,10 @@ if ($access_console_node === true) { // ~ } } +$menu_operation['about_operation']['text'] = __('About'); +$menu_operation['about_operation']['id'] = 'about_operation'; - -// Save operation menu array to use in operation/extensions.php view +// Save operation menu array to use in operation/extensions.php view. $operation_menu_array = $menu_operation;