From eab7124396d2434dfdf79e248f29ec0e6a09d7d1 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Mon, 29 Apr 2013 14:09:01 +0000 Subject: [PATCH] 2013-04-25 Miguel de Dios * extensions/update_manager/update_pandora.php: cleaned source code style. * include/functions_events.php, operation/events/events.build_table.php: show columns by group in metaconsole. Fixes: #3609374 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8083 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 11 ++++++ .../update_manager/update_pandora.php | 2 +- pandora_console/include/functions_events.php | 37 +++++++++++++++++++ .../operation/events/events.build_table.php | 7 +++- 4 files changed, 55 insertions(+), 2 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 0dd59e5449..e4a7fc2c77 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,14 @@ +2013-04-25 Miguel de Dios + + * extensions/update_manager/update_pandora.php: cleaned source code + style. + + * include/functions_events.php, + operation/events/events.build_table.php: show columns by group in + metaconsole. + + Fixes: #3609374 + 2013-04-29 Sergio Martin * images/mod_async_proc.png diff --git a/pandora_console/extensions/update_manager/update_pandora.php b/pandora_console/extensions/update_manager/update_pandora.php index aa57a8750c..9cafb50e08 100644 --- a/pandora_console/extensions/update_manager/update_pandora.php +++ b/pandora_console/extensions/update_manager/update_pandora.php @@ -79,7 +79,7 @@ function update_pandora_administration($settings, $user_key) { $conf_update_pandora = update_pandora_get_conf(); - if (!empty($conf_update_pandora['last_installed'])) { + if (!empty($conf_update_pandora['last_installed'])){ echo '

'; echo __('Your Pandora FMS open source package installed is') . ' ' . $conf_update_pandora['last_installed']; diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index bcee7cc595..8a9ef49aa8 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -18,11 +18,40 @@ include_once($config['homedir'] . "/include/functions_ui.php"); include_once($config['homedir'] . "/include/functions_tags.php"); enterprise_include_once ('meta/include/functions_events_meta.php'); + + /** * @package Include * @subpackage Events */ +function events_get_all_fields() { + + $columns = array(); + + $columns['id_evento'] = __('Event id'); + $columns['evento'] = __('Event name'); + $columns['id_agente'] = __('Agent name'); + $columns['id_usuario'] = __('User'); + $columns['id_grupo'] = __('Group'); + $columns['estado'] = __('Status'); + $columns['timestamp'] = __('Timestamp'); + $columns['event_type'] = __('Event type'); + $columns['id_agentmodule'] = __('Agent module'); + $columns['id_alert_am'] = __('Alert'); + $columns['criticity'] = __('Criticity'); + $columns['user_comment'] = __('Comment'); + $columns['tags'] = __('Tags'); + $columns['source'] = __('Source'); + $columns['id_extra'] = __('Extra id'); + $columns['owner_user'] = __('Owner'); + $columns['ack_utimestamp'] = __('ACK Timestamp'); + $columns['instructions'] = __('Instructions'); + $columns['server_name'] = __('Server name'); + + return $columns; +} + /** * Get all rows of events from the database, that * pass the filter, and can get only some fields. @@ -50,6 +79,14 @@ function events_get_events ($filter = false, $fields = false) { return db_get_all_rows_filter ('tevento', $filter, $fields); } +/** + * Get the event with the id pass as parameter. + * + * @param int $id Event id + * @param mixed $fields The fields to show or by default all with false. + * + * @return mixed False in case of error or invalid values passed. Event row otherwise + */ function events_get_event ($id, $fields = false) { if (empty ($id)) return false; diff --git a/pandora_console/operation/events/events.build_table.php b/pandora_console/operation/events/events.build_table.php index 87e808c8a9..a1fd3e8309 100644 --- a/pandora_console/operation/events/events.build_table.php +++ b/pandora_console/operation/events/events.build_table.php @@ -23,7 +23,12 @@ $table->head = array (); $table->data = array (); //fields that the user has selected to show -$show_fields = explode (',', $config['event_fields']); +if ($meta) { + $show_fields = events_meta_get_custom_fields_user(); +} +else { + $show_fields = explode (',', $config['event_fields']); +} //headers $i = 0;