diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index d54cfafe93..8d3f2303c0 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,16 @@ +2012-12-20 Sergio Martin + + * operation/tree.php + operation/events/events_list.php + operation/events/events.php + godmode/events/event_edit_filter.php + godmode/events/event_responses.list.php + godmode/events/custom_events.php + godmode/events/events.php + godmode/events/event_filter.php + godmode/events/event_responses.editor.php: Fix several links + in events manager for metaconsole (things like pure parameter) + 2012-12-20 Sergio Martin * include/ajax/events.php diff --git a/pandora_console/godmode/events/custom_events.php b/pandora_console/godmode/events/custom_events.php index 5ab4f20d8d..bece2513dc 100644 --- a/pandora_console/godmode/events/custom_events.php +++ b/pandora_console/godmode/events/custom_events.php @@ -178,7 +178,7 @@ $table->data[0][1] = ''; $table->data[0][2] = '' . __('Fields selected') . ''; $table->data[1][2] = html_print_select($result_selected, 'fields_selected[]', true, '', '', '', true, true, false, '', false, 'width: 200px'); -echo '
'; +echo ''; html_print_table($table); echo '
'; diff --git a/pandora_console/godmode/events/event_edit_filter.php b/pandora_console/godmode/events/event_edit_filter.php index 470926d2f2..ad4add2833 100644 --- a/pandora_console/godmode/events/event_edit_filter.php +++ b/pandora_console/godmode/events/event_edit_filter.php @@ -39,20 +39,6 @@ if ($id) { } } -$buttons = array( - 'view' => array('active' => false, - 'text' => '' . - html_print_image("images/zoom.png", true, array("title" => __('View events'))) . ''), - 'filter' => array('active' => true, - 'text' => '' . - html_print_image("images/lightning_go.png", true, array ("title" => __('Create filter'))) . ''), - 'fields' => array('active' => false, - 'text' => '' . - html_print_image("images/god6.png", true, array ("title" => __('Custom fields'))) . ''), - ); - -ui_print_page_header (__("Manage events") . ' - ' . __('Filters'), "images/lightning_go.png", false, "", true, $buttons); - if ($id) { $filter = events_get_event_filter ($id); $id_group_filter = $filter['id_group_filter']; @@ -234,8 +220,15 @@ $params = array(); $params['return'] = true; $params['show_helptip'] = true; $params['input_name'] = 'text_agent'; -$params['selectbox_group'] = 'id_group'; $params['value'] = $text_agent; +$params['selectbox_group'] = 'id_group'; + +if(defined('METACONSOLE')) { + $params['javascript_page'] = 'enterprise/meta/include/ajax/events.ajax'; +} + +ui_print_agent_autocomplete_input($params); + $table->data[7][1] = ui_print_agent_autocomplete_input($params); $lpagination[25] = 25; @@ -261,13 +254,20 @@ $table->data[11][1] = html_print_select ($repeated_sel, "group_rep", $group_rep, $tag_with = json_decode($tag_with, true); +if(empty($tag_with)) { + $tag_with = array(); +} $tag_without = json_decode($tag_without, true); +if(empty($tag_without)) { + $tag_without = array(); +} $tags = tags_search_tag(false, false, true); $tags_select_with = array(); $tags_select_without = array(); $tag_with_temp = array(); $tag_without_temp = array(); + foreach ($tags as $id_tag => $tag) { if (array_search($id_tag, $tag_with) === false) { $tags_select_with[$id_tag] = $tag; @@ -335,7 +335,7 @@ $table->data[19][1] = html_print_select( '1' => __('Only alert events')), "filter_only_alert", $filter_only_alert, '', '', '', true); -echo ''; +echo ''; html_print_table ($table); diff --git a/pandora_console/godmode/events/event_filter.php b/pandora_console/godmode/events/event_filter.php index f78bbac65d..fb01e24d19 100644 --- a/pandora_console/godmode/events/event_filter.php +++ b/pandora_console/godmode/events/event_filter.php @@ -28,24 +28,6 @@ if (! check_acl ($config["id_user"], 0, "IR")) { $delete = (bool) get_parameter ('delete', 0); $multiple_delete = (bool)get_parameter('multiple_delete', 0); -// Show header in delete action -if ($delete or $multiple_delete){ - // Prints header tabs - $buttons = array( - 'view' => array('active' => false, - 'text' => '' . - html_print_image("images/zoom.png", true, array("title" => __('View events'))) . ''), - 'filter' => array('active' => true, - 'text' => '' . - html_print_image("images/lightning_go.png", true, array ("title" => __('Create filter'))) . ''), - 'fields' => array('active' => false, - 'text' => '' . - html_print_image("images/god6.png", true, array ("title" => __('Custom fields'))) . ''), - ); - - ui_print_page_header (__("Manage events") . ' - ' . __('Filters'), "images/lightning_go.png", false, "", true, $buttons); -} - if ($delete){ $id = (int) get_parameter('id'); @@ -143,13 +125,13 @@ $total_filters = $total_filters[0]['total']; foreach ($filters as $filter) { $data = array (); - $data[0] = ''.$filter['id_name'].''; + $data[0] = ''.$filter['id_name'].''; $data[1] = ui_print_group_icon ($filter['id_group_filter'], true); $data[2] = events_get_event_types($filter['event_type']); $data[3] = events_get_status($filter['status']); $data[4] = events_get_severity_types($filter['severity']); $data[5] = "" . + href='index.php?sec=geventos&sec2=godmode/events/events§ion=filter&delete=1&id=".$filter['id_filter']."&offset=0&pure=".$config['pure']."'>" . html_print_image('images/cross.png', true, array('title' => __('Delete'))) . "" . html_print_checkbox_extended ('delete_multiple[]', $filter['id_filter'], false, false, '', 'class="check_delete"', true); @@ -157,7 +139,7 @@ foreach ($filters as $filter) { } if (isset($data)) { - echo ""; + echo ""; html_print_input_hidden('multiple_delete', 1); html_print_table ($table); echo "
"; @@ -169,7 +151,7 @@ else { echo "
".__('There are no defined filters')."
"; } -echo ''; +echo ''; echo "
"; html_print_submit_button (__('Create filter'), 'crt', false, 'class="sub wand"'); echo "
"; @@ -186,4 +168,4 @@ function check_all_checkboxes() { $(".check_delete").attr('checked', false); } } - \ No newline at end of file + diff --git a/pandora_console/godmode/events/event_responses.editor.php b/pandora_console/godmode/events/event_responses.editor.php index b3925c9e44..ff0735383e 100644 --- a/pandora_console/godmode/events/event_responses.editor.php +++ b/pandora_console/godmode/events/event_responses.editor.php @@ -38,6 +38,10 @@ else { $event_response['type'] = ''; $event_response['target'] = ''; $event_response['id'] = 0; + $event_response['new_window'] = 1; + $event_response['modal_width'] = 0; + $event_response['modal_height'] = 0; + $event_response['params'] = ''; } $table->width = '90%'; @@ -98,7 +102,7 @@ $types = array('url' => __('URL'), 'command' => __('Command')); $table->data[4] = $data; if($event_response_id == 0) { - echo ''; + echo ''; html_print_table($table); echo '

