diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 5aa14a24f4..3e741990b6 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,11 @@ +2012-11-05 Miguel de Dios + + * operation/events/events_list.php: fixed the lost tag span (with + styles) in the Event description. + + * operation/events/events.php: fixed the default value for id_agent + set 0 (as All) in the filter of events. + 2012-11-05 Miguel de Dios * include/functions_ui.php: improved the function diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index cdd3d69ed7..a5c71e2cb3 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -166,7 +166,7 @@ $ev_group = (int) get_parameter ("ev_group", 0); //0 = all $event_type = get_parameter ("event_type", ''); // 0 all $severity = (int) get_parameter ("severity", -1); // -1 all $status = (int) get_parameter ("status", 3); // -1 all, 0 only new, 1 only validated, 2 only in process, 3 only not validated, -$id_agent = (int) get_parameter ("id_agent", -2); //-2 search by text, -1 all, 0 system +$id_agent = (int) get_parameter ("id_agent", 0); $id_event = (int) get_parameter ("id_event", -1); $pagination = (int) get_parameter ("pagination", $config["block_size"]); $event_view_hr = (int) get_parameter ("event_view_hr", $config["event_view_hr"]); diff --git a/pandora_console/operation/events/events_list.php b/pandora_console/operation/events/events_list.php index b56084f95d..21f30c9465 100644 --- a/pandora_console/operation/events/events_list.php +++ b/pandora_console/operation/events/events_list.php @@ -183,7 +183,7 @@ if ($event_type != "") { $sql_post .= " AND event_type LIKE '%warning%' OR event_type LIKE '%critical%' OR event_type LIKE '%unknown%' "; } else { - $sql_post .= " AND event_type = '".$event_type."'"; + $sql_post .= " AND event_type = '" . $event_type."'"; } } @@ -198,20 +198,20 @@ switch ($id_agent) { $sql_post .= " AND 1 = 0"; break; default: - $sql_post .= " AND id_agente = ".$id_agent; + $sql_post .= " AND id_agente = " . $id_agent; break; } if ($id_event != -1) - $sql_post .= " AND id_evento = ".$id_event; + $sql_post .= " AND id_evento = " . $id_event; if ($id_user_ack != "0") - $sql_post .= " AND id_usuario = '".$id_user_ack."'"; + $sql_post .= " AND id_usuario = '" . $id_user_ack . "'"; if ($event_view_hr > 0) { $unixtime = get_system_time () - ($event_view_hr * SECONDS_1HOUR); - $sql_post .= " AND (utimestamp > ".$unixtime . ")"; + $sql_post .= " AND (utimestamp > " . $unixtime . ")"; } //Search by tag @@ -220,7 +220,7 @@ if ($tag != "") { } // Filter/Only alerts -if (isset($filter_only_alert)){ +if (isset($filter_only_alert)) { if ($filter_only_alert == 0) $sql_post .= " AND event_type NOT LIKE '%alert%'"; else if ($filter_only_alert == 1) @@ -463,16 +463,21 @@ else { // Delete rnum field generated by oracle_recode_query() function if (($config['dbtype'] == 'oracle') && ($result !== false)) { for ($i=0; $i < count($result); $i++) { - unset($result[$i]['rnum']); + unset($result[$i]['rnum']); } } if ($group_rep == 0) { - $sql = "SELECT COUNT(id_evento) FROM tevento WHERE 1=1 ".$sql_post; + $sql = "SELECT COUNT(id_evento) + FROM tevento + WHERE 1=1 " . $sql_post; } else { - $sql = "SELECT COUNT(1) FROM (SELECT 1 FROM tevento - WHERE 1=1 $sql_post GROUP BY evento, id_agentmodule) AS t"; + $sql = "SELECT COUNT(1) + FROM (SELECT 1 + FROM tevento + WHERE 1=1 " . $sql_post . " + GROUP BY evento, id_agentmodule) AS t"; } @@ -690,7 +695,7 @@ foreach ($result as $event) { if (in_array('evento', $show_fields)) { // Event description $data[$i] = ''; - $data[$i] = ''; + $data[$i] .= ''; $data[$i] .= '' . ui_print_truncate_text (io_safe_output($event["evento"]), 160) . ''; $data[$i] .= ''; $i++; @@ -1178,5 +1183,6 @@ $(document).ready( function() { } }); }); + /* ]]> */