From c6e32e278be4447a8f22c953ec796bcbab24bfb4 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Mon, 20 Feb 2023 16:41:54 +0100 Subject: [PATCH] #9662 fixed favourites --- pandora_console/general/main_menu.php | 2 +- pandora_console/include/functions_menu.php | 25 ++++++++++++++ pandora_console/include/styles/pandora.css | 2 +- pandora_console/operation/menu.php | 39 ++++++++++++++++------ 4 files changed, 56 insertions(+), 12 deletions(-) diff --git a/pandora_console/general/main_menu.php b/pandora_console/general/main_menu.php index af93f5f0b7..efa2fc5c96 100644 --- a/pandora_console/general/main_menu.php +++ b/pandora_console/general/main_menu.php @@ -444,7 +444,7 @@ echo ''; */ function menu_calculate_top(index, item_height) { const result = index * item_height; - return 140 + result; + return 136 + result; } }); diff --git a/pandora_console/include/functions_menu.php b/pandora_console/include/functions_menu.php index b9774ae800..af3071809d 100644 --- a/pandora_console/include/functions_menu.php +++ b/pandora_console/include/functions_menu.php @@ -79,6 +79,31 @@ function menu_print_menu(&$menu) } else if ($sec2 === 'godmode/events/events') { $section = (string) get_parameter('section'); $sec2 = 'godmode/events/events§ion='.$section; + } else if ($sec2 === 'operation/dashboard/dashboard') { + $id = (int) get_parameter('dashboardId', 0); + if (empty($id) === false) { + $sec2 = 'operation/dashboard/dashboard&dashboardId='.$id; + } + } else if ($sec2 === 'enterprise/operation/services/services') { + $tab = (string) get_parameter('tab', ''); + $action = (string) get_parameter('action', ''); + $id_service = (int) get_parameter('id_service', 0); + if (empty($tab) === false + && empty($action) === false + && empty($id_service) === false + ) { + $sec2 = sprintf( + 'enterprise/operation/services/services&tab=%s&action=%s&id_service=%d', + $tab, + $action, + $id_service + ); + } + } else if ($sec2 === 'operation/visual_console/render_view') { + $id = (int) get_parameter('id', 0); + if (empty($id) === false) { + $sec2 = 'operation/visual_console/render_view&id='.$id; + } } else { $sec2 = (string) get_parameter('sec2'); } diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 58a8cc6653..ec8b02fff0 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -9886,7 +9886,7 @@ div#err_msg_centralised { .inputFile { background-color: #f6f7fb; - height: 28px; + height: 16px; font: normal normal normal 13px Pandora-Light; padding: 5.5pt 20pt; cursor: pointer; diff --git a/pandora_console/operation/menu.php b/pandora_console/operation/menu.php index 4531432d6e..b89ca1d8f5 100644 --- a/pandora_console/operation/menu.php +++ b/pandora_console/operation/menu.php @@ -307,14 +307,21 @@ if ($access_console_node === true) { if (check_acl($config['id_user'], 0, 'VR') || check_acl($config['id_user'], 0, 'VW') || check_acl($config['id_user'], 0, 'VM')) { + $url_visual_console = ''; if (!isset($config['vc_favourite_view']) || $config['vc_favourite_view'] == 0) { // Visual console. $sub['godmode/reporting/map_builder']['text'] = __('Visual console'); $sub['godmode/reporting/map_builder']['id'] = 'Visual_console'; + $sub['godmode/reporting/map_builder']['type'] = 'direct'; + $sub['godmode/reporting/map_builder']['subtype'] = 'nolink'; + $url_visual_console = 'godmode/reporting/map_builder'; } else { // Visual console favorite. $sub['godmode/reporting/visual_console_favorite']['text'] = __('Visual console'); $sub['godmode/reporting/visual_console_favorite']['id'] = 'Visual_console'; + $sub['godmode/reporting/visual_console_favorite']['type'] = 'direct'; + $sub['godmode/reporting/visual_console_favorite']['subtype'] = 'nolink'; + $url_visual_console = 'godmode/reporting/visual_console_favorite'; } if ($config['vc_menu_items'] != 0) { @@ -341,6 +348,12 @@ if ($access_console_node === true) { $layouts = visual_map_get_user_layouts($config['id_user'], false, false, $returnAllGroups, true); $sub2 = []; + $sub2[$url_visual_console] = [ + 'text' => __('Visual console list'), + 'title' => __('Visual console list'), + 'refr' => 0, + ]; + if ($layouts === false) { $layouts = []; } else { @@ -364,15 +377,15 @@ if ($access_console_node === true) { $name = io_safe_output($layout['name']); - $sub2['operation/visual_console/render_view&id='.$layout['id']]['text'] = ui_print_truncate_text($name, MENU_SIZE_TEXT, false, true, false); - $sub2['operation/visual_console/render_view&id='.$layout['id']]['id'] = mb_substr($name, 0, 19); - $sub2['operation/visual_console/render_view&id='.$layout['id']]['title'] = $name; + $sub2['operation/visual_console/render_view&id='.$layout['id']]['text'] = ui_print_truncate_text($name, MENU_SIZE_TEXT, false, true, false); + $sub2['operation/visual_console/render_view&id='.$layout['id']]['id'] = mb_substr($name, 0, 19); + $sub2['operation/visual_console/render_view&id='.$layout['id']]['title'] = $name; if (!empty($config['vc_refr'])) { - $sub2['operation/visual_console/render_view&id='.$layout['id']]['refr'] = $config['vc_refr']; + $sub2['operation/visual_console/render_view&id='.$layout['id']]['refr'] = $config['vc_refr']; } else if (((int) get_parameter('refr', 0)) > 0) { - $sub2['operation/visual_console/render_view&id='.$layout['id']]['refr'] = (int) get_parameter('refr', 0); + $sub2['operation/visual_console/render_view&id='.$layout['id']]['refr'] = (int) get_parameter('refr', 0); } else { - $sub2['operation/visual_console/render_view&id='.$layout['id']]['refr'] = 0; + $sub2['operation/visual_console/render_view&id='.$layout['id']]['refr'] = 0; } } @@ -424,10 +437,10 @@ if ($access_console_node === true) { continue; } - $sub2['operation/gis_maps/render_view&map_id='.$gisMap['id_tgis_map']]['text'] = ui_print_truncate_text(io_safe_output($gisMap['map_name']), MENU_SIZE_TEXT, false, true, false); - $sub2['operation/gis_maps/render_view&map_id='.$gisMap['id_tgis_map']]['id'] = mb_substr(io_safe_output($gisMap['map_name']), 0, 15); - $sub2['operation/gis_maps/render_view&map_id='.$gisMap['id_tgis_map']]['title'] = io_safe_output($gisMap['map_name']); - $sub2['operation/gis_maps/render_view&map_id='.$gisMap['id_tgis_map']]['refr'] = 0; + $sub2['operation/gis_maps/render_view&map_id='.$gisMap['id_tgis_map']]['text'] = ui_print_truncate_text(io_safe_output($gisMap['map_name']), MENU_SIZE_TEXT, false, true, false); + $sub2['operation/gis_maps/render_view&map_id='.$gisMap['id_tgis_map']]['id'] = mb_substr(io_safe_output($gisMap['map_name']), 0, 15); + $sub2['operation/gis_maps/render_view&map_id='.$gisMap['id_tgis_map']]['title'] = io_safe_output($gisMap['map_name']); + $sub2['operation/gis_maps/render_view&map_id='.$gisMap['id_tgis_map']]['refr'] = 0; } $sub['gismaps']['sub2'] = $sub2; @@ -480,10 +493,16 @@ if ($access_console_node === true) { $sub['operation/dashboard/dashboard']['id'] = 'Dashboard'; $sub['operation/dashboard/dashboard']['refr'] = 0; $sub['operation/dashboard/dashboard']['subsecs'] = ['operation/dashboard/dashboard']; + $sub['operation/dashboard/dashboard']['type'] = 'direct'; + $sub['operation/dashboard/dashboard']['subtype'] = 'nolink'; $dashboards = Manager::getDashboards(-1, -1, true); $sub2 = []; + $sub2['operation/dashboard/dashboard'] = [ + 'text' => __('Dashboard list'), + 'title' => __('Dashboard list'), + ]; foreach ($dashboards as $dashboard) { $name = io_safe_output($dashboard['name']);