2011-12-07 Juan Manuel Ramon <juanmanuel.ramon@artica.es>

* operation/events/events_list.php
	operation/events/events.php: Added filter to hide/show alert events 
	in this view.
	
	Pending task: #3406323



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5235 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
juanmanuelr 2011-12-07 08:50:34 +00:00
parent b7f6598117
commit d9662cfcce
3 changed files with 27 additions and 1 deletions

View File

@ -1,3 +1,11 @@
2011-12-07 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* operation/events/events_list.php
operation/events/events.php: Added filter to hide/show alert events
in this view.
Pending task: #3406323
2011-12-05 Juan Manuel Ramon <juanmanuel.ramon@artica.es> 2011-12-05 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* operation/agentes/status_monitor.php: Added sort funcionality * operation/agentes/status_monitor.php: Added sort funcionality

View File

@ -167,6 +167,7 @@ $delete = (bool) get_parameter ("delete");
$validate = (bool) get_parameter ("validate", 0); $validate = (bool) get_parameter ("validate", 0);
$section = (string) get_parameter ("section", "list"); $section = (string) get_parameter ("section", "list");
$text_agent = (string)get_parameter('text_agent', __("All")); $text_agent = (string)get_parameter('text_agent', __("All"));
$filter_only_alert = (int)get_parameter('filter_only_alert', 0);
$search = io_safe_output(preg_replace ("/&([A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/", "&", rawurldecode (get_parameter ("search")))); $search = io_safe_output(preg_replace ("/&([A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/", "&", rawurldecode (get_parameter ("search"))));

View File

@ -141,13 +141,21 @@ if ($tag != "") {
$sql_post .= " AND tags LIKE '%".io_safe_input($tag)."%'"; $sql_post .= " AND tags LIKE '%".io_safe_input($tag)."%'";
} }
// Filter/Only alerts
if (isset($filter_only_alert)){
if ($filter_only_alert == 0)
$sql_post .= " AND event_type NOT LIKE '%alert%'";
else
$sql_post .= " AND event_type LIKE '%alert%'";
}
$url = "index.php?sec=eventos&amp;sec2=operation/events/events&amp;search=" . $url = "index.php?sec=eventos&amp;sec2=operation/events/events&amp;search=" .
rawurlencode(io_safe_input($search)) . "&amp;event_type=" . $event_type . rawurlencode(io_safe_input($search)) . "&amp;event_type=" . $event_type .
"&amp;severity=" . $severity . "&amp;status=" . $status . "&amp;ev_group=" . "&amp;severity=" . $severity . "&amp;status=" . $status . "&amp;ev_group=" .
$ev_group . "&amp;refr=" . $config["refr"] . "&amp;id_agent=" . $ev_group . "&amp;refr=" . $config["refr"] . "&amp;id_agent=" .
$id_agent . "&amp;id_event=" . $id_event . "&amp;pagination=" . $id_agent . "&amp;id_event=" . $id_event . "&amp;pagination=" .
$pagination . "&amp;group_rep=" . $group_rep . "&amp;event_view_hr=" . $pagination . "&amp;group_rep=" . $group_rep . "&amp;event_view_hr=" .
$event_view_hr . "&amp;id_user_ack=" . $id_user_ack . "&amp;tag=" . $tag . "&amp;offset=" . $offset; $event_view_hr . "&amp;id_user_ack=" . $id_user_ack . "&amp;tag=" . $tag . "&amp;filter_only_alert=" . $filter_only_alert . "&amp;offset=" . $offset;
echo "<br>"; echo "<br>";
//Link to toggle filter //Link to toggle filter
@ -260,8 +268,17 @@ foreach($tags as $t) {
html_print_select ($tags_name, "tag", $tag, '', __('All'), ""); html_print_select ($tags_name, "tag", $tag, '', __('All'), "");
echo "</td>";
echo "<td>";
echo __("Filter/Only alert events") . "</td><td>";
html_print_select (array('0' => __('Filter alert events'), '1' => __('Only alert events')), "filter_only_alert", $filter_only_alert, '', '', '');
echo "</td></tr>"; echo "</td></tr>";
echo '<tr><td colspan="4" style="text-align:right">'; echo '<tr><td colspan="4" style="text-align:right">';
//The buttons //The buttons
html_print_submit_button (__('Update'), '', false, 'class="sub upd"'); html_print_submit_button (__('Update'), '', false, 'class="sub upd"');