From 6d2e5c18457bb00f07253b90068e913d1e89fed9 Mon Sep 17 00:00:00 2001 From: atm-nicolasV Date: Fri, 13 Mar 2026 16:36:44 +0100 Subject: [PATCH 1/2] NEW : Add complete_substitutions_array in ticket.class.php --- ChangeLogAtm.md | 1 + htdocs/theme/eldy/global.inc.php | 36 ++++++++++++++-------------- htdocs/ticket/class/ticket.class.php | 35 ++++++++++++++++++--------- 3 files changed, 43 insertions(+), 29 deletions(-) diff --git a/ChangeLogAtm.md b/ChangeLogAtm.md index cdc9e7c3f2d8c..1167bb3bc4ec2 100644 --- a/ChangeLogAtm.md +++ b/ChangeLogAtm.md @@ -1,3 +1,4 @@ +- NEW : Add complete_substitutions_array in ticket.class.php - *2026-02-20* - FIX : DA027856 - Edition des extrafields "always editable" sur les projets avec une tache ouverte en bas de page. - FIX : DA027490 - BACKPORT 37132 - Date sur les temps passés sur les projets était erronée. - FIX : DA027053 - Update tms on delete propalLine if propalLine is a product with a price of 0 or if product is not include. diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index c5b8a5cf75040..49d1085a9814a 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -7421,28 +7421,28 @@ } /* ------------ */ /* Prevents the table cell from stretching indefinitely */ -.fichehalfleft table.tableforfield td:last-child { - max-width: 0 !important; - width: 100% !important; -} +//.fichehalfleft table.tableforfield td:last-child { +// max-width: 0 !important; +// width: 100% !important; +//} /* Switches the container to flex layout to force tags to wrap */ -ul.select2-choices-dolibarr { - display: flex !important; - flex-wrap: wrap !important; - gap: 4px !important; - padding: 2px !important; -} +//ul.select2-choices-dolibarr { +// display: flex !important; +// flex-wrap: wrap !important; +// gap: 4px !important; +// padding: 2px !important; +//} /* Breaks very long tag text so it wraps to the next line */ -li.select2-search-choice-dolibarr { - float: none !important; /* Overrides the default float behavior of the Eldy theme */ - display: block !important; - white-space: normal !important; - word-wrap: break-word !important; - max-width: 100% !important; - margin: 0 !important; -} +//li.select2-search-choice-dolibarr { +// float: none !important; /* Overrides the default float behavior of the Eldy theme */ +// display: block !important; +// white-space: normal !important; +// word-wrap: break-word !important; +// max-width: 100% !important; +// margin: 0 !important; +//} /* ------------ */ span.select2-dropdown--below { margin-top: -1px; diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 7da75d1be8494..69bfa6c015fb4 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -2851,8 +2851,9 @@ public function newMessage($user, &$action, $private = 1, $public_area = 0) $message_intro = $langs->trans('TicketNotificationEmailBody', "#".$object->id); $message_signature = GETPOST('mail_signature') ? GETPOST('mail_signature') : getDolGlobalString('TICKET_MESSAGE_MAIL_SIGNATURE'); - - $message = getDolGlobalString('TICKET_MESSAGE_MAIL_INTRO', $langs->trans('TicketMessageMailIntroText')); + /**SPECIFIQUE ATM **/ + $message = $this->applyMailSubstitutions(getDolGlobalString('TICKET_MESSAGE_MAIL_INTRO', $langs->trans('TicketMessageMailIntroText')), $langs, $object); + /**SPECIFIQUE ATM **/ $message .= '

