2012-11-05 Miguel de Dios <miguel.dedios@artica.es>
* 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. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7131 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
e5bb1f6962
commit
76d09bfcaf
|
@ -1,3 +1,11 @@
|
|||
2012-11-05 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* 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 <miguel.dedios@artica.es>
|
||||
|
||||
* include/functions_ui.php: improved the function
|
||||
|
|
|
@ -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"]);
|
||||
|
|
|
@ -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] = '<span title="'.$event["evento"].'" class="f9">';
|
||||
$data[$i] = '<a href="javascript:" onclick="show_event_dialog(' . $event["id_evento"] . ', '.$group_rep.');">';
|
||||
$data[$i] .= '<a href="javascript:" onclick="show_event_dialog(' . $event["id_evento"] . ', '.$group_rep.');">';
|
||||
$data[$i] .= '<span class="'.$myclass.'" style="font-size: 7.5pt;">' . ui_print_truncate_text (io_safe_output($event["evento"]), 160) . '</span>';
|
||||
$data[$i] .= '</a></span>';
|
||||
$i++;
|
||||
|
@ -1178,5 +1183,6 @@ $(document).ready( function() {
|
|||
}
|
||||
});
|
||||
});
|
||||
|
||||
/* ]]> */
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue