mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
#8365 PDF report added for ncm backups
This commit is contained in:
parent
dda21b162d
commit
f5e7ac8d4a
@ -7389,32 +7389,34 @@ function reporting_html_ncm_config($table, $item, $pdf=0)
|
||||
/**
|
||||
* HTML content for ncm backup report.
|
||||
*
|
||||
* @param array $item Content generated by reporting_ncm_config.
|
||||
* @param array $item Content generated by reporting_ncm_backups.
|
||||
*
|
||||
* @return string HTML code.
|
||||
*/
|
||||
function reporting_html_ncm_backups($table, $item, $pdf=0)
|
||||
{
|
||||
ui_require_javascript_file('diff2html-ui.min');
|
||||
ui_require_css_file('diff2html.min');
|
||||
ui_require_css_file('highlight.min');
|
||||
ui_require_css_file('highlight/vs.min');
|
||||
ui_require_javascript_file('diff2html-ui.min');
|
||||
ui_require_javascript_file('highlight.min');
|
||||
ui_require_javascript_file('highlightjs-line-numbers.min');
|
||||
ui_require_javascript_file('languages/plaintext.min');
|
||||
ui_require_javascript_file('functions_ncm', ENTERPRISE_DIR.'/include/javascript/');
|
||||
|
||||
// Create table info.
|
||||
// Create table diff.
|
||||
$table_ncm = new stdClass();
|
||||
$table_ncm->width = '100%';
|
||||
$table_ncm->class = 'info_table';
|
||||
$table_ncm->styleTable = 'table-layout: fixed;';
|
||||
$table_ncm->rowstyle['title'] = 'text-align: center; font-weight: bolder';
|
||||
$table_ncm->headstyle[0] = 'width: 250px';
|
||||
$table_ncm->head = [];
|
||||
$table_ncm->head[0] = __('Date');
|
||||
$table_ncm->head[1] = __('Diff');
|
||||
|
||||
$table_ncm->data = [];
|
||||
|
||||
if ($pdf === 0) {
|
||||
foreach ($item['data'] as $key => $row) {
|
||||
$table_ncm->data[] = [
|
||||
$row['updated_at'],
|
||||
@ -7422,11 +7424,22 @@ function reporting_html_ncm_backups($table, $item, $pdf=0)
|
||||
];
|
||||
}
|
||||
|
||||
if ($pdf === 0) {
|
||||
return $table->data[] = html_print_table(
|
||||
$table_ncm,
|
||||
true
|
||||
);
|
||||
} else {
|
||||
foreach ($item['data'] as $key => $row) {
|
||||
$table_ncm->data[] = [
|
||||
$row['updated_at'],
|
||||
($row['diffstr'] === '') ? $row['diff'] : str_replace("\n", '<br>', $row['diffstr']),
|
||||
];
|
||||
}
|
||||
|
||||
return html_print_table(
|
||||
$table_ncm,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user