enable editing created_at on ticket
This commit is contained in:
parent
53bce00c65
commit
164692a728
@ -58,6 +58,7 @@ class TicketController extends BaseController implements CRUD {
|
|||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'title' => $this->f3->get('POST.title'),
|
'title' => $this->f3->get('POST.title'),
|
||||||
|
'created_at' => $this->f3->get('POST.created_at'),
|
||||||
'description' => $this->f3->get('POST.description'),
|
'description' => $this->f3->get('POST.description'),
|
||||||
'priority' => $this->f3->get('POST.priority'),
|
'priority' => $this->f3->get('POST.priority'),
|
||||||
'status' => $this->f3->get('POST.status'),
|
'status' => $this->f3->get('POST.status'),
|
||||||
@ -115,6 +116,7 @@ class TicketController extends BaseController implements CRUD {
|
|||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'title' => $this->f3->get('POST.title'),
|
'title' => $this->f3->get('POST.title'),
|
||||||
|
'created_at' => $this->f3->get('POST.created_at'),
|
||||||
'description' => $this->f3->get('POST.description'),
|
'description' => $this->f3->get('POST.description'),
|
||||||
'priority' => $this->f3->get('POST.priority'),
|
'priority' => $this->f3->get('POST.priority'),
|
||||||
'status' => $this->f3->get('POST.status'),
|
'status' => $this->f3->get('POST.status'),
|
||||||
|
|||||||
@ -33,7 +33,7 @@ class Ticket extends \DB\SQL\Mapper {
|
|||||||
$this->priority = $data['priority'] ?? 'Low';
|
$this->priority = $data['priority'] ?? 'Low';
|
||||||
$this->status = $data['status'] ?? 'New';
|
$this->status = $data['status'] ?? 'New';
|
||||||
$this->created_by = $data['created_by'] ?? null;
|
$this->created_by = $data['created_by'] ?? null;
|
||||||
$this->created_at = date('Y-m-d H:i:s');
|
$this->created_at = $data['created_at'] ?? date('Y-m-d H:i:s');
|
||||||
$this->updated_at = date('Y-m-d H:i:s');
|
$this->updated_at = date('Y-m-d H:i:s');
|
||||||
|
|
||||||
$this->save();
|
$this->save();
|
||||||
@ -43,10 +43,11 @@ class Ticket extends \DB\SQL\Mapper {
|
|||||||
public function updateTicket(array $data): void
|
public function updateTicket(array $data): void
|
||||||
{
|
{
|
||||||
if(isset($data['title'])){ $this->title = $data['title']; }
|
if(isset($data['title'])){ $this->title = $data['title']; }
|
||||||
if(isset($data['description'])) { $this->descrtipion = $data['description']; }
|
if(isset($data['description'])) { $this->description = $data['description']; }
|
||||||
if(isset($data['priority'])) { $this->priority = $data['priority']; }
|
if(isset($data['priority'])) { $this->priority = $data['priority']; }
|
||||||
if(isset($data['status'])) { $this->status = $data['status']; }
|
if(isset($data['status'])) { $this->status = $data['status']; }
|
||||||
if(isset($data['updated_by'])) { $this->status = $data['updated_by']; }
|
if(isset($data['updated_by'])) { $this->updated_by = $data['updated_by']; }
|
||||||
|
$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');
|
$this->updated_at = date('Y-m-d H:i:s');
|
||||||
$this->save();
|
$this->save();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user