mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Merge branch 'resolve-conflict-events-reports' into 'develop'
fixed errors in reports evnts See merge request !106
This commit is contained in:
parent
8b5da6bc64
commit
6613ed6d52
@ -1136,17 +1136,12 @@ switch ($action) {
|
|||||||
$style['event_graph_by_criticity'] = $event_graph_by_criticity;
|
$style['event_graph_by_criticity'] = $event_graph_by_criticity;
|
||||||
$style['event_graph_validated_vs_unvalidated'] = $event_graph_validated_vs_unvalidated;
|
$style['event_graph_validated_vs_unvalidated'] = $event_graph_validated_vs_unvalidated;
|
||||||
|
|
||||||
switch ($values['type']) {
|
|
||||||
case 'event_report_group':
|
|
||||||
case 'event_report_agent':
|
|
||||||
$style['event_filter_search'] = $event_filter_search;
|
$style['event_filter_search'] = $event_filter_search;
|
||||||
if ($label != '')
|
if ($label != '')
|
||||||
$style['label'] = $label;
|
$style['label'] = $label;
|
||||||
else
|
else
|
||||||
$style['label'] = '';
|
$style['label'] = '';
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'simple_graph':
|
case 'simple_graph':
|
||||||
// Warning. We are using this column to hold this value to avoid
|
// Warning. We are using this column to hold this value to avoid
|
||||||
// the modification of the database for compatibility reasons.
|
// the modification of the database for compatibility reasons.
|
||||||
|
@ -1315,6 +1315,8 @@ function events_get_agent ($id_agent, $period, $date = 0,
|
|||||||
case -1:
|
case -1:
|
||||||
$status_all = 1;
|
$status_all = 1;
|
||||||
break;
|
break;
|
||||||
|
case 3:
|
||||||
|
$filter_event_status[$key] = ('0, 2');
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -2647,6 +2649,8 @@ function events_get_count_events_by_agent ($id_group, $period, $date,
|
|||||||
case -1:
|
case -1:
|
||||||
$status_all = 1;
|
$status_all = 1;
|
||||||
break;
|
break;
|
||||||
|
case 3:
|
||||||
|
$filter_event_status[$key] = ('0, 2');
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -2793,6 +2797,8 @@ function events_get_count_events_validated_by_user ($filter, $period, $date,
|
|||||||
case -1:
|
case -1:
|
||||||
$status_all = 1;
|
$status_all = 1;
|
||||||
break;
|
break;
|
||||||
|
case 3:
|
||||||
|
$filter_event_status[$key] = ('0, 2');
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -2936,6 +2942,8 @@ function events_get_count_events_by_criticity ($filter, $period, $date,
|
|||||||
case -1:
|
case -1:
|
||||||
$status_all = 1;
|
$status_all = 1;
|
||||||
break;
|
break;
|
||||||
|
case 3:
|
||||||
|
$filter_event_status[$key] = ('0, 2');
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -3092,6 +3100,8 @@ function events_get_count_events_validated ($filter, $period = null, $date = nul
|
|||||||
case -1:
|
case -1:
|
||||||
$status_all = 1;
|
$status_all = 1;
|
||||||
break;
|
break;
|
||||||
|
case 3:
|
||||||
|
$filter_event_status[$key] = ('0, 2');
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1413,7 +1413,7 @@ function reporting_event_report_group($report, $content,
|
|||||||
}
|
}
|
||||||
|
|
||||||
//total_events
|
//total_events
|
||||||
if(isset($return['data'])){
|
if($return['data'] != ''){
|
||||||
$return['total_events'] = count($return['data']);
|
$return['total_events'] = count($return['data']);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@ -1492,6 +1492,14 @@ function reporting_event_report_module($report, $content,
|
|||||||
metaconsole_restore_db();
|
metaconsole_restore_db();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//total_events
|
||||||
|
if($return['data'][0]['data'] != ''){
|
||||||
|
$return['total_events'] = count($return['data'][0]['data']);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$return['total_events'] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
return reporting_check_structure_content($return);
|
return reporting_check_structure_content($return);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2328,7 +2336,7 @@ function reporting_event_report_agent($report, $content,
|
|||||||
}
|
}
|
||||||
|
|
||||||
//total_events
|
//total_events
|
||||||
if(isset($return['data'])){
|
if($return['data'] != ''){
|
||||||
$return['total_events'] = count($return['data']);
|
$return['total_events'] = count($return['data']);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
@ -131,13 +131,9 @@ function reporting_html_print_report($report, $mini = false) {
|
|||||||
|
|
||||||
$table->data['description_row']['description'] = $item['description'];
|
$table->data['description_row']['description'] = $item['description'];
|
||||||
|
|
||||||
if($item['type']=='event_report_agent' || $item['type']=='event_report_group'){
|
if($item['type']=='event_report_agent' || $item['type']=='event_report_group' || $item['type']=='event_report_module'){
|
||||||
if($item['description'] != '' && $item['description'] != null){
|
|
||||||
|
|
||||||
$table->data['description_row']['description'] .= " - ";
|
$table->data['count_row']['count'] = "Total events: ".$item["total_events"];
|
||||||
|
|
||||||
}
|
|
||||||
$table->data['description_row']['description'] .= "Total events: ".$item["total_events"];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$table->colspan['description_row']['description'] = 3;
|
$table->colspan['description_row']['description'] = 3;
|
||||||
@ -749,11 +745,7 @@ function reporting_html_top_n($table, $item) {
|
|||||||
|
|
||||||
function reporting_html_event_report_group($table, $item, $pdf = 0) {
|
function reporting_html_event_report_group($table, $item, $pdf = 0) {
|
||||||
global $config;
|
global $config;
|
||||||
if (!empty($item['failed'])) {
|
if($item['total_events']){
|
||||||
$table->colspan['events']['cell'] = 3;
|
|
||||||
$table->data['events']['cell'] = $item['failed'];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$table1 = new stdClass();
|
$table1 = new stdClass();
|
||||||
$table1->width = '99%';
|
$table1->width = '99%';
|
||||||
|
|
||||||
@ -833,7 +825,6 @@ function reporting_html_event_report_group($table, $item, $pdf = 0) {
|
|||||||
io_safe_output($event['evento']),
|
io_safe_output($event['evento']),
|
||||||
140, false, true);
|
140, false, true);
|
||||||
|
|
||||||
//$data[1] = $event['event_type'];
|
|
||||||
$data[] = events_print_type_img ($event["event_type"], true);
|
$data[] = events_print_type_img ($event["event_type"], true);
|
||||||
|
|
||||||
if (!empty($event['id_agente']))
|
if (!empty($event['id_agente']))
|
||||||
@ -860,8 +851,14 @@ function reporting_html_event_report_group($table, $item, $pdf = 0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($pdf){
|
if($pdf){
|
||||||
|
$table0 = new stdClass();
|
||||||
|
$table0->width = '99%';
|
||||||
|
$table0->class = 'table-beauty';
|
||||||
|
$table0->data['count_row']['count'] = "Total events: ".$item["total_events"];
|
||||||
|
$pdf_export = html_print_table($table0, true);
|
||||||
|
|
||||||
$table1->class = 'table-beauty';
|
$table1->class = 'table-beauty';
|
||||||
$pdf_export = html_print_table($table1, true);
|
$pdf_export .= html_print_table($table1, true);
|
||||||
$pdf_export .= '<br>';
|
$pdf_export .= '<br>';
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@ -949,11 +946,23 @@ function reporting_html_event_report_group($table, $item, $pdf = 0) {
|
|||||||
return $pdf_export;
|
return $pdf_export;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
if($pdf){
|
||||||
|
$table0 = new stdClass();
|
||||||
|
$table0->width = '99%';
|
||||||
|
$table0->class = 'table-beauty';
|
||||||
|
$table0->data['count_row']['count'] = "Total events: ".$item["total_events"];
|
||||||
|
$pdf_export = html_print_table($table0, true);
|
||||||
|
|
||||||
|
return $pdf_export;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function reporting_html_event_report_module($table, $item, $pdf = 0) {
|
function reporting_html_event_report_module($table, $item, $pdf = 0) {
|
||||||
global $config;
|
global $config;
|
||||||
$show_summary_group = $item['show_summary_group'];
|
$show_summary_group = $item['show_summary_group'];
|
||||||
|
if($item['total_events']){
|
||||||
if (!empty($item['failed'])) {
|
if (!empty($item['failed'])) {
|
||||||
$table->colspan['events']['cell'] = 3;
|
$table->colspan['events']['cell'] = 3;
|
||||||
$table->data['events']['cell'] = $item['failed'];
|
$table->data['events']['cell'] = $item['failed'];
|
||||||
@ -964,24 +973,28 @@ function reporting_html_event_report_module($table, $item, $pdf = 0) {
|
|||||||
$table1->width = '99%';
|
$table1->width = '99%';
|
||||||
$table1->data = array ();
|
$table1->data = array ();
|
||||||
$table1->head = array ();
|
$table1->head = array ();
|
||||||
|
$table1->align = array();
|
||||||
|
$table1->align[2] = 'center';
|
||||||
if($show_summary_group){
|
if($show_summary_group){
|
||||||
$table1->head[0] = __('Status');
|
$table1->head[0] = __('Status');
|
||||||
$table1->head[1] = __('Event name');
|
$table1->head[1] = __('Event name');
|
||||||
$table1->head[2] = __('Event type');
|
$table1->head[2] = __('Type');
|
||||||
$table1->head[3] = __('Severity');
|
$table1->head[3] = __('Severity');
|
||||||
$table1->head[4] = __('Count');
|
$table1->head[4] = __('Count');
|
||||||
$table1->head[5] = __('Timestamp');
|
$table1->head[5] = __('Timestamp');
|
||||||
$table1->style[0] = 'text-align: center;';
|
$table1->style[0] = 'text-align: center;';
|
||||||
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$table1->head[0] = __('Status');
|
$table1->head[0] = __('Status');
|
||||||
$table1->head[1] = __('Event name');
|
$table1->head[1] = __('Event name');
|
||||||
$table1->head[2] = __('Event type');
|
$table1->head[2] = __('Type');
|
||||||
$table1->head[3] = __('Severity');
|
$table1->head[3] = __('Severity');
|
||||||
$table1->head[4] = __('Timestamp');
|
$table1->head[4] = __('Timestamp');
|
||||||
$table1->style[0] = 'text-align: center;';
|
$table1->style[0] = 'text-align: center;';
|
||||||
|
|
||||||
}
|
}
|
||||||
$table->data['tatal_events']['cell'] = "Total events: ".$item["total_events"];
|
|
||||||
if (is_array($item['data']) || is_object($item['data'])){
|
if (is_array($item['data']) || is_object($item['data'])){
|
||||||
$item_data = array_reverse($item['data']);
|
$item_data = array_reverse($item['data']);
|
||||||
}
|
}
|
||||||
@ -995,7 +1008,7 @@ function reporting_html_event_report_module($table, $item, $pdf = 0) {
|
|||||||
$table1->cellclass[$i][5] = get_priority_class($event["criticity"]);
|
$table1->cellclass[$i][5] = get_priority_class($event["criticity"]);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$table1->cellclass[$i][1] = $table1->cellclass[$i][2] =
|
$table1->cellclass[$i][1] =
|
||||||
$table1->cellclass[$i][3] =
|
$table1->cellclass[$i][3] =
|
||||||
$table1->cellclass[$i][4] = get_priority_class($event["criticity"]);
|
$table1->cellclass[$i][4] = get_priority_class($event["criticity"]);
|
||||||
}
|
}
|
||||||
@ -1021,7 +1034,7 @@ function reporting_html_event_report_module($table, $item, $pdf = 0) {
|
|||||||
"title" => $title_st,
|
"title" => $title_st,
|
||||||
"id" => 'status_img_' . $event["id_evento"]));
|
"id" => 'status_img_' . $event["id_evento"]));
|
||||||
$data[1] = io_safe_output($event['evento']);
|
$data[1] = io_safe_output($event['evento']);
|
||||||
$data[2] = $event['event_type'];
|
$data[2] = events_print_type_img ($event["event_type"], true);
|
||||||
$data[3] = get_priority_name ($event['criticity']);
|
$data[3] = get_priority_name ($event['criticity']);
|
||||||
if($show_summary_group){
|
if($show_summary_group){
|
||||||
$data[4] = $event['event_rep'];
|
$data[4] = $event['event_rep'];
|
||||||
@ -1034,8 +1047,14 @@ function reporting_html_event_report_module($table, $item, $pdf = 0) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($pdf){
|
if($pdf){
|
||||||
|
$table0 = new stdClass();
|
||||||
|
$table0->width = '99%';
|
||||||
|
$table0->class = 'table-beauty';
|
||||||
|
$table0->data['count_row']['count'] = "Total events: ".$item["total_events"];
|
||||||
|
$pdf_export = html_print_table($table0, true);
|
||||||
|
|
||||||
$table1->class = 'table-beauty';
|
$table1->class = 'table-beauty';
|
||||||
$pdf_export = html_print_table($table1, true);
|
$pdf_export .= html_print_table($table1, true);
|
||||||
$pdf_export .= '<br>';
|
$pdf_export .= '<br>';
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@ -1124,6 +1143,18 @@ function reporting_html_event_report_module($table, $item, $pdf = 0) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if($pdf){
|
||||||
|
$table0 = new stdClass();
|
||||||
|
$table0->width = '99%';
|
||||||
|
$table0->class = 'table-beauty';
|
||||||
|
$table0->data['count_row']['count'] = "Total events: ".$item["total_events"];
|
||||||
|
$pdf_export = html_print_table($table0, true);
|
||||||
|
|
||||||
|
return $pdf_export;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function reporting_html_inventory_changes($table, $item) {
|
function reporting_html_inventory_changes($table, $item) {
|
||||||
@ -1543,6 +1574,8 @@ function reporting_html_group_report($table, $item) {
|
|||||||
|
|
||||||
function reporting_html_event_report_agent($table, $item, $pdf = 0) {
|
function reporting_html_event_report_agent($table, $item, $pdf = 0) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
|
if($item['total_events'] != 0){
|
||||||
$table1 = new stdClass();
|
$table1 = new stdClass();
|
||||||
$table1->width = '99%';
|
$table1->width = '99%';
|
||||||
$table1->align = array();
|
$table1->align = array();
|
||||||
@ -1628,8 +1661,14 @@ function reporting_html_event_report_agent($table, $item, $pdf = 0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($pdf){
|
if($pdf){
|
||||||
|
$table0 = new stdClass();
|
||||||
|
$table0->width = '99%';
|
||||||
|
$table0->class = 'table-beauty';
|
||||||
|
$table0->data['count_row']['count'] = "Total events: ".$item["total_events"];
|
||||||
|
$pdf_export = html_print_table($table0, true);
|
||||||
|
|
||||||
$table1->class = 'table-beauty';
|
$table1->class = 'table-beauty';
|
||||||
$pdf_export = html_print_table($table1, true);
|
$pdf_export .= html_print_table($table1, true);
|
||||||
$pdf_export .= '<br>';
|
$pdf_export .= '<br>';
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@ -1698,6 +1737,18 @@ function reporting_html_event_report_agent($table, $item, $pdf = 0) {
|
|||||||
if($pdf){
|
if($pdf){
|
||||||
return $pdf_export;
|
return $pdf_export;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if($pdf){
|
||||||
|
$table0 = new stdClass();
|
||||||
|
$table0->width = '99%';
|
||||||
|
$table0->class = 'table-beauty';
|
||||||
|
$table0->data['count_row']['count'] = "Total events: ".$item["total_events"];
|
||||||
|
$pdf_export = html_print_table($table0, true);
|
||||||
|
|
||||||
|
return $pdf_export;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function reporting_html_historical_data($table, $item) {
|
function reporting_html_historical_data($table, $item) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user