From 2d3c3b70e624515eb5d7988ec432596ee304b3bc Mon Sep 17 00:00:00 2001 From: Jonathan Date: Tue, 4 Apr 2023 14:27:47 +0200 Subject: [PATCH] #10727 PDF correction agent event module --- pandora_console/include/functions_events.php | 18 +++---- .../include/functions_reporting_html.php | 54 ++++++++++++------- 2 files changed, 44 insertions(+), 28 deletions(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 9616634adb..aab4467695 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -2523,8 +2523,8 @@ function events_print_event_table( $i = 0; $table->head[$i] = ''.__('Type').''; - $table->headstyle[$i] = 'width: 3%;text-align: center;'; - $table->style[$i++] = 'text-align: center;'; + $table->headstyle[$i] = 'width: 3%;text-align: left;'; + $table->style[$i++] = 'text-align: left;'; $table->head[$i] = ''.__('Event name').''; $table->headstyle[$i] = ''; @@ -2541,12 +2541,12 @@ function events_print_event_table( $table->style[$i++] = 'padding: 0 5px;word-break: break-word;'; $table->head[$i] = ''.__('Status').''; - $table->headstyle[$i] = 'width: 150px;text-align: center;'; - $table->style[$i++] = 'padding: 0 5px;text-align: center;'; + $table->headstyle[$i] = 'width: 150px;text-align: left;'; + $table->style[$i++] = 'padding: 0 5px;text-align: left;'; $table->head[$i] = "".__('V.').''; - $table->headstyle[$i] = 'width: 1%;text-align: center;'; - $table->style[$i++] = 'text-align: center;'; + $table->headstyle[$i] = 'width: 1%;text-align: left;'; + $table->style[$i++] = 'text-align: left;'; $all_groups = []; if ($agent_id != 0) { @@ -2730,7 +2730,7 @@ function events_print_type_img( [ 'title' => events_print_type_description($type, true), 'class' => $style, - 'style' => 'margin: 0 auto;'.((empty($icon) === false) ? 'background-image: url('.$icon.'); background-repeat: no-repeat;' : ''), + 'style' => ((empty($icon) === false) ? 'background-image: url('.$icon.'); background-repeat: no-repeat;' : ''), ], true ); @@ -5122,7 +5122,7 @@ function events_page_general($event) && count($table_data[$i]) === 2 ) { $table_general->colspan[$i][1] = 2; - $table_general->style[2] = 'text-align:center; width:10%;'; + $table_general->style[2] = 'text-align:left; width:10%;'; } } @@ -5204,7 +5204,7 @@ function events_page_comments($event, $ajax=false, $groupedComments=[]) $comments = (empty($groupedComments) === true) ? $event['user_comment'] : $groupedComments; if (empty($comments) === true) { - $table_comments->style[0] = 'text-align:center;'; + $table_comments->style[0] = 'text-align:left;'; $table_comments->colspan[0][0] = 2; $data = []; $data[0] = __('There are no comments'); diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index 8b5cb3d917..807dee3ca3 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -1041,11 +1041,11 @@ function reporting_html_event_report_group($table, $item, $pdf=0) $table1->class = 'info_table'; $table1->align = []; - $table1->align[0] = 'center'; + $table1->align[0] = 'left'; if ($item['show_summary_group']) { - $table1->align[3] = 'center'; + $table1->align[3] = 'left'; } else { - $table1->align[2] = 'center'; + $table1->align[2] = 'left'; } $table1->data = []; @@ -1299,7 +1299,7 @@ function reporting_html_event_report_module($table, $item, $pdf=0) $table1->class = 'info_table'; $table1->data = []; $table1->head = []; - $table1->align = 'left'; + $table1->align[0] = 'left'; if ($show_summary_group) { $table1->head[0] = __('Status'); @@ -1378,7 +1378,16 @@ function reporting_html_event_report_module($table, $item, $pdf=0) $custom_data = json_decode($event['custom_data'], true); $custom_data_text = ''; foreach ($custom_data as $key => $value) { - $custom_data_text .= $key.' = '.$value.'
'; + if (is_array($value)) { + $custom_data_text .= $key.' = '; + foreach ($value as $action) { + $custom_data_text .= $action.', '; + } + + $custom_data_text = rtrim($custom_data_text, ', ').'
'; + } else { + $custom_data_text .= $key.' = '.$value.'
'; + } } $data[6] = $custom_data_text; @@ -2620,16 +2629,14 @@ function reporting_html_event_report_agent($table, $item, $pdf=0) $table1->width = '99%'; $table1->class = 'info_table'; $table1->align = []; - $table1->align[0] = 'center'; - $table1->align[1] = 'center'; - $table1->align[3] = 'center'; - if ((bool) $item['show_custom_data'] === true) { - if ($item['show_summary_group']) { - $table1->align[7] = 'left'; - } else { - $table1->align[6] = 'left'; - } - } + $table1->align[0] = 'left'; + $table1->align[1] = 'left'; + $table1->align[2] = 'left'; + $table1->align[3] = 'left'; + $table1->align[4] = 'left'; + $table1->align[5] = 'left'; + $table1->align[6] = 'left'; + $table1->align[7] = 'left'; $table1->data = []; @@ -2705,16 +2712,25 @@ function reporting_html_event_report_agent($table, $item, $pdf=0) } if ($item['show_summary_group']) { - $data[] = ''.date($config['date_format'], strtotime($event['timestamp'])).''; + $data[] = ''.date($config['date_format'], $event['timestamp']).''; } else { - $data[] = ''.date($config['date_format'], strtotime($event['timestamp'])).''; + $data[] = ''.date($config['date_format'], $event['timestamp']).''; } if ((bool) $item['show_custom_data'] === true) { $custom_data = json_decode($event['custom_data'], true); $custom_data_text = ''; foreach ($custom_data as $key => $value) { - $custom_data_text .= $key.' = '.$value.'
'; + if (is_array($value)) { + $custom_data_text .= $key.' = '; + foreach ($value as $action) { + $custom_data_text .= $action.', '; + } + + $custom_data_text = rtrim($custom_data_text, ', ').'
'; + } else { + $custom_data_text .= $key.' = '.$value.'
'; + } } $data[] = $custom_data_text; @@ -4721,7 +4737,7 @@ function reporting_html_availability_graph($table, $item, $pdf=0) $table1->style[0] = 'overflow-wrap: break-word'; // Align percentage and checks resume. - $table1->align[2] = 'center'; + $table1->align[2] = 'left'; $table1->data[$k_chart][0] = $chart['agent']; $table1->data[$k_chart][0] .= '
'; $table1->data[$k_chart][0] .= $chart['module'];