From 9940db94d98df5ed519ae4fc4fe5c749c26e04a3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 4 Mar 2026 03:04:31 +0100 Subject: [PATCH] Debug v23 --- htdocs/core/lib/functions.lib.php | 34 +++++++++++++++++++------------ 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 2efad4cce85..2a172f639e1 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3864,7 +3864,7 @@ function dol_strftime($fmt, $ts = false, $is_gmt = false) * 'tzuserrel' => output string is for user TZ (current browser TZ with dst or not, depending on date position) * @param ?Translate $outputlangs Object lang that contains language for text translation. * @param boolean $encodetooutput Use true to convert/encode string into the HTML rendering pagecode (false=keep UTF8 by default) - * @param int $decorate Use 1 to apply a HTML css style to decorate the date + * @param int|string $decorate Use 1 or a css to apply a HTML css style to decorate the date * @return string Formatted date or '' if time is null * * @see dol_mktime(), dol_stringtotime(), dol_getdate(), selectDate() @@ -4113,8 +4113,8 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs = } if ($decorate) { - $ret = preg_replace('/(\d\d:\d\d [AP]M)$/', '\1', $ret); - $ret = preg_replace('/(\d\d:\d\d)$/', '\1', $ret); + $ret = preg_replace('/(\d\d:\d\d [AP]M)$/', '\1', $ret); + $ret = preg_replace('/(\d\d:\d\d)$/', '\1', $ret); } return $ret; @@ -16387,7 +16387,7 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = null, 'datestart' => $db->jdate($obj->dp), 'dateend' => $db->jdate($obj->dp2), 'note' => $obj->label, - 'message' => dol_htmlentitiesbr($obj->message), + 'message' => $obj->message, 'percent' => $obj->percent, 'userid' => $obj->user_id, @@ -16417,7 +16417,7 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = null, 'datestart' => $db->jdate($obj->dp), 'dateend' => $db->jdate($obj->dp2), 'note' => $obj->label, - 'message' => dol_htmlentitiesbr($obj->message), + 'message' => $obj->message, 'percent' => $obj->percent, 'acode' => $obj->acode, @@ -16629,16 +16629,23 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = null, $out .= ''; // Date - $out .= ' '; + $out .= ' '; + $out .= ''; $out .= dol_print_date($histo[$key]['datestart'], 'day', 'tzuserrel'); - $out .= '   '.dol_print_date($histo[$key]['datestart'], 'hour', 'tzuserrel', null, false, 1); + //$out .= ''; + //$out .= ''. + $out .= ' '.dol_print_date($histo[$key]['datestart'], 'hour', 'tzuserrel', null, false, 'opacitymedium'); + //$out .= ''; if ($histo[$key]['dateend'] && $histo[$key]['dateend'] != $histo[$key]['datestart']) { $tmpa = dol_getdate($histo[$key]['datestart'], true); $tmpb = dol_getdate($histo[$key]['dateend'], true); if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) { - $out .= '-' . dol_print_date($histo[$key]['dateend'], 'hour', 'tzuserrel', null, false, 1); + $out .= ' - ' . dol_print_date($histo[$key]['dateend'], 'hour', 'tzuserrel', null, false, 1); } else { - $out .= '-' . dol_print_date($histo[$key]['dateend'], 'dayhour', 'tzuserrel', null, false, 1); + $out .= ' - ' . dol_print_date($histo[$key]['dateend'], 'day', 'tzuserrel'); + //$out .= ''; + $out .= ' '.dol_print_date($histo[$key]['dateend'], 'hour', 'tzuserrel', null, false, 'opacitymedium'); + //$out .= ''; } } $late = 0; @@ -16749,20 +16756,21 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = null, ) { $out .= '
'; $truncateLines = getDolGlobalInt('MAIN_TRUNCATE_TIMELINE_MESSAGE', 3); - $truncatedText = dolGetFirstLineOfText($histo[$key]['message'], $truncateLines); - if ($truncateLines > 0 && strlen($histo[$key]['message']) > strlen($truncatedText)) { + $newmess = dol_htmlentitiesbr($histo[$key]['message']); + $truncatedText = dolGetFirstLineOfText($newmess, $truncateLines); + if ($truncateLines > 0 && strlen($newmess) > strlen($truncatedText)) { $out .= '
'; $out .= '
'; $out .= dolPrintHTML($truncatedText); $out .= '
' . $langs->trans("ReadMore") . ' '; $out .= '
'; $out .= '
'; - $out .= dolPrintHTML($histo[$key]['message']); + $out .= dolPrintHTML($newmess); $out .= ' ' . $langs->trans("ReadLess") . ''; $out .= '
'; $out .= '
'; } else { - $out .= dolPrintHTML($histo[$key]['message']); + $out .= dolPrintHTML($newmess); } $out .= '
';