'; html_print_submit_button(__('Create'), 'create_response_button', false, array('class' => 'sub next')); @@ -106,7 +110,7 @@ if($event_response_id == 0) { echo ''; } else { - echo '
'; + echo ''; html_print_table($table); echo '

'; html_print_submit_button(__('Update'), 'update_response_button', false, array('class' => 'sub next')); diff --git a/pandora_console/godmode/events/event_responses.list.php b/pandora_console/godmode/events/event_responses.list.php index 27dacca8a4..aab5aae500 100644 --- a/pandora_console/godmode/events/event_responses.list.php +++ b/pandora_console/godmode/events/event_responses.list.php @@ -26,7 +26,7 @@ if (! check_acl($config['id_user'], 0, "PM")) { } echo '

'; -echo ''; +echo ''; html_print_submit_button(__('Create response'), 'create_response_button', false, array('class' => 'sub next')); echo ''; echo '
'; @@ -58,11 +58,11 @@ $table->data = array(); foreach($event_responses as $response) { $data = array(); - $data[0] = ''.$response['name'].''; + $data[0] = ''.$response['name'].''; $data[1] = $response['description']; $data[2] = ui_print_group_icon ($response['id_group'], true); - $data[3] = ''.html_print_image('images/cross.png', true, array('title'=>__('Delete'))).''; - $data[3] .= ' '.html_print_image('images/pencil.png', true, array('title'=>__('Edit'))).''; + $data[3] = ''.html_print_image('images/cross.png', true, array('title'=>__('Delete'))).''; + $data[3] .= ' '.html_print_image('images/pencil.png', true, array('title'=>__('Edit'))).''; $table->data[] = $data; } diff --git a/pandora_console/godmode/events/events.php b/pandora_console/godmode/events/events.php index b95ea2005b..2bb1e770a9 100644 --- a/pandora_console/godmode/events/events.php +++ b/pandora_console/godmode/events/events.php @@ -30,19 +30,19 @@ $section = (string) get_parameter ("section", "filter"); // Draws header $buttons = array( - 'view' => array('active' => false, - 'text' => '' . - html_print_image("images/zoom.png", true, array("title" => __('View events'))) . ''), - 'separator' => '', 'filter' => array('active' => false, - 'text' => '' . + 'text' => '' . html_print_image("images/lightning_go.png", true, array ("title" => __('Create filter'))) . ''), 'responses' => array('active' => false, - 'text' => '' . + 'text' => '' . html_print_image("images/cog.png", true, array ("title" => __('Event responses'))) . ''), 'fields' => array('active' => false, - 'text' => '' . - html_print_image("images/god6.png", true, array ("title" => __('Custom fields'))) . ''), + 'text' => '' . + html_print_image("images/pencil.png", true, array ("title" => __('Custom fields'))) . ''), + 'separator' => '', + 'view' => array('active' => false, + 'text' => '' . + html_print_image("images/god6.png", true, array("title" => __('View events'))) . ''), ); switch ($section) { @@ -77,6 +77,9 @@ switch ($section) { include_once($config["homedir"] . '/include/functions_events.php'); switch($section) { + case 'edit_filter': + require_once($config["homedir"] . '/godmode/events/event_edit_filter.php'); + break; case 'filter': require_once($config["homedir"] . '/godmode/events/event_filter.php'); break; diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index 3d6a7c0973..77f9196388 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -198,7 +198,7 @@ $url = "index.php?sec=eventos&sec2=operation/events/events&search=" . $event_view_hr . "&id_user_ack=" . $id_user_ack; // Header -if ($config["pure"] == 0) { +if ($config["pure"] == 0 || defined ('METACONSOLE')) { $pss = get_user_info($config['id_user']); $hashup = md5($config['id_user'] . $pss['password']); @@ -209,7 +209,7 @@ if ($config["pure"] == 0) { // Event list $list['active'] = false; - $list['text'] = '' . + $list['text'] = '' . html_print_image("images/god6.png", true, array("title" => __('Event list'))) . ''; $rss['active'] = false; $rss['text'] = '' . html_print_image("images/setup.png", true, array ("title" => __('Manage events'))) . ''; - $onheader = array('manage_events' => $manage_events, + $onheader = array( 'separator' => '', 'fullscreen' => $fullscreen, 'list' => $list, 'rss' => $rss, 'marquee' => $marquee, 'csv' => $csv, - 'sound_event' => $sound_event) ; + 'sound_event' => $sound_event, + 'manage_events' => $manage_events) ; } else { $onheader = array('fullscreen' => $fullscreen, diff --git a/pandora_console/operation/events/events_list.php b/pandora_console/operation/events/events_list.php index 42474a5c97..5b45e45230 100644 --- a/pandora_console/operation/events/events_list.php +++ b/pandora_console/operation/events/events_list.php @@ -360,7 +360,7 @@ echo ''; echo "" . __('Agent search') . ""; echo ''; $params = array(); -$params['show_helptip'] = false; +$params['show_helptip'] = true; $params['input_name'] = 'text_agent'; $params['value'] = $text_agent; diff --git a/pandora_console/operation/tree.php b/pandora_console/operation/tree.php index 3c4e603026..e0bd9aba73 100644 --- a/pandora_console/operation/tree.php +++ b/pandora_console/operation/tree.php @@ -258,7 +258,7 @@ if (is_ajax ()) $rows = db_get_all_rows_sql($sql); $countRows = count ($rows); if (defined ('METACONSOLE')) { - metaconsole_restore_db(); + metaconsole_restore_db_force(); } if ($countRows === 0) {