Fixed problem with Event report agent, when is metaconsole. Tiquet: #3045

This commit is contained in:
m-lopez-f 2015-12-09 12:44:03 +01:00
parent 62aa7d5729
commit 59e0387069
2 changed files with 12 additions and 13 deletions

View File

@ -1328,17 +1328,23 @@ function events_get_agent ($id_agent, $period, $date = 0,
$sql_where .= ' AND criticity IN (' . implode(', ', $criticities) . ')'; $sql_where .= ' AND criticity IN (' . implode(', ', $criticities) . ')';
} }
if ( $filter_event_validated && $filter_event_no_validated ) {
$sql_where .= " AND (estado = 1 OR estado = 0)";
}
else {
if ($filter_event_validated) { if ($filter_event_validated) {
$sql_where .= ' AND estado = 1 '; $sql_where .= ' AND estado = 1 ';
} } else {
if ($filter_event_no_validated) { if ($filter_event_no_validated) {
$sql_where .= ' AND estado = 0 '; $sql_where .= ' AND estado = 0 ';
} }
}
}
$sql_where .= sprintf(' AND id_agente = %d AND utimestamp > %d $sql_where .= sprintf(' AND id_agente = %d AND utimestamp > %d
AND utimestamp <= %d ', $id_agent, $datelimit, $date); AND utimestamp <= %d ', $id_agent, $datelimit, $date);
return events_get_events_grouped($sql_where, 0, 1000); return events_get_events_grouped($sql_where, 0, 1000, is_metaconsole());
} }
/** /**

View File

@ -2034,13 +2034,6 @@ function reporting_event_report_agent($report, $content,
$content['name'] = __('Event Report Agent'); $content['name'] = __('Event Report Agent');
} }
if ($config['metaconsole']) {
$id_meta = metaconsole_get_id_server($content["server_name"]);
$server = metaconsole_get_connection_by_id ($id_meta);
metaconsole_connect($server);
}
$return['title'] = $content['name']; $return['title'] = $content['name'];
$return['subtitle'] = agents_get_name($content['id_agent']); $return['subtitle'] = agents_get_name($content['id_agent']);