'; $messagePost = GETPOST('message', 'restricthtml'); if (!dol_textishtml($messagePost)) { @@ -2933,9 +2934,10 @@ public function newMessage($user, &$action, $private = 1, $public_area = 0) $appli = getDolGlobalString('MAIN_APPLICATION_TITLE', $mysoc->name); $subject = GETPOST('subject') ? GETPOST('subject') : '['.$appli.' - '.$langs->trans("Ticket").' #'.$object->track_id.'] '.$langs->trans('TicketNewMessage'); - - $message_intro = GETPOST('mail_intro') ? GETPOST('mail_intro', 'restricthtml') : getDolGlobalString('TICKET_MESSAGE_MAIL_INTRO'); - $message_signature = GETPOST('mail_signature') ? GETPOST('mail_signature', 'restricthtml') : getDolGlobalString('TICKET_MESSAGE_MAIL_SIGNATURE'); + /**SPECIFIQUE ATM **/ + $message_intro = $this->applyMailSubstitutions(GETPOST('mail_intro') ? GETPOST('mail_intro', 'restricthtml') : getDolGlobalString('TICKET_MESSAGE_MAIL_INTRO'), $langs, $object); + $message_signature = $this->applyMailSubstitutions(GETPOST('mail_signature') ? GETPOST('mail_signature', 'restricthtml') : getDolGlobalString('TICKET_MESSAGE_MAIL_SIGNATURE'), $langs, $object); + /**SPECIFIQUE ATM **/ if (!dol_textishtml($message_intro)) { $message_intro = dol_nl2br($message_intro); } @@ -2971,12 +2973,6 @@ public function newMessage($user, &$action, $private = 1, $public_area = 0) // If public interface is not enable, use link to internal page into mail $url_public_ticket = (getDolGlobalInt('TICKET_ENABLE_PUBLIC_INTERFACE') ? (getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE') !== '' ? getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE') . '/view.php' : dol_buildpath('/public/ticket/view.php', 2)) : dol_buildpath('/ticket/card.php', 2)).'?track_id='.urlencode($object->track_id); - /**DEBUT SPECIFIQUE ATM **/ - if (!getDolGlobalString('TICKET_REMOVE_TRACK_URL')) { - $message .= '
' . $langs->trans('TicketNewEmailBodyInfosTrackUrlCustomer') . ' : ' . $object->track_id . '
'; - var_dump($message);exit(); - } - /**FIN SPECIFIQUE ATM **/ // Build final message $message = $message_intro.'

'.$message; @@ -3044,6 +3040,23 @@ public function newMessage($user, &$action, $private = 1, $public_area = 0) } } + /**SPECIFIQUE ATM **/ + /** + * Apply standard substitutions used by ticket email content. + * + * @param string $content Content before substitutions + * @param Translate $langs Translation handler + * @param CommonObject|null $object Object used for substitutions + * @return string + */ + protected function applyMailSubstitutions($content, $langs, $object = null) + { + $substitutionarray = getCommonSubstitutionArray($langs, 0, array(), $object); + complete_substitutions_array($substitutionarray, $langs, $object); + + return make_substitutions($content, $substitutionarray); + } + /**SPECIFIQUE ATM **/ /** * Send ticket by email to linked contacts From 60d3b4da6739d7ef29053afb3bc503e1be1323c8 Mon Sep 17 00:00:00 2001 From: atm-nicolasV Date: Fri, 13 Mar 2026 16:42:46 +0100 Subject: [PATCH 2/2] NEW : Add complete_substitutions_array in ticket.class.php --- htdocs/hrm/class/evaluation.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/hrm/class/evaluation.class.php b/htdocs/hrm/class/evaluation.class.php index 2969446f26d52..9eced1cd6ab33 100644 --- a/htdocs/hrm/class/evaluation.class.php +++ b/htdocs/hrm/class/evaluation.class.php @@ -225,7 +225,7 @@ public function __construct(DoliDB $db) } if (!$user->hasRight('hrm', 'evaluation', 'readall')) { - $this->fields['fk_user']['type'] .= ' AND (t.rowid:IN:'.$this->db->sanitize(implode(",", $user->getAllChildIds(1))) .')'; +$this->fields['fk_user']['type'] .= ':t.rowid:IN:('.$this->db->sanitize(implode(",", $user->getAllChildIds(1))) . ')'; } $this->date_eval = dol_now();