diff --git a/pandora_console/godmode/alerts/alert_view.php b/pandora_console/godmode/alerts/alert_view.php index e8b906b220..17aec8aef0 100644 --- a/pandora_console/godmode/alerts/alert_view.php +++ b/pandora_console/godmode/alerts/alert_view.php @@ -326,32 +326,39 @@ if (count($actions) == 1 && isset($actions[0])) { } foreach ($action['escalation'] as $k => $v) { - if ($v > 0) { - $table->data[$kaction][$k] = html_print_image( - 'images/tick.png', - true, - ['class' => 'invert_filter'] - ); - } else { - $table->data[$kaction][$k] = html_print_image( - 'images/blade.png', - true - ); - } - - if (count($table->head) <= count($action['escalation'])) { - if ($k == count($action['escalation'])) { - if ($k == 1) { - $table->head[$k] = __('Every time that the alert is fired'); + if (count($table->head) >= count($action['escalation'])) { + if ($k === count($action['escalation'])) { + if ($k === 1) { + $table->head[$kaction] = __('Every time that the alert is fired'); } else { - $table->head[$k] = '>#'.($k - 1); + $table->head[$kaction] = '>#'.($kaction - 1); } } else { - $table->head[$k] = '#'.$k; + $table->head[$kaction] = '#'.($kaction); + if ($v > 0) { + $table->data[$kaction][($kaction + 1)] = html_print_image( + 'images/tick.png', + true, + ['class' => 'invert_filter'] + ); + } else { + $table->data[$kkaction][($kaction + 1)] = html_print_image( + 'images/blade.png', + true + ); + } } } } + $table->head[($kaction + 1)] = '#'.($kaction); + if (count($action['escalation']) === 0) { + $table->data[$kaction][($kaction + 2)] = html_print_image( + 'images/blade.png', + true + ); + } + $action_threshold = ($action['module_action_threshold'] > 0) ? $action['module_action_threshold'] : $action['action_threshold']; if ($action_threshold == 0) { @@ -364,7 +371,7 @@ if (count($actions) == 1 && isset($actions[0])) { ); } - $table->head[($k + 1)] = __('Threshold'); + $table->head[($kaction + 1)] = __('Threshold'); } }