From cacd05d667691c18da48443ff2300f95784632a9 Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Tue, 23 Apr 2024 17:12:36 +0200 Subject: [PATCH 1/2] #13223 Fixed instructions dialog in events --- pandora_console/include/functions_events.php | 26 ++++++++++++++++++-- pandora_console/operation/events/events.php | 11 ++++++--- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 6e6068f386..823a46f35f 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -5888,6 +5888,12 @@ function events_get_instructions($event, $max_text_length=300) io_safe_output($event['unknown_instructions']) ); } + + $event_name = str_replace( + "'", + '', + io_safe_output($event['evento']) + ); break; case 'going_up_warning': @@ -5899,6 +5905,12 @@ function events_get_instructions($event, $max_text_length=300) io_safe_output($event['warning_instructions']) ); } + + $event_name = str_replace( + "'", + '', + io_safe_output($event['evento']) + ); break; case 'going_up_critical': @@ -5910,6 +5922,12 @@ function events_get_instructions($event, $max_text_length=300) io_safe_output($event['critical_instructions']) ); } + + $event_name = str_replace( + "'", + '', + io_safe_output($event['evento']) + ); break; default: @@ -5928,17 +5946,21 @@ function events_get_instructions($event, $max_text_length=300) return $value; } + $over_event_name = ui_print_truncate_text($event_name, 51, false, true, false); $output = '
'; $output .= ''; - $output .= ''; + $output .= ''; $output .= html_print_image( 'images/default_list.png', true, - ['title' => $over_text] + [ + 'title' => $over_text, + 'class' => 'invert_filter', + ] ).''; return $output; diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index 7c5f1b1210..f5da6c3020 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -3715,11 +3715,16 @@ function datetime_picker_callback() { datetime_picker_callback(); -function show_instructions(id){ +function show_instructions(id, title_event){ title = ""; $('#hidden_event_instructions_' + id).dialog({ - title: title, - width: 600 + title: `${title+' '+title_event}`, + width: 650, + draggable: false, + }); + + $(document).on('click','div', function(){ + $('#hidden_event_instructions_' + id).dialog('close'); }); } From a41a1becfa0a3719712acdb8a01f75aa3ae598e4 Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Wed, 24 Apr 2024 09:56:48 +0200 Subject: [PATCH 2/2] #13223 Fixed instructions dialog in events as a modal --- pandora_console/include/functions_events.php | 29 +++++++------------- pandora_console/operation/events/events.php | 15 ++++++---- 2 files changed, 19 insertions(+), 25 deletions(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 823a46f35f..9718eca184 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -5888,12 +5888,6 @@ function events_get_instructions($event, $max_text_length=300) io_safe_output($event['unknown_instructions']) ); } - - $event_name = str_replace( - "'", - '', - io_safe_output($event['evento']) - ); break; case 'going_up_warning': @@ -5905,12 +5899,6 @@ function events_get_instructions($event, $max_text_length=300) io_safe_output($event['warning_instructions']) ); } - - $event_name = str_replace( - "'", - '', - io_safe_output($event['evento']) - ); break; case 'going_up_critical': @@ -5922,12 +5910,6 @@ function events_get_instructions($event, $max_text_length=300) io_safe_output($event['critical_instructions']) ); } - - $event_name = str_replace( - "'", - '', - io_safe_output($event['evento']) - ); break; default: @@ -5946,7 +5928,16 @@ function events_get_instructions($event, $max_text_length=300) return $value; } - $over_event_name = ui_print_truncate_text($event_name, 51, false, true, false); + $event_name = ui_print_truncate_text( + io_safe_output($event['evento']), + GENERIC_SIZE_TEXT, + false, + true, + false, + '...' + ); + + $over_event_name = base64_encode($event_name); $output = '