From befb859e230e18de66b909f86734965142fdc2f1 Mon Sep 17 00:00:00 2001 From: fermin831 Date: Fri, 13 Oct 2017 14:16:37 +0200 Subject: [PATCH] Fixed auto SLA item on visual console when no module is selected --- .../reporting/visual_console_builder.editor.js | 4 ---- pandora_console/include/functions_graph.php | 12 +++++++----- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index 0e46581178..22c6c4d8d4 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -698,10 +698,6 @@ function create_button_palette_callback() { alert($("#message_alert_no_agent").html()); validate = false; } - if ((values['module'] == 0)) { - alert($("#message_alert_no_module").html()); - validate = false; - } break; case 'label': if ((values['label'] == '')) { diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index c318673184..c97867733b 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -3792,11 +3792,13 @@ function graph_graphic_moduleevents ($id_agent, $id_module, $width, $height, $pe $top = $datelimit + ($periodtime * ($i + 1)); - $event = db_get_row_filter ('tevento', - array ('id_agente' => $id_agent, - 'id_agentmodule' => $id_module, - 'utimestamp > '.$bottom, - 'utimestamp < '.$top), 'criticity, utimestamp'); + $event_filter = array ('id_agente' => $id_agent, + 'utimestamp > '.$bottom, + 'utimestamp < '.$top); + if ((int)$id_module !== 0) { + $event_filter['id_agentmodule'] = $id_module; + } + $event = db_get_row_filter ('tevento', $event_filter, 'criticity, utimestamp'); if (!empty($event['utimestamp'])) { $data[$cont]['utimestamp'] = $periodtime;