From e4ed4b83074d559b747451e472cd17b18528da03 Mon Sep 17 00:00:00 2001 From: Thomas Negre Date: Mon, 28 Feb 2022 15:10:59 +0100 Subject: [PATCH] Ticket card: enhance closing modal to allow chosing contacts to notify --- htdocs/ticket/card.php | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index f1d33f4eeb0..17a07e6af4c 100755 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -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 '
'; + $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') {