From e9526654feec4c21bdc1f37faf8614289e128b90 Mon Sep 17 00:00:00 2001 From: Thomas Negre Date: Wed, 19 Jan 2022 15:38:43 +0100 Subject: [PATCH] NEW allow a ticket to be automatically marked as read when created from backend. Introduces option TICKET_AUTO_READ_WHEN_CREATED_FROM_BACKEND --- htdocs/ticket/card.php | 7 +++++++ 1 file changed, 7 insertions(+) mode change 100644 => 100755 htdocs/ticket/card.php diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php old mode 100644 new mode 100755 index cf665e8a470..ecab3d4a59b --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -243,6 +243,13 @@ if (empty($reshook)) { $object->setProject($projectid); } + // Auto mark as read if created from backend + if (!empty($conf->global->TICKET_AUTO_READ_WHEN_CREATED_FROM_BACKEND) && $user->rights->ticket->write) { + if ( ! $object->markAsRead($user) > 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } + } + // Auto assign user if (!empty($conf->global->TICKET_AUTO_ASSIGN_USER_CREATE)) { $result = $object->assignUser($user, $user->id, 1);