Merge branch '3269-Errores_informe_availability_graph' into 'develop'

fixed errors in availability reports

See merge request artica/pandorafms!2088

Former-commit-id: 9497860a73fe05a656cc19423af8d9dce3f60d53
This commit is contained in:
vgilc 2018-12-21 10:18:24 +01:00
commit 8c38ab63da
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['contents'][] = reporting_availability_graph(
$report, $report,
$content, $content,
$pdf); $pdf
);
break; break;
case 'sql': case 'sql':
$report['contents'][] = reporting_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) { function reporting_html_availability_graph(&$table, $item, $pdf=0) {
global $config; global $config;
$metaconsole_on = is_metaconsole(); $metaconsole_on = is_metaconsole();
if($metaconsole_on && $pdf==0){
$src= '../../'; if($metaconsole_on){
$hack_metaconsole = "../../";
} }
else{ else{
$src=$config['homeurl']; $hack_metaconsole = "";
} }
$src=ui_get_full_url(false);
$tables_chart = '';
$table1 = new stdClass(); $table1 = new stdClass();
$table1->width = '99%'; $table1->width = '99%';
$table1->data = array (); $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][1] = $chart['chart'];
$table1->data[0][2] = "<span style = 'font: bold 2em Arial, Sans-serif; color: ".$color."'>" . $sla_value . '</span>'; $table1->data[0][2] = "<span style = 'font: bold 2em Arial, Sans-serif; color: ".$color."'>" . $sla_value . '</span>';
$table1->data[0][3] = $checks_resume; $table1->data[0][3] = $checks_resume;
$tables_chart .= html_print_table($table1, true);
} }
if($item['type'] == 'availability_graph'){ if($item['type'] == 'availability_graph'){
@ -2480,43 +2487,43 @@ function reporting_html_availability_graph(&$table, $item, $pdf=0) {
$table2->data = array (); $table2->data = array ();
$table2->size = array (); $table2->size = array ();
$table2->size[0] = '2%'; $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->size[1] = '14%';
$table2->data[0][1] = '<span>'.__('OK') . '</span>'; $table2->data[0][1] = '<span>'.__('OK') . '</span>';
$table2->size[2] = '2%'; $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->size[3] = '14%';
$table2->data[0][3] = '<span>'.__('Critical'). '</span>'; $table2->data[0][3] = '<span>'.__('Critical'). '</span>';
$table2->size[4] = '2%'; $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->size[5] = '14%';
$table2->data[0][5] = '<span>'.__('Unknow'). '</span>'; $table2->data[0][5] = '<span>'.__('Unknow'). '</span>';
$table2->size[6] = '2%'; $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->size[7] = '14%';
$table2->data[0][7] = '<span>'.__('Not Init'). '</span>'; $table2->data[0][7] = '<span>'.__('Not Init'). '</span>';
$table2->size[8] = '2%'; $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->size[9] = '14%';
$table2->data[0][9] = '<span>'.__('Downtimes'). '</span>'; $table2->data[0][9] = '<span>'.__('Downtimes'). '</span>';
$table2->size[10] = '2%'; $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->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'] = $tables_chart;
$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($table1, true) . '<br />' . html_print_table($table2, true); return $tables_chart . '<br />' . html_print_table($table2, true);
} }
} }