From 330247ac38ee20469ba7e7325c93b40dd01dbd6e Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Wed, 17 Nov 2021 12:08:25 +0100 Subject: [PATCH] add author as contact --- htdocs/ticket/class/ticket.class.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 43bb2cd5835..96df01800c2 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -479,6 +479,13 @@ class Ticket extends CommonObject $this->errors[] = "Error ".$this->db->lasterror(); } + if (!$error && ! empty($conf->global->TICKET_ADD_AUTHOR_AS_CONTACT)) { + // add creator as contributor + if ($this->add_contact($user->id, 'CONTRIBUTOR', 'internal') < 0) { + $error++; + } + } + if (!$error) { $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."ticket");