2012-12-20 Sergio Martin <sergio.martin@artica.es>

* 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)



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7318 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2012-12-20 18:00:00 +00:00
parent e8f3153d11
commit 82e7f50377
10 changed files with 64 additions and 61 deletions

View File

@ -1,3 +1,16 @@
2012-12-20 Sergio Martin <sergio.martin@artica.es>
* 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 <sergio.martin@artica.es> 2012-12-20 Sergio Martin <sergio.martin@artica.es>
* include/ajax/events.php * include/ajax/events.php

View File

@ -178,7 +178,7 @@ $table->data[0][1] = '';
$table->data[0][2] = '<b>' . __('Fields selected') . '</b>'; $table->data[0][2] = '<b>' . __('Fields selected') . '</b>';
$table->data[1][2] = html_print_select($result_selected, 'fields_selected[]', true, '', '', '', true, true, false, '', false, 'width: 200px'); $table->data[1][2] = html_print_select($result_selected, 'fields_selected[]', true, '', '', '', true, true, false, '', false, 'width: 200px');
echo '<form id="custom_events" method="post" action="index.php?sec=geventos&sec2=godmode/events/events&section=fields">'; echo '<form id="custom_events" method="post" action="index.php?sec=geventos&sec2=godmode/events/events&section=fields&amp;pure='.$config['pure'].'">';
html_print_table($table); html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'">'; echo '<div class="action-buttons" style="width: '.$table->width.'">';

View File

