From 04f6f50f28eca172aa9f148860cfc99cb64a4b17 Mon Sep 17 00:00:00 2001 From: tp_dhu Date: Sat, 10 May 2025 08:53:56 +0100 Subject: [PATCH] added ticket assignment --- app/models/Ticket.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/models/Ticket.php b/app/models/Ticket.php index 4f6ff88..25302a0 100644 --- a/app/models/Ticket.php +++ b/app/models/Ticket.php @@ -103,8 +103,18 @@ class Ticket extends \DB\SQL\Mapper { if(isset($data['priority_id'])) { $this->priority_id = $data['priority_id']; } if(isset($data['status_id'])) { $this->status_id = $data['status_id']; } if(isset($data['updated_by'])) { $this->updated_by = $data['updated_by']; } + if(isset($data['assigned_to'])) { + if($data['assigned_to'] == '-1'){ + $this->assigned_to = null; + } else { + $this->assigned_to = $data['assigned_to']; + } + } $this->created_at = ($data['created_at'] == '' ? date('Y-m-d H:i:s') : $data['created_at']) ?? date('Y-m-d H:i:s'); $this->updated_at = date('Y-m-d H:i:s'); + + // printf('
%s
', print_r($this,1)); exit(); + $this->save(); }