#10727 PDF correction agent event module

This commit is contained in:
Jonathan 2023-04-04 14:27:47 +02:00
parent 89aa227b98
commit 2d3c3b70e6
2 changed files with 44 additions and 28 deletions

View File

@ -2523,8 +2523,8 @@ function events_print_event_table(
$i = 0;
$table->head[$i] = '<span>'.__('Type').'</span>';
$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] = '<span>'.__('Event name').'</span>';
$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] = '<span>'.__('Status').'</span>';
$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] = "<span title='".__('Validated')."'>".__('V.').'</span>';
$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');

View File

@ -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.'<br>';
if (is_array($value)) {
$custom_data_text .= $key.' = ';
foreach ($value as $action) {
$custom_data_text .= $action.', ';
}
$custom_data_text = rtrim($custom_data_text, ', ').'<br>';
} else {
$custom_data_text .= $key.' = '.$value.'<br>';
}
}
$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[] = '<font class="font_6pt">'.date($config['date_format'], strtotime($event['timestamp'])).'</font>';
$data[] = '<font class="font_6pt">'.date($config['date_format'], $event['timestamp']).'</font>';
} else {
$data[] = '<font class="font_6pt">'.date($config['date_format'], strtotime($event['timestamp'])).'</font>';
$data[] = '<font class="font_6pt">'.date($config['date_format'], $event['timestamp']).'</font>';
}
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.'<br>';
if (is_array($value)) {
$custom_data_text .= $key.' = ';
foreach ($value as $action) {
$custom_data_text .= $action.', ';
}
$custom_data_text = rtrim($custom_data_text, ', ').'<br>';
} else {
$custom_data_text .= $key.' = '.$value.'<br>';
}
}
$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] .= '<br />';
$table1->data[$k_chart][0] .= $chart['module'];