From cb8fea7f2e3d35e1eea7f96dc5e9e84356466f1e Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 15 Feb 2017 08:52:57 +0100 Subject: [PATCH] fixed minor errors warnings in log --- .../include/functions_reporting.php | 7 +++- .../include/graphs/functions_pchart.php | 32 +++++++++++++------ 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index bb0d9fdd4e..4a0823fd2c 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -5264,7 +5264,12 @@ function reporting_availability_graph($report, $content, $pdf=false) { } $i++; } - $data['sla_value'] = ($data['time_ok']/($data['time_ok']+$data['time_error']))*100; + if (($data['time_ok']+$data['time_error']) > 0 ) { + $data['sla_value'] = ($data['time_ok']/($data['time_ok']+$data['time_error']))*100; + } + else { + $data['sla_value'] = 0; + } $data['sla_fixed'] = sla_truncate($data['sla_value'], $config['graph_precision'] ); } else{ diff --git a/pandora_console/include/graphs/functions_pchart.php b/pandora_console/include/graphs/functions_pchart.php index e54fbafc05..fb5c8498f4 100644 --- a/pandora_console/include/graphs/functions_pchart.php +++ b/pandora_console/include/graphs/functions_pchart.php @@ -273,17 +273,29 @@ if (empty($colors)) { } foreach ($colors as $i => $color) { - $rgb['border'] = html_html2rgb($color['border']); - $rgb_color[$i]['border']['R'] = $rgb['border'][0]; - $rgb_color[$i]['border']['G'] = $rgb['border'][1]; - $rgb_color[$i]['border']['B'] = $rgb['border'][2]; + if (isset ($color['border'])) { + $rgb['border'] = html_html2rgb($color['border']); - $rgb['color'] = html_html2rgb($color['color']); - $rgb_color[$i]['color']['R'] = $rgb['color'][0]; - $rgb_color[$i]['color']['G'] = $rgb['color'][1]; - $rgb_color[$i]['color']['B'] = $rgb['color'][2]; - - $rgb_color[$i]['alpha'] = $color['alpha']; + if (isset($rgb['border'])) { + $rgb_color[$i]['border']['R'] = $rgb['border'][0]; + $rgb_color[$i]['border']['G'] = $rgb['border'][1]; + $rgb_color[$i]['border']['B'] = $rgb['border'][2]; + } + } + + if (isset ($color['color'])) { + $rgb['color'] = html_html2rgb($color['color']); + + if (isset($rgb['color'])) { + $rgb_color[$i]['color']['R'] = $rgb['color'][0]; + $rgb_color[$i]['color']['G'] = $rgb['color'][1]; + $rgb_color[$i]['color']['B'] = $rgb['color'][2]; + } + } + + if (isset ($color['alpha'])) { + $rgb_color[$i]['alpha'] = $color['alpha']; + } } //add for report with max 15 modules comparation repeat $countlegend = count($legend);