Merge branch '2776-Metaconsola_informes_event_report_module_fallan_porque_no_coje_bien_el_nombre_del_agente' into 'develop'

fixed error in metaconsole reports module events

See merge request artica/pandorafms!1776
This commit is contained in:
vgilc 2018-09-18 10:50:50 +02:00
commit 2f3be02884
1 changed files with 24 additions and 19 deletions

View File

@ -1552,7 +1552,7 @@ function reporting_event_report_group($report, $content,
function reporting_event_report_module($report, $content, function reporting_event_report_module($report, $content,
$type = 'dinamic', $force_width_chart = null, $type = 'dinamic', $force_width_chart = null,
$force_height_chart = null, $pdf=0) { $force_height_chart = null, $pdf=0) {
global $config; global $config;
if($pdf){ if($pdf){
@ -1563,20 +1563,29 @@ function reporting_event_report_module($report, $content,
} }
$return['type'] = 'event_report_module'; $return['type'] = 'event_report_module';
if (empty($content['name'])) { if (empty($content['name'])) {
$content['name'] = __('Event Report Module'); $content['name'] = __('Event Report Module');
} }
$id_server = false;
if(is_metaconsole()){
$id_server = metaconsole_get_id_server($content["server_name"]);
metaconsole_connect(null, $id_server);
}
$return['title'] = $content['name']; $return['title'] = $content['name'];
$return['subtitle'] = agents_get_alias($content['id_agent']) . $return['subtitle'] = agents_get_alias($content['id_agent']) . " - " .
" - " . io_safe_output(modules_get_agentmodule_name($content['id_agent_module']));
io_safe_output(
modules_get_agentmodule_name($content['id_agent_module'])); if(is_metaconsole()){
metaconsole_restore_db();
}
$return["description"] = $content["description"]; $return["description"] = $content["description"];
$return["date"] = reporting_get_date_text($report, $content); $return["date"] = reporting_get_date_text($report, $content);
$return['label'] = (isset($content['style']['label'])) ? $content['style']['label'] : ''; $return['label'] = (isset($content['style']['label'])) ? $content['style']['label'] : '';
$event_filter = $content['style']; $event_filter = $content['style'];
$return['show_summary_group'] = $event_filter['show_summary_group']; $return['show_summary_group'] = $event_filter['show_summary_group'];
//filter //filter
@ -1585,22 +1594,18 @@ function reporting_event_report_module($report, $content,
$filter_event_type = json_decode($event_filter['filter_event_type'],true); $filter_event_type = json_decode($event_filter['filter_event_type'],true);
$filter_event_status = json_decode($event_filter['filter_event_status'],true); $filter_event_status = json_decode($event_filter['filter_event_status'],true);
$filter_event_filter_search = $event_filter['event_filter_search']; $filter_event_filter_search = $event_filter['event_filter_search'];
//graphs //graphs
$event_graph_by_user_validator = $event_filter['event_graph_by_user_validator']; $event_graph_by_user_validator = $event_filter['event_graph_by_user_validator'];
$event_graph_by_criticity = $event_filter['event_graph_by_criticity']; $event_graph_by_criticity = $event_filter['event_graph_by_criticity'];
$event_graph_validated_vs_unvalidated = $event_filter['event_graph_validated_vs_unvalidated']; $event_graph_validated_vs_unvalidated = $event_filter['event_graph_validated_vs_unvalidated'];
$id_server = false;
if(is_metaconsole()){
$id_server = metaconsole_get_id_server($content["server_name"]);
}
//data events //data events
$data = reporting_get_module_detailed_event ( $data = reporting_get_module_detailed_event (
$content['id_agent_module'], $content['period'], $report["datetime"], $content['id_agent_module'], $content['period'], $report["datetime"],
$show_summary_group, $filter_event_severity, $filter_event_type, $show_summary_group, $filter_event_severity, $filter_event_type,
$filter_event_status, $filter_event_filter_search, $force_width_chart, $filter_event_status, $filter_event_filter_search, $force_width_chart,
$event_graph_by_user_validator, $event_graph_by_criticity, $event_graph_by_user_validator, $event_graph_by_criticity,
$event_graph_validated_vs_unvalidated, $ttl, $id_server); $event_graph_validated_vs_unvalidated, $ttl, $id_server);
if (empty($data)) { if (empty($data)) {
@ -1608,7 +1613,7 @@ function reporting_event_report_module($report, $content,
} }
else { else {
$return['data'] = array_reverse($data); $return['data'] = array_reverse($data);
} }
if ($config['metaconsole']) { if ($config['metaconsole']) {
metaconsole_restore_db(); metaconsole_restore_db();
@ -1621,7 +1626,7 @@ function reporting_event_report_module($report, $content,
else{ else{
$return['total_events'] = 0; $return['total_events'] = 0;
} }
return reporting_check_structure_content($return); return reporting_check_structure_content($return);
} }