Ticket Tweaks

This commit is contained in:
1day2die 2023-02-01 10:06:15 +01:00
parent 4351c8b678
commit 57577c95b4
3 changed files with 19 additions and 17 deletions

View file

@ -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 '

View file

@ -46,14 +46,14 @@
</div>
@if ($servers->count() >= 1)
<div class="form-group col-sm-12 {{ $errors->has('server') ? ' has-error' : '' }}">
<label for="server" class="control-label">Servers</label>
<label for="server" class="control-label">{{__("Server")}}</label>
<select id="server" type="server" class="form-control" name="server">
<option value="">Select Servers</option>
<option value="">{{__("Select Servers")}}</option>
@foreach ($servers as $server)
<option value="{{ $server->id }}">{{ $server->name }}</option>
@endforeach
</select>
@if ($errors->has('category'))
<span class="help-block">
<strong>{{ $errors->first('ticketcategory') }}</strong>
@ -62,14 +62,14 @@
</div>
@endif
<div class="form-group col-sm-12 {{ $errors->has('ticketcategory') ? ' has-error' : '' }}">
<label for="ticketcategory" class="control-label">Category</label>
<select id="ticketcategory" type="ticketcategory" class="form-control" name="ticketcategory">
<option value="">Select Category</option>
<label for="ticketcategory" class="control-label">{{__("Category")}}</label>
<select id="ticketcategory" type="ticketcategory" class="form-control" required name="ticketcategory">
<option value="" disabled selected>{{__("Select Category")}}</option>
@foreach ($ticketcategories as $ticketcategory)
<option value="{{ $ticketcategory->id }}">{{ $ticketcategory->name }}</option>
@endforeach
</select>
@if ($errors->has('category'))
<span class="help-block">
<strong>{{ $errors->first('ticketcategory') }}</strong>
@ -79,10 +79,10 @@
<div class="form-group col-sm-12 {{ $errors->has('priority') ? ' has-error' : '' }}">
<label for="priority" class="control-label">Priority</label>
<select id="priority" type="" class="form-control" name="priority">
<option value="">Select Priority</option>
<option value="Low">Low</option>
<option value="Medium">Medium</option>
<option value="High">High</option>
<option value="" disabled selected>{{__("Select Priority")}}</option>
<option value="Low">{{__("Low")}}</option>
<option value="Medium">{{__("Medium")}}</option>
<option value="High">{{__("High")}}</option>
</select>
@if ($errors->has('priority'))
<span class="help-block">
@ -124,12 +124,12 @@
</section>
<!-- END CONTENT -->
<script type="text/javascript">
$(".ticket-form").submit(function (e) {
$(".ticket-once").attr("disabled", true);
$(".ticket-form").submit(function (e) {
$(".ticket-once").attr("disabled", true);
return true;
})
</script>
@endsection

View file

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