From 892048554e60fb688281297ffd825a23d295585e Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Wed, 29 Nov 2023 10:27:55 +0100 Subject: [PATCH] #12468 Fixed instructions --- pandora_console/include/functions_events.php | 7 +++---- pandora_console/operation/events/events.php | 14 +------------- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 2a91641315..253749ce8e 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -5775,7 +5775,7 @@ function events_get_field_value_by_event_id( } -function events_get_instructions($event) +function events_get_instructions($event, $max_text_length=300) { if (is_array($event) === false) { return ''; @@ -5823,17 +5823,17 @@ function events_get_instructions($event) return ''; } - $max_text_length = 300; $over_text = io_safe_output($value); if (strlen($over_text) > ($max_text_length + 3)) { $over_text = substr($over_text, 0, $max_text_length).'...'; + } else { + return $value; } $output = '
'; $output .= ''; $output .= ''; @@ -5842,7 +5842,6 @@ function events_get_instructions($event) true, ['title' => $over_text] ).''; - $output .= ''; return $output; } diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index 4bddd880c5..467f8dafd8 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -644,19 +644,7 @@ if (is_ajax() === true) { $tmp->data = ui_print_truncate_text($tmp->data, 10); } - $tmp->instructions = events_get_instructions($item); - if (strlen($tmp->instructions) >= 20) { - $tmp->instructions = ui_print_truncate_text( - $tmp->instructions, - 20, - false, - true, - false, - '…', - true, - true, - ); - } + $tmp->instructions = events_get_instructions($item, 15); $tmp->user_comment = ui_print_comments( event_get_last_comment(