2010-06-30 Sergio Martin <sergio.martin@artica.es>

* operation/events/events.php: Fixed the agent filter. Now the
	pagination keep the agent and shows the name of the agent in the 



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2940 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2010-06-30 16:49:07 +00:00
parent cd7c09796e
commit 2ff45e4dc8
2 changed files with 39 additions and 19 deletions

View File

@ -1,3 +1,9 @@
2010-06-30 Sergio Martin <sergio.martin@artica.es>
* operation/events/events.php: Fixed the agent filter. Now the
pagination keep the agent and shows the name of the agent in the
input. Bugfix: 3021807
2010-06-30 Sergio Martin <sergio.martin@artica.es> 2010-06-30 Sergio Martin <sergio.martin@artica.es>
* godmode/reporting/visual_console_builder.editor.js: Fixed * godmode/reporting/visual_console_builder.editor.js: Fixed

View File

@ -95,28 +95,42 @@ if ($config['flash_charts']) {
} }
$offset = (int) get_parameter ("offset", 0); $offset = (int) get_parameter ("offset", 0);
$ev_group = (int) get_parameter ("ev_group", 1); //1 = all $ev_group = (int) get_parameter ("ev_group", 0); //0 = all
$search = preg_replace ("/&([A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/", "%", rawurldecode (get_parameter ("search"))); $search = preg_replace ("/&([A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/", "%", rawurldecode (get_parameter ("search")));
$event_type = get_parameter ("event_type", ''); // 0 all $event_type = get_parameter ("event_type", ''); // 0 all
$severity = (int) get_parameter ("severity", -1); // -1 all $severity = (int) get_parameter ("severity", -1); // -1 all
$status = (int) get_parameter ("status", 0); // -1 all, 0 only red, 1 only green $status = (int) get_parameter ("status", 0); // -1 all, 0 only red, 1 only green
//$id_agent = (int) get_parameter ("id_agent", ""); //-1 all, 0 system $id_agent = (int) get_parameter ("id_agent", -2); //-1 all, 0 system
$text_agent = (string) get_parameter("id_agent", "All");
switch ($text_agent) if($id_agent == -2) {
{ $text_agent = (string) get_parameter("text_agent", "All");
case '-1':
$id_agent = -1; switch ($text_agent)
break; {
case 'All': case All:
$id_agent = -1; $id_agent = -1;
break; break;
case 'Server': case Server:
$id_agent = 0; $id_agent = 0;
break; break;
default: default:
$id_agent = get_agent_id($text_agent); $id_agent = get_agent_id($text_agent);
break; break;
}
}
else{
switch ($id_agent)
{
case -1:
$text_agent = 'All';
break;
case 0:
$text_agent = 'Server';
break;
default:
$text_agent = get_agent_name($id_agent);
break;
}
} }
$id_event = (int) get_parameter ("id_event", -1); $id_event = (int) get_parameter ("id_event", -1);
@ -132,7 +146,7 @@ $delete = (bool) get_parameter ("delete");
$validate = (bool) get_parameter ("validate"); $validate = (bool) get_parameter ("validate");
//Group selection //Group selection
if ($ev_group > 1 && in_array ($ev_group, array_keys ($groups))) { if ($ev_group > 0 && in_array ($ev_group, array_keys ($groups))) {
//If a group is selected and it's in the groups allowed //If a group is selected and it's in the groups allowed
$sql_post = " AND id_grupo = $ev_group"; $sql_post = " AND id_grupo = $ev_group";
} else { } else {
@ -281,7 +295,7 @@ echo '</td>';
//Agent search //Agent search
echo "<td>".__('Agent search')."</td><td>"; echo "<td>".__('Agent search')."</td><td>";
print_input_text_extended ('id_agent', $text_agent, 'text_id_agent', '', 30, 100, false, '', print_input_text_extended ('text_agent', $text_agent, 'text_id_agent', '', 30, 100, false, '',
array('style' => 'background: url(images/lightning.png) no-repeat right;')) array('style' => 'background: url(images/lightning.png) no-repeat right;'))
. '<a href="#" class="tip">&nbsp;<span>' . __("Type at least two characters to search") . '</span></a>'; . '<a href="#" class="tip">&nbsp;<span>' . __("Type at least two characters to search") . '</span></a>';