QA: Tweak a few Reports visual settings

This commit is contained in:
TheWitness committed 2025-01-05 14:49:05 -05:00
1 parent b98323c966
commit 4a01ef7f05
7 files changed
+70 -23

No files matched your search

+4
View File
@@ -22,6 +22,10 @@ table {
width: 100%;
}
h3 {
margin: 3px;
}
.report_table {
background-color: #F9F9F9;
text-align: center;
+4
View File
@@ -12,6 +12,10 @@ body {
color: snow;
}
h3 {
margin: 3px;
}
table {
border-collapse: collapse;
border-spacing: 0;
+4
View File
@@ -61,6 +61,10 @@ h2 {
font-size: 14pt;
}
h3 {
margin: 3px;
}
.header_row {
color: snow;
background: linear-gradient(to bottom, rgba(138,179,105,1) 0%, rgba(63,117,15,1) 100%);
+4
View File
@@ -16,6 +16,10 @@ table {
width: 100%;
}
h3 {
margin: 3px;
}
.report_table {
background-color:#F9F9F9;
text-align: center;
+1
View File
@@ -34,6 +34,7 @@ function prune_deprecated_files() {
'lib/graph_export.php',
'lib/adodb',
'include/zoom.js',
'formats/lotus_notes.format',
'include/main.css',
'include/jscalendar',
'include/html',
+9 -3
View File
@@ -1602,8 +1602,13 @@ function reports_edit() {
process_sanitize_draw_preview_filter(true, $header_label);
if (get_request_var('rdate') == '-1') {
if (get_request_var('style') == 'false') {
$theme = get_selected_theme();
} else {
$theme = '';
}
print '<tr><td>';
print reports_generate_html($report['id'], REPORTS_OUTPUT_STDOUT);
print reports_generate_html($report['id'], REPORTS_OUTPUT_STDOUT, $theme);
print '</td></tr>';
} else {
print '<tr><td>';
@@ -1849,7 +1854,8 @@ function create_preview_filter() {
$sql_params[] = 'reports';
if (get_nfilter_request_var('filter') != '') {
$sql_where = ' AND name LIKE ?';
$sql_where = ' AND (name LIKE ? OR send_time LIKE ?)';
$sql_params[] = '%' . get_nfilter_request_var('filter') . '%';
$sql_params[] = '%' . get_nfilter_request_var('filter') . '%';
}
@@ -1859,7 +1865,7 @@ function create_preview_filter() {
AND source = ?
$sql_where
ORDER BY send_time DESC",
array($id, 'reports'));
$sql_params);
$dreports = array_rekey($reports, 'id', 'name');
$dreports = $live + $dreports;
+44 -20
View File
@@ -432,7 +432,12 @@ function generate_report($schedule_id, $report, $force = false) {
return false;
}
$theme = 'modern';
if (!isset_request_var('style') || get_request_var('style') == 'true') {
$theme = 'modern';
} else {
$theme = get_selected_theme();
}
$body = reports_generate_html($report['id'], REPORTS_OUTPUT_EMAIL, $theme);
$start_time = time();
@@ -814,7 +819,7 @@ function reports_generate_history_html($history_id, $output = REPORTS_OUTPUT_STD
foreach($graph_data as $index => $graph) {
$report = str_replace('<GRAPH:' . $graph['local_graph_id'] . ':' . $graph['timespan'] . '>',
'<img class="graphimage" src="data:image/png;base64,' . $graph['attachment'] . '">', $report);
'<img class="graph" src="data:image/png;base64,' . $graph['attachment'] . '">', $report);
}
print $report;
@@ -874,18 +879,24 @@ function reports_generate_html($reports_id, $output = REPORTS_OUTPUT_STDOUT, &$t
$first_weekdayid = read_user_setting('first_weekdayid');
/* process the format file as applicable */
if ($report['cformat'] == 'on') {
$format_ok = reports_load_format_file($report['format_file'], $format_data, $report_tag, $theme);
if (!isset_request_var('style') || get_request_var('style') == 'true') {
if ($report['cformat'] == 'on') {
$format_ok = reports_load_format_file($report['format_file'], $format_data, $report_tag, $theme);
}
if ($output == REPORTS_OUTPUT_STDOUT) {
$format_data = str_replace('<html>', '', $format_data);
$format_data = str_replace('</html>', '', $format_data);
$format_data = str_replace('<body>', '', $format_data);
$format_data = str_replace('</body>', '', $format_data);
$format_data = preg_replace('#(<head>).*?(</head>)#si', '', $format_data);
$format_data = str_replace('<head>', '', $format_data);
$format_data = str_replace('</head>', '', $format_data);
}
}
if ($output == REPORTS_OUTPUT_STDOUT) {
$format_data = str_replace('<html>', '', $format_data);
$format_data = str_replace('</html>', '', $format_data);
$format_data = str_replace('<body>', '', $format_data);
$format_data = str_replace('</body>', '', $format_data);
$format_data = preg_replace('#(<head>).*?(</head>)#si', '', $format_data);
$format_data = str_replace('<head>', '', $format_data);
$format_data = str_replace('</head>', '', $format_data);
if (get_request_var('style') == 'false') {
$format_ok = true;
}
if ($format_ok && $report_tag) {
@@ -915,7 +926,7 @@ function reports_generate_html($reports_id, $output = REPORTS_OUTPUT_STDOUT, &$t
$outstr .= "\t\t\t<td class='title' style='text-align:" . $alignment[$report['alignment']] . ';font-size:' . $report['font_size'] . "pt;'>" . PHP_EOL;
}
$outstr .= "\t\t\t\t" . html_escape($report['name']) . PHP_EOL;
$outstr .= "\t\t\t\t<h3>" . html_escape($report['name']) . '</h3>' . PHP_EOL;
$outstr .= "\t\t\t</td>" . PHP_EOL;
$outstr .= "\t\t</tr>" . PHP_EOL;
# this function should be called only at the appropriate targeted time when in batch mode
@@ -1016,6 +1027,19 @@ function reports_generate_html($reports_id, $output = REPORTS_OUTPUT_STDOUT, &$t
}
}
if (get_request_var('style') == 'false') {
$outstr = str_replace('report_table', 'cactiTable', $outstr);
$outstr = str_replace('title_row', 'cactiTableTitleRow', $outstr);
$outstr = str_replace('text_row', 'cactiTableTitleRow', $outstr);
$outstr = str_replace('text', 'center', $outstr);
$outstr = str_replace('title', 'center', $outstr);
$outstr = str_replace('image_table', 'cactiTable', $outstr);
$outstr = str_replace('image_row', 'tableRow', $outstr);
$outstr = str_replace('image_column\'', 'image_column\' style=\'text-align:center;\'', $outstr);
$outstr = str_replace('image_column"', 'image_column" style="text-align:center;"', $outstr);
$outstr = str_replace('<table>', '<table class="cactiTable">', $outstr);
}
if ($format_ok) {
if ($report_tag) {
return str_replace('<REPORT>', $outstr, $format_data);
@@ -1233,7 +1257,7 @@ function reports_expand_device(&$report, $item, $device_id, $output, $format_ok,
$outstr .= "\t\t\t<td class='text' style='text-align:" . $alignment[$item['align']] . ';font-size: ' . $item['font_size'] . "pt;'>" . PHP_EOL;
}
$outstr .= "\t\t\t\t$title" . PHP_EOL;
$outstr .= "\t\t\t\t<h3>$title</h3>" . PHP_EOL;
$outstr .= "\t\t\t</td>" . PHP_EOL;
$outstr .= "\t\t</tr>" . PHP_EOL;
}
@@ -1422,7 +1446,7 @@ function reports_expand_tree(&$report, $item, $parent, $output, $format_ok, $the
} else {
$outstr .= "\t\t\t<td class='text' style='text-align:" . $alignment[$item['align']] . ';font-size: ' . $item['font_size'] . "pt;'>" . PHP_EOL;
}
$outstr .= "\t\t\t\t$title" . PHP_EOL;
$outstr .= "\t\t\t\t<h3>$title</h3>" . PHP_EOL;
$outstr .= "\t\t\t</td>" . PHP_EOL;
$outstr .= "\t\t</tr>" . PHP_EOL;
}
@@ -1466,7 +1490,7 @@ function reports_expand_tree(&$report, $item, $parent, $output, $format_ok, $the
} else {
$outstr .= "\t\t\t<td class='text' style='text-align:" . $alignment[$item['align']] . ';font-size: ' . $item['font_size'] . "pt;'>" . PHP_EOL;
}
$outstr .= "\t\t\t\t$title" . PHP_EOL;
$outstr .= "\t\t\t\t<h3>$title</h3>" . PHP_EOL;
$outstr .= "\t\t\t</td>" . PHP_EOL;
$outstr .= "\t\t</tr>" . PHP_EOL;
}
@@ -1547,7 +1571,7 @@ function reports_expand_tree(&$report, $item, $parent, $output, $format_ok, $the
$outstr .= "\t\t\t<td class='text' style='text-align:" . $alignment[$item['align']] . ';font-size: ' . $item['font_size'] . "pt;'>" . PHP_EOL;
}
$outstr .= "\t\t\t\t$title" . PHP_EOL;
$outstr .= "\t\t\t\t<h3>$title</h3>" . PHP_EOL;
$outstr .= "\t\t\t</td>" . PHP_EOL;
$outstr .= "\t\t</tr>" . PHP_EOL;
}
@@ -1614,7 +1638,7 @@ function reports_expand_tree(&$report, $item, $parent, $output, $format_ok, $the
} else {
$outstr .= "\t\t\t<td class='text' style='text-align:" . $alignment[$item['align']] . ';font-size: ' . $item['font_size'] . "pt;'>" . PHP_EOL;
}
$outstr .= "\t\t\t\t$title" . PHP_EOL;
$outstr .= "\t\t\t\t<h3>$title</h3>" . PHP_EOL;
$outstr .= "\t\t\t</td>" . PHP_EOL;
$outstr .= "\t\t</tr>" . PHP_EOL;
}
@@ -1688,7 +1712,7 @@ function reports_expand_tree(&$report, $item, $parent, $output, $format_ok, $the
} else {
$outstr .= "\t\t\t<td class='text' style='text-align:" . $alignment[$item['align']] . ';font-size: ' . $item['font_size'] . "pt;'>" . PHP_EOL;
}
$outstr .= "\t\t\t\t$title" . PHP_EOL;
$outstr .= "\t\t\t\t<h3>$title</h3>" . PHP_EOL;
$outstr .= "\t\t\t</td>" . PHP_EOL;
$outstr .= "\t\t</tr>" . PHP_EOL;
}
@@ -1709,7 +1733,7 @@ function reports_expand_tree(&$report, $item, $parent, $output, $format_ok, $the
} else {
$outstr .= "\t\t\t<td class='text' style='text-align:" . $alignment[$item['align']] . ';font-size: ' . $item['font_size'] . "pt;'>" . PHP_EOL;
}
$outstr .= "\t\t\t\t$title" . PHP_EOL;
$outstr .= "\t\t\t\t<h3>$title</h3>" . PHP_EOL;
$outstr .= "\t\t\t</td>" . PHP_EOL;
$outstr .= "\t\t</tr>" . PHP_EOL;
}