Ticket card: enhance closing modal to allow chosing contacts to notify

This commit is contained in:
Thomas Negre 2022-02-28 15:10:59 +01:00
parent dcc41d0ab7
commit e4ed4b8307

View File

@ -820,10 +820,28 @@ if ($action == 'create' || $action == 'presend') {
// Confirmation close
if ($action == 'close') {
print $form->formconfirm($url_page_current."?track_id=".$object->track_id, $langs->trans("CloseATicket"), $langs->trans("ConfirmCloseAticket"), "confirm_close", '', '', 1);
if ($ret == 'html') {
print '<br>';
$thirdparty_contacts = $object->getInfosTicketExternalContact();
$contacts_select = array(
'-2' => $langs->trans('TicketNotifyAllTiersAtClose'),
'-3' => $langs->trans('TicketNotNotifyTiersAtClose')
);
foreach ($thirdparty_contacts as $thirdparty_contact) {
$contacts_select[$thirdparty_contact['id']] = $thirdparty_contact['civility'] . ' ' . $thirdparty_contact['lastname'] . ' ' . $thirdparty_contact['firstname'];
}
// Default select all or no contact
$default = (!empty($conf->global->TICKET_NOTIFY_AT_CLOSING)) ? -2 : -3;
$formquestion = array(
array(
'name' => 'contactid',
'type' => 'select',
'label' => $langs->trans('NotifyThirdpartyOnTicketClosing'),
'values' => $contacts_select,
'default' => $default
),
);
print $form->formconfirm($url_page_current."?track_id=".$object->track_id, $langs->trans("CloseATicket"), $langs->trans("ConfirmCloseAticket"), "confirm_close", $formquestion, '', 1 );
}
// Confirmation abandon
if ($action == 'abandon') {