From 57577c95b44d66d96fedeaff1beff9eaa19f5a71 Mon Sep 17 00:00:00 2001 From: 1day2die Date: Wed, 1 Feb 2023 10:06:15 +0100 Subject: [PATCH] Ticket Tweaks --- app/Http/Controllers/TicketsController.php | 3 +- themes/default/views/ticket/create.blade.php | 30 ++++++++++---------- themes/default/views/ticket/index.blade.php | 3 +- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/app/Http/Controllers/TicketsController.php b/app/Http/Controllers/TicketsController.php index cf86ea43..2477d729 100644 --- a/app/Http/Controllers/TicketsController.php +++ b/app/Http/Controllers/TicketsController.php @@ -145,7 +145,8 @@ class TicketsController extends Controller return __($tickets->priority); }) ->editColumn('updated_at', function (Ticket $tickets) { - return $tickets->updated_at ? $tickets->updated_at->diffForHumans() : ''; + return ['display' => $tickets->updated_at ? $tickets->updated_at->diffForHumans() : '', + 'raw' => $tickets->updated_at ? strtotime($tickets->updated_at) : '']; }) ->addColumn('actions', function (Ticket $tickets) { return ' diff --git a/themes/default/views/ticket/create.blade.php b/themes/default/views/ticket/create.blade.php index 138ce836..c8e5756a 100644 --- a/themes/default/views/ticket/create.blade.php +++ b/themes/default/views/ticket/create.blade.php @@ -46,14 +46,14 @@ @if ($servers->count() >= 1)
- + - + @if ($errors->has('category')) {{ $errors->first('ticketcategory') }} @@ -62,14 +62,14 @@
@endif
- - + @foreach ($ticketcategories as $ticketcategory) @endforeach - + @if ($errors->has('category')) {{ $errors->first('ticketcategory') }} @@ -79,10 +79,10 @@
@if ($errors->has('priority')) @@ -124,12 +124,12 @@ @endsection diff --git a/themes/default/views/ticket/index.blade.php b/themes/default/views/ticket/index.blade.php index b4a0a9a6..b23048e8 100644 --- a/themes/default/views/ticket/index.blade.php +++ b/themes/default/views/ticket/index.blade.php @@ -86,12 +86,13 @@ serverSide: true, stateSave: true, ajax: "{{route('ticket.datatable')}}", + order: [[ 4, "desc" ]], columns: [ {data: 'category'}, {data: 'title'}, {data: 'priority'}, {data: 'status'}, - {data: 'updated_at', sortable: false}, + {data: 'updated_at', type: 'num', render: {_: 'display', sort: 'raw'}}, {data: 'actions', sortable: false}, ], fnDrawCallback: function( oSettings ) {