diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index 773c54094e..4f42b18b38 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -1242,6 +1242,7 @@ ALTER TABLE tlayout_data ADD `label_position` varchar(50) NOT NULL default 'down ALTER TABLE tlayout_data ADD COLUMN `show_statistics` tinyint(2) NOT NULL default '0'; ALTER TABLE tlayout_data ADD COLUMN `element_group` int(10) NOT NULL default '0'; ALTER TABLE tlayout_data ADD COLUMN `id_layout_linked_weight` int(10) NOT NULL default '0'; +ALTER TABLE tlayout_data ADD COLUMN `show_on_top` tinyint(1) NOT NULL default '0'; -- --------------------------------------------------------------------- -- Table `tagent_custom_fields` diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index aad9d3ec0e..03a12883e7 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -855,6 +855,7 @@ function readFields() { values['line_color'] = $("input[name='line_color']").val(); values['label_position'] = $(".labelpos[sel=yes]").attr('position'); values['show_statistics'] = $("input[name=show_statistics]").is(':checked') ? 1 : 0; + values['show_on_top'] = $("input[name=show_on_top]").is(':checked') ? 1 : 0; if (is_metaconsole()) { values['metaconsole'] = 1; @@ -1295,6 +1296,9 @@ function toggle_item_palette() { } hiddenFields(item); + + $("#show_on_top_row").css('display', 'table-row'); + $("#show_on_top." + item).css('display', 'block'); $("#properties_panel").show("fast"); @@ -1424,6 +1428,17 @@ function loadFieldsFromDB(item) { } } + if (key == 'show_on_top') { + if (val == "1") { + $("input[name=show_on_top]") + .prop("checked", true); + } + else { + $("input[name=show_on_top]") + .prop("checked", false); + } + } + if (key == 'type_graph') { $("select[name=type_graph]").val(val); } @@ -1901,6 +1916,7 @@ function cleanFields(item) { $("input[name=percentile_label_color]").val(''); $("input[name=percentile_label]").val(''); $(".ColorPickerDivSample").css('background-color', '#FFF'); + $("input[name=show_on_top]").prop("checked", false); $("#preview").empty(); @@ -3464,8 +3480,6 @@ function createItem(type, values, id_data) { } $("#background").append(item); - $(".item").css('z-index', '2'); - $(".box_item").css('z-index', '1'); if (values['parent'] != 0) { var line = {"id": id_data, @@ -3488,6 +3502,14 @@ function createItem(type, values, id_data) { $('#text_'+id_data).css({'display':'block','float':'left'}); } + if(values['show_on_top'] == 1){ + $("#" + id_data).css('z-index', '10'); + } + + if(values['show_on_top'] == 0){ + $("#" + id_data).css('z-index', '5'); + } + } function addItemSelectParents(id_data, text) { @@ -3690,6 +3712,15 @@ function updateDB_visual(type, idElement , values, event, top, left) { refresh_lines(lines, 'background', true); draw_user_lines("", 0, 0, 0 , 0, 0, true); + + if(values['show_on_top'] == 1){ + $("#" + idElement).css('z-index',10); + } + + if(values['show_on_top'] == 0){ + $("#" + idElement).css('z-index',5); + } + } function updateDB(type, idElement , values, event) { @@ -4525,6 +4556,8 @@ function eventsBackground() { if ((!is_opened_palette) && (autosave)) { toggle_item_palette(); } + $("#show_on_top_row").css('display', 'none'); + $("#show_on_top." + item).css('display', ''); }); } diff --git a/pandora_console/godmode/reporting/visual_console_builder.php b/pandora_console/godmode/reporting/visual_console_builder.php index 7288784acf..a3256f8592 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.php +++ b/pandora_console/godmode/reporting/visual_console_builder.php @@ -413,6 +413,8 @@ switch ($activeTab) { $value_show = get_parameter ("value_show", 'percent'); $label_type = get_parameter ("label_type", 'agent_module'); $enable_link = get_parameter ("enable_link", 'enable_link'); + $show_on_top = get_parameter ("show_on_top", 0); + // This var switch between creation of items, item_per_agent = 0 => item per module; item_per_agent <> 0 => item per agent $item_per_agent = get_parameter ("item_per_agent", 0); $id_server = (int)get_parameter('servers', 0); diff --git a/pandora_console/include/ajax/visual_console_builder.ajax.php b/pandora_console/include/ajax/visual_console_builder.ajax.php index 551ed0477d..bb372dd5b9 100755 --- a/pandora_console/include/ajax/visual_console_builder.ajax.php +++ b/pandora_console/include/ajax/visual_console_builder.ajax.php @@ -140,6 +140,7 @@ $line_color = get_parameter('line_color', ''); $get_element_status = get_parameter('get_element_status', 0); $enable_link = get_parameter('enable_link', 1); +$show_on_top = get_parameter('show_on_top', 0); $type_graph = get_parameter('type_graph', 'area'); $label_position = get_parameter('label_position', 'down'); $show_statistics = get_parameter('show_statistics', 0); @@ -492,6 +493,7 @@ switch ($action) { $values = array(); $values['label_position'] = $label_position; + $values['show_on_top'] = $show_on_top; // In Graphs, background color is stored in column image (sorry) if ($type == 'module_graph') { @@ -531,6 +533,9 @@ switch ($action) { if ($enable_link !== null) { $values['enable_link'] = $enable_link; } + if ($show_on_top !== null) { + $values['show_on_top'] = $show_on_top; + } if ($label !== null) { $values['label'] = $label; } @@ -745,6 +750,7 @@ switch ($action) { // Don't change the label because only change the positions unset($values['label']); unset($values['label_position']); + unset($values['show_on_top']); // Don't change background color in graphs when move switch ($type) { @@ -1034,6 +1040,7 @@ switch ($action) { $values['id_layout_linked_weight'] = $map_linked_weight; $values['parent_item'] = $parent; $values['enable_link'] = $enable_link; + $values['show_on_top'] = $show_on_top; $values['image'] = $background_color; $values['type_graph'] = $type_graph; diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index d83db618e7..ff716fa0b5 100755 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -111,6 +111,14 @@ function visual_map_print_item($mode = "read", $layoutData, $border_color = $layoutData['border_color']; $fill_color = $layoutData['fill_color']; $label_position = $layoutData['label_position']; + $show_on_top = $layoutData['show_on_top']; + + if($show_on_top){ + $show_on_top_index = 10; + } + else{ + $show_on_top_index = ''; + } $sizeStyle = ''; $borderStyle = ''; @@ -961,14 +969,14 @@ function visual_map_print_item($mode = "read", $layoutData, else { if ($width == 0 || $height == 0) { if ($layoutData['label_position']=='left') { - $img = '