From ebf912437bdc002f5a0cc05d1b1935776f199355 Mon Sep 17 00:00:00 2001 From: marcos Date: Thu, 18 Mar 2021 18:05:53 +0100 Subject: [PATCH] fixed error with sort function --- .../include/class/AgentsAlerts.class.php | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/pandora_console/include/class/AgentsAlerts.class.php b/pandora_console/include/class/AgentsAlerts.class.php index b63860f84d..c2d8604bef 100644 --- a/pandora_console/include/class/AgentsAlerts.class.php +++ b/pandora_console/include/class/AgentsAlerts.class.php @@ -548,10 +548,7 @@ class AgentsAlerts extends HTML if (empty($templates_raw)) { $templates_raw = []; } - } - - // Is needed sort templates for show in the row. - sort($templates); + }; $alerts = []; $ntemplates = 0; @@ -600,20 +597,22 @@ class AgentsAlerts extends HTML } $templates[$temp['id']] = $temp['name']; + } + } - if (empty($temp['name']) === false) { - $outputLine = html_print_div( - [ - 'id' => 'line_header_'.$temp['id'], - 'class' => 'rotate_text_module position_text_module', - 'style' => '', - 'content' => '
'.ui_print_truncate_text(io_safe_output($temp['name']), 20).'
', - ], - true - ); + foreach ($templates as $id => $name) { + if (empty($name) === false) { + $outputLine = html_print_div( + [ + 'id' => 'line_header_'.$id, + 'class' => 'rotate_text_module position_text_module', + 'style' => '', + 'content' => '
'.ui_print_truncate_text(io_safe_output($name), 20).'
', + ], + true + ); - echo sprintf('%s', $thSize, $outputLine); - } + echo sprintf('%s', $thSize, $outputLine); } }