Fix #25416 :the email subject is not replaced when an email template… (#25534)

* Fix #25416 :the email subject is not replaced when an email template is applied in tickets

* Update html.formticket.class.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
onhairech 2023-08-02 00:02:53 +02:00 committed by GitHub
parent 49e63e1d38
commit 84243dc5e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1477,10 +1477,20 @@ class FormTicket
print '<input type="submit" class="button" value="'.$langs->trans('Apply').'" name="modelselected" id="modelselected">';
print '</div></td>';
}
// Subject
// Subject/topic
$topic = "";
foreach( $formmail->lines_model as $line){
if ($this->param['models_id'] == $line->id){
$topic = $line->topic;
break;
}
}
print '<tr class="email_line"><td>'.$langs->trans('Subject').'</td>';
print '<td><input type="text" class="text minwidth500" name="subject" value="['.getDolGlobalString('MAIN_INFO_SOCIETE_NOM').' - '.$langs->trans("Ticket").' '.$ticketstat->ref.'] '.$langs->trans('TicketNewMessage').'" />';
if (empty($topic)) {
print '<td><input type="text" class="text minwidth500" name="subject" value="['.getDolGlobalString('MAIN_INFO_SOCIETE_NOM').' - '.$langs->trans("Ticket").' '.$ticketstat->ref.'] '.$langs->trans('TicketNewMessage').'" />';
} else {
print '<td><input type="text" class="text minwidth500" name="subject" value="['.getDolGlobalString('MAIN_INFO_SOCIETE_NOM').' - '.$langs->trans("Ticket").' '.$ticketstat->ref.'] '.$topic.'" />';
}
print '</td></tr>';
// Recipients / adressed-to