From 40143a1402dabbb464a3673c9b78be0ef41953b5 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Date: Thu, 14 Feb 2019 15:50:13 +0100 Subject: [PATCH] fixed reports Former-commit-id: 99e8d84b1db440156f8b382ded51be7c39322eed --- .../include/functions_reporting_html.php | 31 +++++++++++++------ 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index 2c29258d05..935c12c871 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -2955,7 +2955,7 @@ function reporting_html_availability_graph($table, $item, $pdf=0) global $config; $metaconsole_on = is_metaconsole(); - if ($metaconsole_on) { + if ($metaconsole_on !== false) { $hack_metaconsole = '../../'; } else { $hack_metaconsole = ''; @@ -2997,7 +2997,10 @@ function reporting_html_availability_graph($table, $item, $pdf=0) break; } - $sla_value = sla_truncate($chart['sla_value'], $config['graph_precision']).'%'; + $sla_value = sla_truncate( + $chart['sla_value'], + $config['graph_precision'] + ).'%'; $checks_resume = '('.$chart['checks_ok'].'/'.$chart['checks_total'].')'; } @@ -3005,7 +3008,10 @@ function reporting_html_availability_graph($table, $item, $pdf=0) $table1->data[0][1] = $chart['chart']; $table1->data[0][2] = "".$sla_value.''; $table1->data[0][3] = $checks_resume; - $tables_chart .= html_print_table($table1, true); + $tables_chart .= html_print_table( + $table1, + true + ); } if ($item['type'] == 'availability_graph') { @@ -3045,13 +3051,20 @@ function reporting_html_availability_graph($table, $item, $pdf=0) $table2->data[0][11] = ''.__('Ignore time').''; } - $table->colspan['charts']['cell'] = 2; - $table->data['charts']['cell'] = $tables_chart; - $table->colspan['legend']['cell'] = 2; - $table->data['legend']['cell'] = html_print_table($table2, true); - if ($pdf !== 0) { - return $tables_chart.'
'.html_print_table($table2, true); + $tables_chart .= html_print_table( + $table2, + true + ); + return $tables_chart; + } else { + $table->colspan['charts']['cell'] = 2; + $table->data['charts']['cell'] = $tables_chart; + $table->colspan['legend']['cell'] = 2; + $table->data['legend']['cell'] = html_print_table( + $table2, + true + ); } }