fixed errors in availability reports

Former-commit-id: 0783d9b68bf5f3373579db9f0b09e7506d95ea84
This commit is contained in:
daniel 2018-12-17 13:20:57 +01:00
parent b25686713d
commit 225635a774
2 changed files with 20 additions and 12 deletions

View File

@ -304,7 +304,8 @@ function reporting_make_reporting_data($report = null, $id_report,
$report['contents'][] = reporting_availability_graph(
$report,
$content,
$pdf);
$pdf
);
break;
case 'sql':
$report['contents'][] = reporting_sql(

View File

@ -2428,12 +2428,18 @@ function reporting_html_availability(&$table, $item) {
function reporting_html_availability_graph(&$table, $item, $pdf=0) {
global $config;
$metaconsole_on = is_metaconsole();
if($metaconsole_on && $pdf==0){
$src= '../../';
if($metaconsole_on){
$hack_metaconsole = "../../";
}
else{
$src=$config['homeurl'];
$hack_metaconsole = "";
}
$src=ui_get_full_url(false);
$tables_chart = '';
$table1 = new stdClass();
$table1->width = '99%';
$table1->data = array ();
@ -2471,6 +2477,7 @@ function reporting_html_availability_graph(&$table, $item, $pdf=0) {
$table1->data[0][1] = $chart['chart'];
$table1->data[0][2] = "<span style = 'font: bold 2em Arial, Sans-serif; color: ".$color."'>" . $sla_value . '</span>';
$table1->data[0][3] = $checks_resume;
$tables_chart .= html_print_table($table1, true);
}
if($item['type'] == 'availability_graph'){
@ -2480,43 +2487,43 @@ function reporting_html_availability_graph(&$table, $item, $pdf=0) {
$table2->data = array ();
$table2->size = array ();
$table2->size[0] = '2%';
$table2->data[0][0] = '<img src ="'. $src .'images/square_green.png">';
$table2->data[0][0] = '<img src ="'. $src . $hack_metaconsole . 'images/square_green.png">';
$table2->size[1] = '14%';
$table2->data[0][1] = '<span>'.__('OK') . '</span>';
$table2->size[2] = '2%';
$table2->data[0][2] = '<img src ="'. $src .'images/square_red.png">';
$table2->data[0][2] = '<img src ="'. $src . $hack_metaconsole .'images/square_red.png">';
$table2->size[3] = '14%';
$table2->data[0][3] = '<span>'.__('Critical'). '</span>';
$table2->size[4] = '2%';
$table2->data[0][4] = '<img src ="'. $src .'images/square_gray.png">';
$table2->data[0][4] = '<img src ="'. $src . $hack_metaconsole .'images/square_gray.png">';
$table2->size[5] = '14%';
$table2->data[0][5] = '<span>'.__('Unknow'). '</span>';
$table2->size[6] = '2%';
$table2->data[0][6] = '<img src ="'. $src .'images/square_blue.png">';
$table2->data[0][6] = '<img src ="'. $src . $hack_metaconsole .'images/square_blue.png">';
$table2->size[7] = '14%';
$table2->data[0][7] = '<span>'.__('Not Init'). '</span>';
$table2->size[8] = '2%';
$table2->data[0][8] = '<img src ="'. $src .'images/square_violet.png">';
$table2->data[0][8] = '<img src ="'. $src . $hack_metaconsole .'images/square_violet.png">';
$table2->size[9] = '14%';
$table2->data[0][9] = '<span>'.__('Downtimes'). '</span>';
$table2->size[10] = '2%';
$table2->data[0][10] = '<img src ="'. $src .'images/square_light_gray.png">';
$table2->data[0][10] = '<img src ="'. $src . $hack_metaconsole .'images/square_light_gray.png">';
$table2->size[11] = '15%';
$table2->data[0][11] = '<span>'.__('Ignore time'). '</span>';
}
$table->colspan['charts']['cell'] = 2;
$table->data['charts']['cell'] = html_print_table($table1, true);
$table->data['charts']['cell'] = $tables_chart;
$table->colspan['legend']['cell'] = 2;
$table->data['legend']['cell'] = html_print_table($table2, true);
if($pdf){
return html_print_table($table1, true) . '<br />' . html_print_table($table2, true);
return $tables_chart . '<br />' . html_print_table($table2, true);
}
}