fix in threshold calculation

This commit is contained in:
alejandro.campos@artica.es 2021-10-01 09:06:41 +02:00
parent af4a29d093
commit 675e64d8ca
1 changed files with 23 additions and 7 deletions

View File

@ -6752,25 +6752,41 @@ function reporting_advanced_sla(
} }
if (!$is_string_module) { if (!$is_string_module) {
if ((!isset($min_value)) || ($min_value == 0)) { if (isset($min_value) === false || (int) $min_value === 0) {
$min_value = null; $min_value = null;
} }
if ((!isset($max_value)) || ($max_value == 0)) { if (isset($max_value) === false || (int) $max_value === 0) {
$max_value = null; if ($max_value === '0'
&& $max_value < $min_value
&& isset($min_value_warning) === true
&& $min_value_warning > $max_value
) {
$max_value = $min_value_warning;
} else {
$max_value = null;
}
} }
if ((!(isset($max_value))) && (!(isset($min_value)))) { if (isset($max_value) === false && isset($min_value) === false) {
$max_value = null; $max_value = null;
$min_value = null; $min_value = null;
} }
if ((!isset($min_value_warning)) || ($min_value_warning == 0)) { if (isset($min_value_warning) === false || (int) $min_value_warning === 0) {
$min_value_warning = null; $min_value_warning = null;
} }
if ((!isset($max_value_warning)) || ($max_value_warning == 0)) { if (isset($max_value_warning) === false || (int) $max_value_warning === 0) {
$max_value_warning = null; if ((int) $max_value_warning === 0
&& $max_value_warning < $min_value_warning
&& isset($min_value) === true
&& $min_value > $max_value_warning
) {
$max_value_warning = $min_value;
} else {
$max_value_warning = null;
}
} }
} }