From 90c91f67fa65a8d2b697cc9bb5762238584abde3 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Tue, 12 Dec 2023 12:45:13 +0100 Subject: [PATCH 1/2] #12633 Fixed Acknowledged --- pandora_console/include/functions_events.php | 61 ++++++-------------- 1 file changed, 19 insertions(+), 42 deletions(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 747e5154ce..1a37bfbf95 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -5039,7 +5039,11 @@ function events_page_general($event) $data[1] = $user_owner; } - $table_general->cellclass[3][1] = 'general_owner'; + if (is_metaconsole() === true && $event['server_name'] !== '') { + $table_general->cellclass[4][1] = 'general_owner'; + } else { + $table_general->cellclass[3][1] = 'general_owner'; + } $table_general->data[] = $data; @@ -5100,38 +5104,7 @@ function events_page_general($event) $data = []; $data[0] = __('Acknowledged by'); - - if ($event['estado'] == 1 || $event['estado'] == 2) { - if (empty($event['id_usuario']) === true) { - $user_ack = __('Autovalidated'); - } else { - $user_ack = db_get_value( - 'fullname', - 'tusuario', - 'id_user', - $event['id_usuario'] - ); - - if (empty($user_ack) === true) { - $user_ack = $event['id_usuario']; - } - } - - $data[1] = $user_ack.' ( '; - if ($event['ack_utimestamp_raw'] !== false - && $event['ack_utimestamp_raw'] !== 'false' - && empty($event['ack_utimestamp_raw']) === false - ) { - $data[1] .= date( - $config['date_format'], - $event['ack_utimestamp_raw'] - ); - } - - $data[1] .= ' ) '; - } else { - $data[1] = ''.__('N/A').''; - } + $data[1] = events_page_general_acknowledged($event['id_evento']); $table_general->cellclass[7][1] = 'general_status'; @@ -5237,15 +5210,19 @@ function events_page_general_acknowledged($event_id) $Acknowledged = ''; $event = db_get_row('tevento', 'id_evento', $event_id); if ($event !== false && ($event['estado'] == 1 || $event['estado'] == 2)) { - $user_ack = db_get_value( - 'fullname', - 'tusuario', - 'id_user', - $config['id_user'] - ); + if (empty($event['id_usuario']) === true) { + $user_ack = __('Autovalidated'); + } else { + $user_ack = db_get_value( + 'fullname', + 'tusuario', + 'id_user', + $config['id_user'] + ); - if (empty($user_ack) === true) { - $user_ack = $config['id_user']; + if (empty($user_ack) === true) { + $user_ack = $config['id_user']; + } } $Acknowledged = $user_ack.' ( '; @@ -5260,7 +5237,7 @@ function events_page_general_acknowledged($event_id) $Acknowledged .= ' ) '; } else { - $Acknowledged = 'N/A'; + $Acknowledged = ''.__('N/A').''; } return $Acknowledged; From 9dbac217c18661b89b41e2fb6088601259b8b4fe Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Tue, 12 Dec 2023 14:07:18 +0100 Subject: [PATCH 2/2] #12633 Fixed Acknowledged 2 --- pandora_console/include/functions_events.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 1a37bfbf95..64beee38c1 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -5103,9 +5103,23 @@ function events_page_general($event) $table_general->cellclass[count($table_general->data)][1] = 'general_acknowleded'; $data = []; + + if (empty($event['server_id']) === false && (int) $event['server_id'] > 0 + && is_metaconsole() === true + ) { + $node_connect = new Node($event['server_id']); + $node_connect->connect(); + } + $data[0] = __('Acknowledged by'); $data[1] = events_page_general_acknowledged($event['id_evento']); + if (empty($event['server_id']) === false && (int) $event['server_id'] > 0 + && is_metaconsole() === true + ) { + $node_connect->disconnect(); + } + $table_general->cellclass[7][1] = 'general_status'; $table_general->data[] = $data;