From 6f2f56b0dcef9c856361febe1444b0325d95fe4d Mon Sep 17 00:00:00 2001 From: Jon Bendtsen Date: Fri, 3 Apr 2026 19:13:43 +0200 Subject: [PATCH] NEW Printing the initial message from ticket creation just like any new message in tickets Events/Agenda view (#37713) * Printing the initial message from ticket creation just like any new message * Using the same dolPrintHTML parameters regardless of message origin * remove empty line * Use functions names to make PHAN happy --------- Co-authored-by: Jon Bendtsen --- htdocs/core/lib/functions.lib.php | 14 +++++++++----- htdocs/ticket/class/actions_ticket.class.php | 1 + 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 585b7d123a4..22d4139a8f5 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -16253,6 +16253,7 @@ function dolForgeSQLCriteriaCallback($matches) */ function getTimelineIcon($actionstatic, &$histo, $key) { + dol_syslog('getTimelineIcon::begin', LOG_DEBUG); global $langs; $out = '' . "\n"; @@ -16360,6 +16361,7 @@ function getActionCommEcmList($object) */ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = null, $noprint = 0, $actioncode = '', $donetodo = 'done', $filters = array(), $sortfield = 'a.datep,a.id', $sortorder = 'DESC') { + dol_syslog('show_actions_messaging::begin', LOG_DEBUG); global $user, $conf; global $form; @@ -17022,14 +17024,17 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = null, $out .= ''; // Message + if ($actionstatic->code == 'AC_TICKET_CREATE') { + $newmess = $filterobj->message; + } else { + $newmess = $histo[$key]['message']; + } if ( - !empty($histo[$key]['message'] && $histo[$key]['message'] != $libelle) - && $actionstatic->code != 'AC_TICKET_CREATE' + !empty($newmess && $newmess != $libelle) && $actionstatic->code != 'AC_TICKET_MODIFY' ) { $out .= '
'; $truncateLines = getDolGlobalInt('MAIN_TRUNCATE_TIMELINE_MESSAGE', 3); - $newmess = $histo[$key]['message']; $truncatedText = dolGetFirstLineOfText($newmess, $truncateLines); if ($truncateLines > 0 && strlen($newmess) > strlen($truncatedText)) { $out .= '
'; @@ -17045,9 +17050,8 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = null, $out .= '
'; $out .= '
'; } else { - $out .= dolPrintHTML($newmess, 0, array('pre', 'code')); + $out .= dolPrintHTML($newmess, 0, array('pre', 'code')); } - $out .= ''; } diff --git a/htdocs/ticket/class/actions_ticket.class.php b/htdocs/ticket/class/actions_ticket.class.php index a6b5925a4ab..89fa740a404 100644 --- a/htdocs/ticket/class/actions_ticket.class.php +++ b/htdocs/ticket/class/actions_ticket.class.php @@ -200,6 +200,7 @@ class ActionsTicket extends CommonHookActions */ public function viewTicketOriginalMessage($user, $action, $object) { + dol_syslog(__METHOD__, LOG_DEBUG); global $langs; $closeStatuses = [Ticket::STATUS_CLOSED, Ticket::STATUS_CANCELED];