diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 197afc9582..c631245345 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,12 @@ +2013-01-17 Sergio Martin + + * operation/events/events_list.php + images/books.png + godmode/reporting/reporting_builder.item_editor.php: Adapt + the reports item of events to metaconsole, add a new + image to history events and fix little bugs in events list + as parameters pass in pagination + 2013-01-16 Vanessa Gil * include/functions_api.php: Added 'agent_name' and diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index 8af73bd958..985fa15d66 100644 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -22,6 +22,13 @@ if (! check_acl ($config['id_user'], 0, "RW")) { require ("general/noaccess.php"); exit; } + +if (($config['metaconsole'] == 1) && (defined('METACONSOLE'))) { + $meta = true; +} +else { + $meta = false; +} $show_graph_options = Array(); $show_graph_options[0] = __('Only table'); $show_graph_options[1] = __('Table & Graph'); @@ -137,7 +144,7 @@ switch ($action) { $server_name = $item ['server_name']; // Metaconsole db connection - if (($config ['metaconsole'] == 1) && ($server_name != '') && defined('METACONSOLE')) { + if ($meta && $server_name != '') { $connection = metaconsole_get_connection($server_name); if (metaconsole_load_external_db($connection) != NOERR) { //ui_print_error_message ("Error connecting to ".$server_name); @@ -433,8 +440,7 @@ switch ($action) { } //Restore db connection - if (($config ['metaconsole'] == 1) && ($server_name != '') - && defined('METACONSOLE')) { + if ($meta && $server_name != '') { metaconsole_restore_db(); } } @@ -604,7 +610,7 @@ html_print_input_hidden('id_item', $idItem); @@ -652,7 +675,7 @@ html_print_input_hidden('id_item', $idItem); if($idAgent) { $sql = "SELECT id_agente_modulo, nombre FROM tagente_modulo WHERE id_agente = " . $idAgent . " AND delete_pending = 0"; - if ($config['metaconsole'] == 1 && defined('METACONSOLE')) { + if ($meta) { $connection = metaconsole_get_connection($server_name); if (metaconsole_load_external_db($connection) == NOERR) { @@ -737,7 +760,7 @@ html_print_input_hidden('id_item', $idItem); $item['id_agent_module'])); $server_name_element = ''; - if (($config ['metaconsole'] == 1) && ($server_name != '') && defined('METACONSOLE')) + if ($meta && $server_name != '') $server_name_element .= ' (' . $server_name . ')'; echo ' @@ -1037,7 +1060,7 @@ function print_SLA_list($width, $action, $idItem = null) { ' . html_print_image("images/cross.png", true) . ' '; - if ($config ['metaconsole'] == 1 && defined('METACONSOLE')) { + if ($meta) { //Restore db connection metaconsole_restore_db(); } @@ -1071,7 +1094,7 @@ function print_SLA_list($width, $action, $idItem = null) { $params['add_none_module'] = false; $params['use_input_server'] = true; $params['input_server_id'] = 'hidden-server_name'; - if (defined('METACONSOLE')) { + if ($meta) { $params['disabled_javascript_on_blur_function'] = true; } ui_print_agent_autocomplete_input($params); @@ -1127,7 +1150,7 @@ function print_General_list($width, $action, $idItem = null) { foreach ($itemsGeneral as $item) { $server_name = $item ['server_name']; // Metaconsole db connection - if (($config ['metaconsole'] == 1) && ($server_name != '') && defined('METACONSOLE')) { + if ($meta && $server_name != '') { $connection = metaconsole_get_connection($server_name); if (metaconsole_load_external_db($connection) != NOERR) { //ui_print_error_message ("Error connecting to ".$server_name); @@ -1139,7 +1162,7 @@ function print_General_list($width, $action, $idItem = null) { $nameModule = db_get_value_filter('nombre', 'tagente_modulo', array('id_agente_modulo' => $item['id_agent_module'])); $server_name_element = ''; - if (($config ['metaconsole'] == 1) && ($server_name != '') && defined('METACONSOLE')) + if ($meta && $server_name != '') $server_name_element .= ' (' . $server_name . ')'; echo ' @@ -1150,7 +1173,7 @@ function print_General_list($width, $action, $idItem = null) { ' . html_print_image("images/cross.png", true) . ' '; - if ($config ['metaconsole'] == 1 && defined('METACONSOLE')) { + if ($meta) { //Restore db connection metaconsole_restore_db(); } @@ -1182,7 +1205,7 @@ function print_General_list($width, $action, $idItem = null) { $params['add_none_module'] = false; $params['use_input_server'] = true; $params['input_server_id'] = 'hidden-server_name_general'; - if (defined('METACONSOLE')) { + if ($meta) { $params['disabled_javascript_on_blur_function'] = true; } ui_print_agent_autocomplete_input($params); @@ -1230,7 +1253,7 @@ function create_custom_graph() { global $config; // Metaconsole activated - if ($config['metaconsole'] == 1 && defined('METACONSOLE')) { + if ($meta) { ?> var target_server = $("#meta_servers").val(); // If target server is not selected @@ -1291,7 +1314,7 @@ function edit_custom_graph() { global $config; // Metaconsole activated - if ($config['metaconsole'] == 1 && defined('METACONSOLE')) { + if ($meta) { ?> var agent_server_temp; var id_element_graph; @@ -1677,6 +1700,9 @@ function chooseType() { $("#row_max_values").hide(); $("#row_resolution").hide(); + $('#agent_autocomplete').show(); + $('#agent_autocomplete_events').hide(); + switch (type) { case 'event_report_group': $("#row_description").show(); @@ -1882,6 +1908,9 @@ function chooseType() { $("#row_show_in_two_columns").show(); $("#row_event_filter").show(); $("#row_event_graphs").show(); + + $('#agent_autocomplete').hide(); + $('#agent_autocomplete_events').show(); break; case 'event_report_module': $("#row_description").show(); @@ -1889,6 +1918,9 @@ function chooseType() { $("#row_module").show(); $("#row_period").show(); $("#row_show_in_two_columns").show(); + + $('#agent_autocomplete').hide(); + $('#agent_autocomplete_events').show(); break; case 'general': $("#row_description").show(); diff --git a/pandora_console/images/books.png b/pandora_console/images/books.png new file mode 100644 index 0000000000..571b0c67bd Binary files /dev/null and b/pandora_console/images/books.png differ diff --git a/pandora_console/operation/events/events_list.php b/pandora_console/operation/events/events_list.php index 24a87f369f..d7d63df937 100644 --- a/pandora_console/operation/events/events_list.php +++ b/pandora_console/operation/events/events_list.php @@ -322,6 +322,10 @@ $url = "index.php?sec=eventos&sec2=operation/events/events&search=" . "&history=" . (int)$history . "&section=" . $section; +if($meta) { + $url .= "&text_agent=" . $text_agent; +} + echo "
"; //Link to toggle filter if (!empty($id_name)) {