10075 Compatibility SLA report with php8

This commit is contained in:
Pablo Aragon 2022-12-30 10:21:43 +01:00
parent ebae22636e
commit f310ce49a9
1 changed files with 15 additions and 15 deletions

View File

@ -652,18 +652,18 @@ function reporting_html_SLA($table, $item, $mini, $pdf=0)
$row[] = round($sla['sla_limit'], 2).'%';
if (reporting_sla_is_not_init_from_array($sla)) {
$row[] = '<span style="font-weight: bold; font-size: '.$font_size.' !important; color: '.COL_NOTINIT.';">'.__('N/A').'</span>';
$row[] = '<span style="font-weight: bold; font-size: '.$font_size.' !important; color: '.COL_NOTINIT.';">'.__('Not init').'</span>';
$row[] = '<span style="font-weight: bold; font-size: '.$font_size.(($pdf === 0) ? ' !important' : '').'; color: '.COL_NOTINIT.';">'.__('N/A').'</span>';
$row[] = '<span style="font-weight: bold; font-size: '.$font_size.(($pdf === 0) ? ' !important' : '').'; color: '.COL_NOTINIT.';">'.__('Not init').'</span>';
} else if (reporting_sla_is_ignored_from_array($sla)) {
$row[] = '<span style="font-weight: bold; font-size: '.$font_size.' !important; color: '.COL_IGNORED.';">'.__('N/A').'</span>';
$row[] = '<span style="font-weight: bold; font-size: '.$font_size.' !important; color: '.COL_IGNORED.';">'.__('No data').'</span>';
$row[] = '<span style="font-weight: bold; font-size: '.$font_size.(($pdf === 0) ? ' !important' : '').'; color: '.COL_IGNORED.';">'.__('N/A').'</span>';
$row[] = '<span style="font-weight: bold; font-size: '.$font_size.(($pdf === 0) ? ' !important' : '').'; color: '.COL_IGNORED.';">'.__('No data').'</span>';
// Normal calculation.
} else if ($sla['sla_status']) {
$row[] = '<span style="font-weight: bold; font-size: '.$font_size.' !important; color: '.COL_NORMAL.';">'.sla_truncate($sla['sla_value'], $config['graph_precision']).'%</span>';
$row[] = '<span style="font-weight: bold; font-size: '.$font_size.' !important; color: '.COL_NORMAL.';">'.__('OK').'</span>';
$row[] = '<span style="font-weight: bold; font-size: '.$font_size.(($pdf === 0) ? ' !important' : '').'; color: '.COL_NORMAL.';">'.sla_truncate($sla['sla_value'], $config['graph_precision']).'%</span>';
$row[] = '<span style="font-weight: bold; font-size: '.$font_size.(($pdf === 0) ? ' !important' : '').'; color: '.COL_NORMAL.';">'.__('OK').'</span>';
} else {
$row[] = '<span style="font-weight: bold; font-size: '.$font_size.' !important; color: '.COL_CRITICAL.';">'.sla_truncate($sla['sla_value'], $config['graph_precision']).'%</span>';
$row[] = '<span style="font-weight: bold; font-size: '.$font_size.' !important; color: '.COL_CRITICAL.';">'.__('Fail').'</span>';
$row[] = '<span style="font-weight: bold; font-size: '.$font_size.(($pdf === 0) ? ' !important' : '').'; color: '.COL_CRITICAL.';">'.sla_truncate($sla['sla_value'], $config['graph_precision']).'%</span>';
$row[] = '<span style="font-weight: bold; font-size: '.$font_size.(($pdf === 0) ? ' !important' : '').'; color: '.COL_CRITICAL.';">'.__('Fail').'</span>';
}
// Second table for time globals.
@ -3463,10 +3463,10 @@ function reporting_html_monitor_report($table, $item, $mini, $pdf=0)
$table1->head = [];
$table1->data = [];
if ($item['data']['unknown'] == 1) {
$table1->data['data']['unknown'] = '<p class="bolder" style="font-size: '.$font_size.' !important; color: '.COL_UNKNOWN.';">';
$table1->data['data']['unknown'] = '<p class="bolder" style="font-size: '.$font_size.(($pdf === 0) ? ' !important' : '').'; color: '.COL_UNKNOWN.';">';
$table1->data['data']['unknown'] .= __('Unknown').'</p>';
} else {
$table1->data['data']['ok'] = '<p class="bolder" style="font-size: '.$font_size.' !important; color: '.COL_NORMAL.';">';
$table1->data['data']['ok'] = '<p class="bolder" style="font-size: '.$font_size.(($pdf === 0) ? ' !important' : '').'; color: '.COL_NORMAL.';">';
$table1->data['data']['ok'] .= html_print_image(
'images/module_ok.png',
true
@ -3479,7 +3479,7 @@ function reporting_html_monitor_report($table, $item, $mini, $pdf=0)
)
).' %</p>';
$table1->data['data']['fail'] = '<p class="bolder" style="font-size: '.$font_size.' !important; color: '.COL_CRITICAL.';">';
$table1->data['data']['fail'] = '<p class="bolder" style="font-size: '.$font_size.(($pdf === 0) ? ' !important' : '').'; color: '.COL_CRITICAL.';">';
$table1->data['data']['fail'] .= html_print_image(
'images/module_critical.png',
true
@ -4683,7 +4683,7 @@ function reporting_html_availability_graph($table, $item, $pdf=0)
$checks_resume_text = '<span style = "font-size: '.$font_mini.';">';
$checks_resume_text .= $checks_resume;
$checks_resume_text .= '</span>';
$sla_value_text = "<span style = 'font-weight: bold; font-size: ".$font_size.' !important; color: '.$color."'>".$sla_value.'</span>';
$sla_value_text = "<span style = 'font-weight: bold; font-size: ".$font_size.(($pdf === 0) ? ' !important' : '').'; color: '.$color."'>".$sla_value.'</span>';
switch ($item['data'][$k_chart]['failover']) {
case 'primary_compare':
$title = '<b>'.__('Primary').' (24x7)</b>';
@ -4711,7 +4711,7 @@ function reporting_html_availability_graph($table, $item, $pdf=0)
case 'result_compare':
$title = '<b>'.__('Result').' (24x7)</b>';
$sla_value_text = "<span style = 'font-weight: bold; font-size: ".$font_size.' !important; color: '.$color."'>".$sla_value.'</span>';
$sla_value_text = "<span style = 'font-weight: bold; font-size: ".$font_size.(($pdf === 0) ? ' !important' : '').'; color: '.$color."'>".$sla_value.'</span>';
$checks_resume_text = '<span style = "font-size: '.$font_mini.';">';
$checks_resume_text .= $checks_resume;
$checks_resume_text .= '</span>';
@ -4722,7 +4722,7 @@ function reporting_html_availability_graph($table, $item, $pdf=0)
$total_values += $sla_value;
$count_total_charts++;
$title = '<b>'.__('Result').'</b>';
$sla_value_text = "<span style = 'font-weight: bold; font-size: ".$font_size.' !important; color: '.$color."'>".$sla_value.'</span>';
$sla_value_text = "<span style = 'font-weight: bold; font-size: ".$font_size.(($pdf === 0) ? ' !important' : '').'; color: '.$color."'>".$sla_value.'</span>';
$checks_resume_text = '<span style = "font-size: '.$font_mini.';">';
$checks_resume_text .= $checks_resume;
$checks_resume_text .= '</span>';
@ -4756,7 +4756,7 @@ function reporting_html_availability_graph($table, $item, $pdf=0)
$table_summary->data = [];
$table_summary->data[0][0] = '<b>'.__('Summary').'</b>';
$table_summary->data[0][1] = '<span style = "font-weight: bold; font-size: '.$font_size.' !important;">';
$table_summary->data[0][1] = '<span style = "font-weight: bold; font-size: '.$font_size.(($pdf === 0) ? ' !important' : '').';">';
$table_summary->data[0][1] .= sla_truncate($total_values / $count_total_charts);
$table_summary->data[0][1] .= ' %';
$table_summary->data[0][1] .= '</span>';