From bad0b9141a34af919bc66666c34fd212389cff20 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Fri, 30 Oct 2009 18:56:12 +0000 Subject: [PATCH] 2009-10-30 Ramon Novoa * operation/snmpconsole/snmp_view.php: Added a status filter. Fixed deletion confirmation. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2067 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++++ .../operation/snmpconsole/snmp_view.php | 16 ++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index eba4aa4b21..4cd311cf16 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2009-10-30 Ramon Novoa + + * operation/snmpconsole/snmp_view.php: Added a status filter. Fixed + deletion confirmation. + 2009-10-30 Miguel de Dios * include/functions_api.php: fix the tiny bug that not set the default diff --git a/pandora_console/operation/snmpconsole/snmp_view.php b/pandora_console/operation/snmpconsole/snmp_view.php index a80b10c879..9e77074578 100644 --- a/pandora_console/operation/snmpconsole/snmp_view.php +++ b/pandora_console/operation/snmpconsole/snmp_view.php @@ -33,6 +33,7 @@ $filter_agent = (string) get_parameter ("filter_agent", ''); $filter_oid = (string) get_parameter ("filter_oid", ''); $filter_severity = (int) get_parameter ("filter_severity", -1); $filter_fired = (int) get_parameter ("filter_fired", -1); +$filter_status = (int) get_parameter ("filter_status", 0); $search_string = (string) get_parameter ("search_string", ''); $pagination = (int) get_parameter ("pagination", $config["block_size"]); $offset = (int) get_parameter ('offset',0); @@ -176,6 +177,13 @@ $table->data[2][1] = print_select ($paginations, "pagination", $pagination, 'thi $table->data[2][2] = ''.__('Severity').''; $table->data[2][3] = print_select ($severities, 'filter_severity', $filter_severity, 'this.form.submit();', __('All'), -1, true); +// Status +$table->data[3][0] = ''.__('Status').''; +$status[-1] = __('All'); +$status[0] = __('Not validated'); +$status[1] = __('Validated'); +$table->data[3][1] = print_select ($status, 'filter_status', $filter_status, 'this.form.submit();', '', '', true); + print_table ($table); unset ($table); @@ -253,6 +261,10 @@ foreach ($traps as $trap) { continue; } + if ($filter_status != -1 && $trap["status"] != $filter_status) { + continue; + } + $severity = enterprise_hook ('get_severity', array ($trap)); if ($severity === ENTERPRISE_NOT_HOOK) { $severity = $trap["alerted"] == 1 ? $trap["priority"] : 1; @@ -346,7 +358,7 @@ foreach ($traps as $trap) { $data[8] .= ''; } if (give_acl ($config["id_user"], 0, "IM")) { - $data[8] .= ''; + $data[8] .= ''; } $data[9] = print_checkbox_extended ("snmptrapid[]", $trap["id_trap"], false, false, '', 'class="chk"', true); @@ -371,7 +383,7 @@ if (give_acl ($config["id_user"], 0, "IW")) { if (give_acl ($config['id_user'], 0, "IM")) { echo " "; - print_submit_button (__('Delete'), "deletebt", false, 'class="sub delete" onClick="javascript:confirm(\''.__('Are you sure?').'\')"'); + print_submit_button (__('Delete'), "deletebt", false, 'class="sub delete" onClick="javascript:return confirm(\''.__('Are you sure?').'\')"'); } echo "";