@ -39,20 +39,6 @@ if ($id) {
} }
} }
$buttons = array(
'view' => array('active' => false,
'text' => '<a href="index.php?sec=geventos&sec2=operation/events/events">' .
html_print_image("images/zoom.png", true, array("title" => __('View events'))) . '</a>'),
'filter' => array('active' => true,
'text' => '<a href="index.php?sec=geventos&sec2=godmode/events/events&amp;section=filter">' .
html_print_image("images/lightning_go.png", true, array ("title" => __('Create filter'))) . '</a>'),
'fields' => array('active' => false,
'text' => '<a href="index.php?sec=geventos&sec2=godmode/events/events&amp;section=fields">' .
html_print_image("images/god6.png", true, array ("title" => __('Custom fields'))) . '</a>'),
);
ui_print_page_header (__("Manage events") . ' - ' . __('Filters'), "images/lightning_go.png", false, "", true, $buttons);
if ($id) { if ($id) {
$filter = events_get_event_filter ($id); $filter = events_get_event_filter ($id);
$id_group_filter = $filter['id_group_filter']; $id_group_filter = $filter['id_group_filter'];
@ -234,8 +220,15 @@ $params = array();
$params['return'] = true; $params['return'] = true;
$params['show_helptip'] = true; $params['show_helptip'] = true;
$params['input_name'] = 'text_agent'; $params['input_name'] = 'text_agent';
$params['selectbox_group'] = 'id_group';
$params['value'] = $text_agent; $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); $table->data[7][1] = ui_print_agent_autocomplete_input($params);
$lpagination[25] = 25; $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); $tag_with = json_decode($tag_with, true);
if(empty($tag_with)) {
$tag_with = array();
}
$tag_without = json_decode($tag_without, true); $tag_without = json_decode($tag_without, true);
if(empty($tag_without)) {
$tag_without = array();
}
$tags = tags_search_tag(false, false, true); $tags = tags_search_tag(false, false, true);
$tags_select_with = array(); $tags_select_with = array();
$tags_select_without = array(); $tags_select_without = array();
$tag_with_temp = array(); $tag_with_temp = array();
$tag_without_temp = array(); $tag_without_temp = array();
foreach ($tags as $id_tag => $tag) { foreach ($tags as $id_tag => $tag) {
if (array_search($id_tag, $tag_with) === false) { if (array_search($id_tag, $tag_with) === false) {
$tags_select_with[$id_tag] = $tag; $tags_select_with[$id_tag] = $tag;
@ -335,7 +335,7 @@ $table->data[19][1] = html_print_select(
'1' => __('Only alert events')), '1' => __('Only alert events')),
"filter_only_alert", $filter_only_alert, '', '', '', true); "filter_only_alert", $filter_only_alert, '', '', '', true);
echo '<form method="post" action="index.php?sec=geventos&sec2=godmode/events/event_edit_filter">'; echo '<form method="post" action="index.php?sec=geventos&sec2=godmode/events/events&section=edit_filter&pure='.$config['pure'].'">';
html_print_table ($table); html_print_table ($table);

View File

@ -28,24 +28,6 @@ if (! check_acl ($config["id_user"], 0, "IR")) {
$delete = (bool) get_parameter ('delete', 0); $delete = (bool) get_parameter ('delete', 0);
$multiple_delete = (bool)get_parameter('multiple_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' => '<a href="index.php?sec=geventos&sec2=operation/events/events">' .
html_print_image("images/zoom.png", true, array("title" => __('View events'))) . '</a>'),
'filter' => array('active' => true,
'text' => '<a href="index.php?sec=geventos&sec2=godmode/events/events&amp;section=filter">' .
html_print_image("images/lightning_go.png", true, array ("title" => __('Create filter'))) . '</a>'),
'fields' => array('active' => false,
'text' => '<a href="index.php?sec=geventos&sec2=godmode/events/events&amp;section=fields">' .
html_print_image("images/god6.png", true, array ("title" => __('Custom fields'))) . '</a>'),
);
ui_print_page_header (__("Manage events") . ' - ' . __('Filters'), "images/lightning_go.png", false, "", true, $buttons);
}
if ($delete){ if ($delete){
$id = (int) get_parameter('id'); $id = (int) get_parameter('id');
@ -143,13 +125,13 @@ $total_filters = $total_filters[0]['total'];
foreach ($filters as $filter) { foreach ($filters as $filter) {
$data = array (); $data = array ();
$data[0] = '<a href="index.php?sec=geventos&sec2=godmode/events/event_edit_filter&id='.$filter['id_filter'].'">'.$filter['id_name'].'</a>'; $data[0] = '<a href="index.php?sec=geventos&sec2=godmode/events/events&section=edit_filter&id='.$filter['id_filter'].'">'.$filter['id_name'].'</a>';
$data[1] = ui_print_group_icon ($filter['id_group_filter'], true); $data[1] = ui_print_group_icon ($filter['id_group_filter'], true);
$data[2] = events_get_event_types($filter['event_type']); $data[2] = events_get_event_types($filter['event_type']);
$data[3] = events_get_status($filter['status']); $data[3] = events_get_status($filter['status']);
$data[4] = events_get_severity_types($filter['severity']); $data[4] = events_get_severity_types($filter['severity']);
$data[5] = "<a onclick='if(confirm(\"" . __('Are you sure?') . "\")) return true; else return false;' $data[5] = "<a onclick='if(confirm(\"" . __('Are you sure?') . "\")) return true; else return false;'
href='index.php?sec=geventos&sec2=godmode/events/event_filter&delete=1&id=".$filter['id_filter']."&offset=0'>" . href='index.php?sec=geventos&sec2=godmode/events/events&section=filter&delete=1&id=".$filter['id_filter']."&offset=0&pure=".$config['pure']."'>" .
html_print_image('images/cross.png', true, array('title' => __('Delete'))) . "</a>" . html_print_image('images/cross.png', true, array('title' => __('Delete'))) . "</a>" .
html_print_checkbox_extended ('delete_multiple[]', $filter['id_filter'], false, false, '', 'class="check_delete"', true); 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)) { if (isset($data)) {
echo "<form method='post' action='index.php?sec=geventos&sec2=godmode/events/event_filter'>"; echo "<form method='post' action='index.php?sec=geventos&sec2=godmode/events/events&amp;pure=".$config['pure']."'>";
html_print_input_hidden('multiple_delete', 1); html_print_input_hidden('multiple_delete', 1);
html_print_table ($table); html_print_table ($table);
echo "<div style='padding-bottom: 20px; text-align: right; width:" . $table->width . "'>"; echo "<div style='padding-bottom: 20px; text-align: right; width:" . $table->width . "'>";
@ -169,7 +151,7 @@ else {
echo "<div class='nf'>".__('There are no defined filters')."</div>"; echo "<div class='nf'>".__('There are no defined filters')."</div>";
} }
echo '<form method="post" action="index.php?sec=geventos&sec2=godmode/events/event_edit_filter">'; echo '<form method="post" action="index.php?sec=geventos&sec2=godmode/events/events&section=edit_filter&amp;pure='.$config['pure'].'">';
echo "<div style='padding-bottom: 20px; text-align: right; width:" . $table->width . "'>"; echo "<div style='padding-bottom: 20px; text-align: right; width:" . $table->width . "'>";
html_print_submit_button (__('Create filter'), 'crt', false, 'class="sub wand"'); html_print_submit_button (__('Create filter'), 'crt', false, 'class="sub wand"');
echo "</div>"; echo "</div>";

View File

@ -38,6 +38,10 @@ else {
$event_response['type'] = ''; $event_response['type'] = '';
$event_response['target'] = ''; $event_response['target'] = '';
$event_response['id'] = 0; $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%'; $table->width = '90%';
@ -98,7 +102,7 @@ $types = array('url' => __('URL'), 'command' => __('Command'));
$table->data[4] = $data; $table->data[4] = $data;
if($event_response_id == 0) { if($event_response_id == 0) {
echo '<form method="post" action="index.php?sec=geventos&sec2=godmode/events/events&section=responses&mode=list&action=create_response">'; echo '<form method="post" action="index.php?sec=geventos&sec2=godmode/events/events&section=responses&mode=list&action=create_response&amp;pure='.$config['pure'].'">';
html_print_table($table); html_print_table($table);
echo '<br><br><div style="width:90%;text-align:right;">'; echo '<br><br><div style="width:90%;text-align:right;">';
html_print_submit_button(__('Create'), 'create_response_button', false, array('class' => 'sub next')); html_print_submit_button(__('Create'), 'create_response_button', false, array('class' => 'sub next'));
@ -106,7 +110,7 @@ if($event_response_id == 0) {
echo '</form>'; echo '</form>';
} }
else { else {
echo '<form method="post" action="index.php?sec=geventos&sec2=godmode/events/events&section=responses&mode=list&action=update_response">'; echo '<form method="post" action="index.php?sec=geventos&sec2=godmode/events/events&section=responses&mode=list&action=update_response&amp;pure='.$config['pure'].'">';
html_print_table($table); html_print_table($table);
echo '<br><br><div style="width:90%;text-align:right;">'; echo '<br><br><div style="width:90%;text-align:right;">';
html_print_submit_button(__('Update'), 'update_response_button', false, array('class' => 'sub next')); html_print_submit_button(__('Update'), 'update_response_button', false, array('class' => 'sub next'));

View File

@ -26,7 +26,7 @@ if (! check_acl($config['id_user'], 0, "PM")) {
} }
echo '<br><br><div style="width:90%;text-align:right;">'; echo '<br><br><div style="width:90%;text-align:right;">';
echo '<form method="post" action="index.php?sec=geventos&sec2=godmode/events/events&section=responses&mode=editor">'; echo '<form method="post" action="index.php?sec=geventos&sec2=godmode/events/events&section=responses&mode=editor&amp;pure='.$config['pure'].'">';
html_print_submit_button(__('Create response'), 'create_response_button', false, array('class' => 'sub next')); html_print_submit_button(__('Create response'), 'create_response_button', false, array('class' => 'sub next'));
echo '</form>'; echo '</form>';
echo '</div>'; echo '</div>';
@ -58,11 +58,11 @@ $table->data = array();
foreach($event_responses as $response) { foreach($event_responses as $response) {
$data = array(); $data = array();
$data[0] = '<a href="index.php?sec=geventos&sec2=godmode/events/events&section=responses&mode=editor&id_response='.$response['id'].'">'.$response['name'].'</a>'; $data[0] = '<a href="index.php?sec=geventos&sec2=godmode/events/events&section=responses&mode=editor&id_response='.$response['id'].'&amp;pure='.$config['pure'].'">'.$response['name'].'</a>';
$data[1] = $response['description']; $data[1] = $response['description'];
$data[2] = ui_print_group_icon ($response['id_group'], true); $data[2] = ui_print_group_icon ($response['id_group'], true);
$data[3] = '<a href="index.php?sec=geventos&sec2=godmode/events/events&section=responses&action=delete_response&id_response='.$response['id'].'">'.html_print_image('images/cross.png', true, array('title'=>__('Delete'))).'</a>'; $data[3] = '<a href="index.php?sec=geventos&sec2=godmode/events/events&section=responses&action=delete_response&id_response='.$response['id'].'&amp;pure='.$config['pure'].'">'.html_print_image('images/cross.png', true, array('title'=>__('Delete'))).'</a>';
$data[3] .= '&nbsp;<a href="index.php?sec=geventos&sec2=godmode/events/events&section=responses&mode=editor&id_response='.$response['id'].'">'.html_print_image('images/pencil.png', true, array('title'=>__('Edit'))).'</a>'; $data[3] .= '&nbsp;<a href="index.php?sec=geventos&sec2=godmode/events/events&section=responses&mode=editor&id_response='.$response['id'].'&amp;pure='.$config['pure'].'">'.html_print_image('images/pencil.png', true, array('title'=>__('Edit'))).'</a>';
$table->data[] = $data; $table->data[] = $data;
} }

View File

@ -30,19 +30,19 @@ $section = (string) get_parameter ("section", "filter");
// Draws header // Draws header
$buttons = array( $buttons = array(
'view' => array('active' => false,
'text' => '<a href="index.php?sec=eventos&sec2=operation/events/events">' .
html_print_image("images/zoom.png", true, array("title" => __('View events'))) . '</a>'),
'separator' => '',
'filter' => array('active' => false, 'filter' => array('active' => false,
'text' => '<a href="index.php?sec=geventos&sec2=godmode/events/events&amp;section=filter">' . 'text' => '<a href="index.php?sec=geventos&sec2=godmode/events/events&amp;section=filter&amp;pure='.$config['pure'].'">' .
html_print_image("images/lightning_go.png", true, array ("title" => __('Create filter'))) . '</a>'), html_print_image("images/lightning_go.png", true, array ("title" => __('Create filter'))) . '</a>'),
'responses' => array('active' => false, 'responses' => array('active' => false,
'text' => '<a href="index.php?sec=geventos&sec2=godmode/events/events&amp;section=responses">' . 'text' => '<a href="index.php?sec=geventos&sec2=godmode/events/events&amp;section=responses&amp;pure='.$config['pure'].'">' .
html_print_image("images/cog.png", true, array ("title" => __('Event responses'))) . '</a>'), html_print_image("images/cog.png", true, array ("title" => __('Event responses'))) . '</a>'),
'fields' => array('active' => false, 'fields' => array('active' => false,
'text' => '<a href="index.php?sec=geventos&sec2=godmode/events/events&amp;section=fields">' . 'text' => '<a href="index.php?sec=geventos&sec2=godmode/events/events&amp;section=fields&amp;pure='.$config['pure'].'">' .
html_print_image("images/god6.png", true, array ("title" => __('Custom fields'))) . '</a>'), html_print_image("images/pencil.png", true, array ("title" => __('Custom fields'))) . '</a>'),
'separator' => '',
'view' => array('active' => false,
'text' => '<a href="index.php?sec=eventos&sec2=operation/events/events&amp;pure='.$config['pure'].'">' .
html_print_image("images/god6.png", true, array("title" => __('View events'))) . '</a>'),
); );
switch ($section) { switch ($section) {
@ -77,6 +77,9 @@ switch ($section) {
include_once($config["homedir"] . '/include/functions_events.php'); include_once($config["homedir"] . '/include/functions_events.php');
switch($section) { switch($section) {
case 'edit_filter':
require_once($config["homedir"] . '/godmode/events/event_edit_filter.php');
break;
case 'filter': case 'filter':
require_once($config["homedir"] . '/godmode/events/event_filter.php'); require_once($config["homedir"] . '/godmode/events/event_filter.php');
break; break;

View File

@ -198,7 +198,7 @@ $url = "index.php?sec=eventos&amp;sec2=operation/events/events&amp;search=" .
$event_view_hr . "&amp;id_user_ack=" . $id_user_ack; $event_view_hr . "&amp;id_user_ack=" . $id_user_ack;
// Header // Header
if ($config["pure"] == 0) { if ($config["pure"] == 0 || defined ('METACONSOLE')) {
$pss = get_user_info($config['id_user']); $pss = get_user_info($config['id_user']);
$hashup = md5($config['id_user'] . $pss['password']); $hashup = md5($config['id_user'] . $pss['password']);
@ -209,7 +209,7 @@ if ($config["pure"] == 0) {
// Event list // Event list
$list['active'] = false; $list['active'] = false;
$list['text'] = '<a href="index.php?sec=eventos&sec2=operation/events/events">' . $list['text'] = '<a href="index.php?sec=eventos&sec2=operation/events/events&amp;pure='.$config['pure'].'">' .
html_print_image("images/god6.png", true, array("title" => __('Event list'))) . '</a>'; html_print_image("images/god6.png", true, array("title" => __('Event list'))) . '</a>';
$rss['active'] = false; $rss['active'] = false;
$rss['text'] = '<a href="operation/events/events_rss.php?user=' . $config['id_user'] . '&hashup=' . $hashup . $rss['text'] = '<a href="operation/events/events_rss.php?user=' . $config['id_user'] . '&hashup=' . $hashup .
@ -233,17 +233,18 @@ if ($config["pure"] == 0) {
if (check_acl ($config["id_user"], 0, "IW")) { if (check_acl ($config["id_user"], 0, "IW")) {
// Manage events // Manage events
$manage_events['active'] = false; $manage_events['active'] = false;
$manage_events['text'] = '<a href="index.php?sec=geventos&sec2=godmode/events/events&amp;section=filter">' . $manage_events['text'] = '<a href="index.php?sec=geventos&sec2=godmode/events/events&amp;section=filter&amp;pure='.$config['pure'].'">' .
html_print_image("images/setup.png", true, array ("title" => __('Manage events'))) . '</a>'; html_print_image("images/setup.png", true, array ("title" => __('Manage events'))) . '</a>';
$onheader = array('manage_events' => $manage_events, $onheader = array(
'separator' => '', 'separator' => '',
'fullscreen' => $fullscreen, 'fullscreen' => $fullscreen,
'list' => $list, 'list' => $list,
'rss' => $rss, 'rss' => $rss,
'marquee' => $marquee, 'marquee' => $marquee,
'csv' => $csv, 'csv' => $csv,
'sound_event' => $sound_event) ; 'sound_event' => $sound_event,
'manage_events' => $manage_events) ;
} }
else { else {
$onheader = array('fullscreen' => $fullscreen, $onheader = array('fullscreen' => $fullscreen,

View File

@ -360,7 +360,7 @@ echo '</td>';
echo "<td>" . __('Agent search') . "</td>"; echo "<td>" . __('Agent search') . "</td>";
echo '<td class="datos">'; echo '<td class="datos">';
$params = array(); $params = array();
$params['show_helptip'] = false; $params['show_helptip'] = true;
$params['input_name'] = 'text_agent'; $params['input_name'] = 'text_agent';
$params['value'] = $text_agent; $params['value'] = $text_agent;

View File

@ -258,7 +258,7 @@ if (is_ajax ())
$rows = db_get_all_rows_sql($sql); $rows = db_get_all_rows_sql($sql);
$countRows = count ($rows); $countRows = count ($rows);
if (defined ('METACONSOLE')) { if (defined ('METACONSOLE')) {
metaconsole_restore_db(); metaconsole_restore_db_force();
} }
if ($countRows === 0) { if ($countRows === 0) {