Merge branch 'ent-11701-aparicion-de-columnas-raras-en-detalles-de-alertas' into 'develop'

Ent 11701 aparicion de columnas raras en detalles de alertas

See merge request artica/pandorafms!6219
This commit is contained in:
Gorka Sanchez 2023-07-10 11:46:54 +00:00
commit bd9e62540f

View File

@ -318,14 +318,9 @@ if (count($actions) == 1 && isset($actions[0])) {
} else { } else {
foreach ($actions as $kaction => $action) { foreach ($actions as $kaction => $action) {
$table->data[$kaction][0] = $action['name']; $table->data[$kaction][0] = $action['name'];
if ((int) $kaction === 0) { if (count($action['escalation']) > 1) {
$table->data[$kaction][0] .= ui_print_help_tip(
__('The default actions will be executed every time that the alert is fired and no other action is executed'),
true
);
}
foreach ($action['escalation'] as $k => $v) { foreach ($action['escalation'] as $k => $v) {
$table->head[$k] = '#'.$k;
if ($v > 0) { if ($v > 0) {
$table->data[$kaction][$k] .= html_print_image( $table->data[$kaction][$k] .= html_print_image(
'images/tick.png', 'images/tick.png',
@ -338,54 +333,44 @@ if (count($actions) == 1 && isset($actions[0])) {
true true
); );
} }
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[$kaction] = '>#'.($kaction - 1);
} }
} else { } else {
$table->head[$kaction] = '#'.($kaction); $table->head[1] = __('Every time that the alert is fired');
if ($v > 0) { if (count($action['escalation']) > 0) {
$table->data[$kaction][($kaction + 1)] = html_print_image( if ($action['escalation'][0] > 0) {
$table->data[$kaction][1] .= html_print_image(
'images/tick.png', 'images/tick.png',
true, true,
['class' => 'invert_filter'] ['class' => 'invert_filter']
); );
} else { } else {
$table->data[$kkaction][($kaction + 1)] = html_print_image( $table->data[$kaction][1] = html_print_image(
'images/blade.png', 'images/blade.png',
true true
); );
} }
} } else {
} $table->data[$kaction][1] = html_print_image(
}
$table->head[($kaction + 1)] = '#'.($kaction);
if (count($action['escalation']) === 0) {
$table->data[$kaction][($kaction + 2)] = html_print_image(
'images/blade.png', 'images/blade.png',
true true
); );
} }
}
$action_threshold = ($action['module_action_threshold'] > 0) ? $action['module_action_threshold'] : $action['action_threshold']; $action_threshold = ($action['module_action_threshold'] > 0) ? $action['module_action_threshold'] : $action['action_threshold'];
if ($action_threshold == 0) { if ($action_threshold == 0) {
$table->data[$kaction][($k + 1)] = __('No'); $table->data[$kaction][] = __('No');
} else { } else {
$table->data[$kaction][($k + 1)] = human_time_description_raw( $table->data[$kaction][] = human_time_description_raw(
$action_threshold, $action_threshold,
true, true,
'tiny' 'tiny'
); );
} }
$table->head[($kaction + 1)] = __('Threshold');
} }
$table->head[] = __('Threshold');
} }
html_print_table($table); html_print_table($table);