From 65d32498af504e8dfbc02949866d42c7edf09968 Mon Sep 17 00:00:00 2001 From: juanmanuelr Date: Mon, 9 Apr 2012 15:47:14 +0000 Subject: [PATCH] 2012-04-09 Juan Manuel Ramon * godmode/reporting/reporting_builder.list_items.php godmode/reporting/reporting_builder.item_editor.php: Fixed display of grouped reports in metaconsole. Fixes: #3514539 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5918 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 8 ++++++++ .../reporting/reporting_builder.item_editor.php | 17 +++++++++++++++-- .../reporting/reporting_builder.list_items.php | 14 +++++++++----- 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 3993958109..b8b62a4474 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,11 @@ +2012-04-09 Juan Manuel Ramon + + * godmode/reporting/reporting_builder.list_items.php + godmode/reporting/reporting_builder.item_editor.php: Fixed display + of grouped reports in metaconsole. + + Fixes: #3514539 + 2012-04-09 Miguel de Dios * include/functions_ui.php: cleaned source code style. diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index f90248dc1d..c4c832c09a 100644 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -264,7 +264,7 @@ switch ($action) { break; case 'alert_report_agent': $description = $item['description']; - $idAgent = $item['id_agent']; + $idAgent = db_get_value_filter('id_agente', 'tagente_modulo', array('id_agente' => $item['id_agent'])); $period = $item['period']; break; case 'event_report_agent': @@ -469,8 +469,21 @@ html_print_input_hidden('id_item', $idItem); $idAgent)); + + //Restore db connection + metaconsole_restore_db(); + } + else { + $agent_name = agents_get_name ($idAgent); + } html_print_input_hidden('id_agent', $idAgent) . - html_print_input_text_extended ('agent', agents_get_name ($idAgent), + html_print_input_text_extended ('agent', $agent_name, 'text-agent', '', 30, 100, false, '', array('style' => 'background: url(images/lightning.png) no-repeat right;')) . ui_print_help_tip(__("Type at least two characters to search"), false); diff --git a/pandora_console/godmode/reporting/reporting_builder.list_items.php b/pandora_console/godmode/reporting/reporting_builder.list_items.php index 4753d8e12f..ccdd586cf9 100644 --- a/pandora_console/godmode/reporting/reporting_builder.list_items.php +++ b/pandora_console/godmode/reporting/reporting_builder.list_items.php @@ -270,14 +270,18 @@ foreach ($items as $item) { $connection = metaconsole_get_connection($server_name); if (!metaconsole_load_external_db($connection)) { //ui_print_error_message ("Error connecting to ".$server_name); - continue; + // Don't skip SLA or top N or general report items + if (($item['type'] != 'SLA') and ($item['type'] != 'top_n') and ($item['type'] != 'general') + and ($item['type'] != 'exception') and ($item['type'] != 'group_report')) + continue; } } if ($item['id_agent'] == 0) { - if ($item['id_agent_module'] == '') { - $row[2] = '-'; - $row[3] = '-'; + // Due to SLA or top N or general report items + if (($item['id_agent_module'] == '') or ($item['id_agent_module'] == 0)) { + $row[2] = ''; + $row[3] = ''; } else { $row[2] = ui_print_truncate_text(agents_get_name(agents_get_module_id($item['id_agent_module'])), 35); @@ -288,7 +292,7 @@ foreach ($items as $item) { $row[2] = ui_print_truncate_text(agents_get_name($item['id_agent']), 35); if ($item['id_agent_module'] == '') { - $row [3] = '-'; + $row [3] = ''; } else { $row[3] = ui_print_truncate_text(db_get_value_filter('nombre', 'tagente_modulo', array('id_agente_modulo' => $item['id_agent_module'])),35);