From e03b62d16818774b46b4239892a9273ebafe1e92 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Mon, 28 Jan 2019 18:05:46 +0100 Subject: [PATCH 1/2] Fixed auto combined graph in metaconsole Former-commit-id: c0e819e35fbb5952fa8ce2806e9cddff521a5131 --- pandora_console/include/functions_reporting.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 6cc8683b4b..bd28f30f79 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -6397,7 +6397,7 @@ function reporting_custom_graph($report, $content, $type = 'dinamic', $graphs[0]["fullscale"] = $content['style']['fullscale']; $modules = $content['id_agent_module']; - if(!$modules){ + if(!$modules || !is_array($modules)) { $module_source = db_get_all_rows_sql( "SELECT id_agent_module, id_server FROM tgraph_source @@ -6405,7 +6405,7 @@ function reporting_custom_graph($report, $content, $type = 'dinamic', $content['id_gs'] ); - if(isset($module_source) && is_array($module_source)){ + if(isset($module_source) && is_array($module_source)) { $modules = array(); foreach ($module_source as $key => $value) { $modules[$key]['module'] = $value['id_agent_module']; From cc27f0451a26a180a344bc895fa9898bd5c3d906 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Tue, 29 Jan 2019 17:12:24 +0100 Subject: [PATCH 2/2] Fixed auto combined graph in metaconsole 2 Former-commit-id: 672531931421175354f2a877ac295c1763107756 --- pandora_console/include/functions_reporting.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index bd28f30f79..af9cab3702 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -6389,7 +6389,7 @@ function reporting_custom_graph($report, $content, $type = 'dinamic', $graphs = db_get_all_rows_field_filter ("tgraph", "id_graph", $content['id_gs']); $id_graph = $content['id_gs']; } - else if($type_report == "automatic_graph"){ + else if($type_report == "automatic_graph") { $graphs[0]["stacked"] = ''; $graphs[0]["summatory_series"] = ''; $graphs[0]["average_series"] = ''; @@ -6397,13 +6397,12 @@ function reporting_custom_graph($report, $content, $type = 'dinamic', $graphs[0]["fullscale"] = $content['style']['fullscale']; $modules = $content['id_agent_module']; - if(!$modules || !is_array($modules)) { + if (is_metaconsole()) { $module_source = db_get_all_rows_sql( - "SELECT id_agent_module, id_server - FROM tgraph_source - WHERE id_graph = " . - $content['id_gs'] - ); + "SELECT id_agent_module, id_server + FROM tgraph_source + WHERE id_graph = " . + $content['id_gs']); if(isset($module_source) && is_array($module_source)) { $modules = array();