From 85f95e86b727b02944777780c7080ee473d864aa Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 7 Jun 2022 14:39:19 +0200 Subject: [PATCH] fix: 21139 --- htdocs/ticket/contact.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/htdocs/ticket/contact.php b/htdocs/ticket/contact.php index 89822df2676..ee76045ffec 100644 --- a/htdocs/ticket/contact.php +++ b/htdocs/ticket/contact.php @@ -137,6 +137,16 @@ if ($action == 'swapstatut' && $user->rights->ticket->write) { // Efface un contact if ($action == 'deletecontact' && $user->rights->ticket->write) { if ($object->fetch($id, '', $track_id)) { + $internal_contacts = $object->listeContact(-1, 'internal', 0, 'SUPPORTTEC'); + foreach ($internal_contacts as $key => $contact) { + if ($contact['rowid'] == $lineid && $object->fk_user_assign==$contact['id']) { + $ret = $object->assignUser($user, null); + if ($ret < 0) { + $error ++; + setEventMessages($object->error, $object->errors, 'errors'); + } + } + } $result = $object->delete_contact($lineid); if ($result >= 0) {