fixed minor error availability graph print to pdf

This commit is contained in:
daniel 2018-12-04 13:00:51 +01:00
parent daa928adb4
commit df3d142baf

View File

@ -2466,18 +2466,14 @@ function reporting_html_availability_graph(&$table, $item, $pdf=0) {
$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'] . ")"; $checks_resume = "(" . $chart['checks_ok'] . "/" . $chart['checks_total'] . ")";
} }
$table1->data[] = array(
$chart['agent'] . "<br />" . $chart['module'], $table1->data[0][0] = $chart['agent'] . "<br />" . $chart['module'];
$chart['chart'], $table1->data[0][1] = $chart['chart'];
"<span style = 'font: bold 2em Arial, Sans-serif; color: ".$color."'>" . $table1->data[0][2] = "<span style = 'font: bold 2em Arial, Sans-serif; color: ".$color."'>" . $sla_value . '</span>';
$sla_value . $table1->data[0][3] = $checks_resume;
'</span>',
$checks_resume
);
} }
if($item['type'] == 'availability_graph'){ if($item['type'] == 'availability_graph'){
//table_legend_graphs; //table_legend_graphs;
$table2 = new stdClass(); $table2 = new stdClass();
$table2->width = '99%'; $table2->width = '99%';
@ -2512,15 +2508,15 @@ function reporting_html_availability_graph(&$table, $item, $pdf=0) {
$table2->data[0][10] = '<img src ="'. $src .'images/square_light_gray.png">'; $table2->data[0][10] = '<img src ="'. $src .'images/square_light_gray.png">';
$table2->size[11] = '15%'; $table2->size[11] = '15%';
$table2->data[0][11] = '<span>'.__('Ignore time'). '</span>'; $table2->data[0][11] = '<span>'.__('Ignore time'). '</span>';
} }
$table->colspan['charts']['cell'] = 2; $table->colspan['charts']['cell'] = 2;
$table->data['charts']['cell'] = html_print_table($table1, true); $table->data['charts']['cell'] = html_print_table($table1, true);
$table->colspan['legend']['cell'] = 2; $table->colspan['legend']['cell'] = 2;
$table->data['legend']['cell'] = html_print_table($table2, true); $table->data['legend']['cell'] = html_print_table($table2, true);
if($pdf){ if($pdf){
return html_print_table($table, true); return html_print_table($table1, true) . '<br />' . html_print_table($table2, true);
} }
} }