NEW allow a ticket to be automatically marked as read when created from backend.

Introduces option TICKET_AUTO_READ_WHEN_CREATED_FROM_BACKEND
This commit is contained in:
Thomas Negre 2022-01-19 15:38:43 +01:00
parent 9276224422
commit e9526654fe

7
htdocs/ticket/card.php Normal file → Executable file
View File

@ -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);