2016-03-25 01:18:05 -07:00
|
|
|
@extends('layouts/default')
|
|
|
|
|
|
|
|
@section('title0')
|
|
|
|
{{ trans('admin/hardware/general.requestable') }}
|
|
|
|
{{ trans('general.assets') }}
|
|
|
|
@stop
|
|
|
|
|
|
|
|
{{-- Page title --}}
|
|
|
|
@section('title')
|
|
|
|
@yield('title0') @parent
|
|
|
|
@stop
|
|
|
|
|
|
|
|
{{-- Page content --}}
|
|
|
|
@section('content')
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-12">
|
|
|
|
|
2016-09-15 19:58:27 -07:00
|
|
|
<div class="nav-tabs-custom">
|
|
|
|
<ul class="nav nav-tabs">
|
|
|
|
<li class="active">
|
2022-01-12 23:17:54 -08:00
|
|
|
<a href="#assets" data-toggle="tab" title="{{ trans('general.assets') }}">{{ trans('general.assets') }}
|
|
|
|
<badge class="badge badge-secondary"> {{ $assets->count()}}</badge>
|
2022-01-12 23:18:39 -08:00
|
|
|
</a>
|
2016-09-15 19:58:27 -07:00
|
|
|
</li>
|
|
|
|
<li>
|
2022-01-12 23:17:54 -08:00
|
|
|
<a href="#models" data-toggle="tab" title="{{ trans('general.asset_models') }}">{{ trans('general.asset_models') }}
|
|
|
|
<badge class="badge badge-secondary"> {{ $models->count()}}</badge>
|
2022-01-12 23:18:39 -08:00
|
|
|
</a>
|
2016-09-15 19:58:27 -07:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<div class="tab-content">
|
|
|
|
<div class="tab-pane fade in active" id="assets">
|
2017-10-25 20:07:10 -07:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-12">
|
|
|
|
<div class="table-responsive">
|
2017-11-02 04:17:14 -07:00
|
|
|
<table
|
2018-04-04 17:33:02 -07:00
|
|
|
data-click-to-select="true"
|
|
|
|
data-cookie-id-table="requestableAssetsListingTable"
|
|
|
|
data-pagination="true"
|
|
|
|
data-id-table="requestableAssetsListingTable"
|
|
|
|
data-search="true"
|
|
|
|
data-side-pagination="server"
|
|
|
|
data-show-columns="true"
|
|
|
|
data-show-export="false"
|
|
|
|
data-show-footer="false"
|
|
|
|
data-show-refresh="true"
|
|
|
|
data-sort-order="asc"
|
|
|
|
data-sort-name="name"
|
|
|
|
data-toolbar="#toolbar"
|
|
|
|
id="assetsListingTable"
|
|
|
|
class="table table-striped snipe-table"
|
|
|
|
data-url="{{ route('api.assets.requestable', ['requestable' => true]) }}">
|
2017-10-25 20:07:10 -07:00
|
|
|
|
2018-04-04 17:33:02 -07:00
|
|
|
<thead>
|
2017-10-25 20:07:10 -07:00
|
|
|
<tr>
|
2018-04-04 17:33:02 -07:00
|
|
|
<th class="col-md-1" data-field="image" data-formatter="imageFormatter" data-sortable="true">{{ trans('general.image') }}</th>
|
|
|
|
<th class="col-md-2" data-field="model" data-sortable="true">{{ trans('admin/hardware/table.asset_model') }}</th>
|
|
|
|
<th class="col-md-2" data-field="model_number" data-sortable="true">{{ trans('admin/models/table.modelnumber') }}</th>
|
|
|
|
<th class="col-md-2" data-field="name" data-sortable="true">{{ trans('admin/hardware/form.name') }}</th>
|
|
|
|
<th class="col-md-3" data-field="serial" data-sortable="true">{{ trans('admin/hardware/table.serial') }}</th>
|
|
|
|
<th class="col-md-2" data-field="location" data-sortable="true">{{ trans('admin/hardware/table.location') }}</th>
|
|
|
|
<th class="col-md-2" data-field="status" data-sortable="true">{{ trans('admin/hardware/table.status') }}</th>
|
|
|
|
<th class="col-md-2" data-field="expected_checkin" data-formatter="dateDisplayFormatter" data-sortable="true">{{ trans('admin/hardware/form.expected_checkin') }}</th>
|
|
|
|
<th class="col-md-1" data-formatter="assetRequestActionsFormatter" data-field="actions" data-sortable="false">{{ trans('table.actions') }}</th>
|
2017-10-25 20:07:10 -07:00
|
|
|
</tr>
|
2018-04-04 17:33:02 -07:00
|
|
|
</thead>
|
2017-10-25 20:07:10 -07:00
|
|
|
</table>
|
|
|
|
</div>
|
2016-09-15 19:58:27 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
2017-10-25 20:07:10 -07:00
|
|
|
</div>
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2016-09-15 19:58:27 -07:00
|
|
|
<div class="tab-pane fade" id="models">
|
2017-10-25 20:07:10 -07:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-12">
|
|
|
|
|
|
|
|
@if ($models->count() > 0)
|
2021-11-02 02:13:22 -07:00
|
|
|
<h2>{{ trans('general.requestable_models') }}</h4>
|
2017-11-02 04:17:14 -07:00
|
|
|
<table
|
|
|
|
name="requested-assets"
|
|
|
|
data-toolbar="#toolbar"
|
|
|
|
class="table table-striped snipe-table"
|
|
|
|
id="table"
|
|
|
|
data-advanced-search="true"
|
|
|
|
data-id-table="advancedTable"
|
|
|
|
data-cookie-id-table="requestableAssets">
|
2017-10-25 20:07:10 -07:00
|
|
|
<thead>
|
|
|
|
<tr role="row">
|
2017-11-02 04:17:14 -07:00
|
|
|
<th class="col-md-1" data-sortable="true">{{ trans('general.image') }}</th>
|
|
|
|
<th class="col-md-6" data-sortable="true">{{ trans('admin/hardware/table.asset_model') }}</th>
|
|
|
|
<th class="col-md-3" data-sortable="true">{{ trans('admin/accessories/general.remaining') }}</th>
|
2017-12-19 20:48:26 -08:00
|
|
|
|
|
|
|
<th class="col-md-2 actions" data-sortable="false">{{ trans('table.actions') }}</th>
|
2017-10-25 20:07:10 -07:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
@foreach($models as $requestableModel)
|
|
|
|
<tr>
|
2017-12-19 20:48:26 -08:00
|
|
|
|
2017-11-02 04:17:14 -07:00
|
|
|
<td>
|
2017-12-19 20:48:26 -08:00
|
|
|
|
2017-11-02 04:17:14 -07:00
|
|
|
@if ($requestableModel->image)
|
|
|
|
<a href="{{ url('/') }}/uploads/models/{{ $requestableModel->image }}" data-toggle="lightbox" data-type="image">
|
|
|
|
<img src="{{ url('/') }}/uploads/models/{{ $requestableModel->image }}" style="max-height: {{ $snipeSettings->thumbnail_max_h }}px; width: auto;" class="img-responsive">
|
|
|
|
</a>
|
|
|
|
@endif
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
2022-05-24 12:40:32 -07:00
|
|
|
<td>
|
|
|
|
@if (Gate::allows('superadmin'))
|
|
|
|
<a href='{{ url("/models/{$requestableModel->id}") }}' > {{ $requestableModel->name }} </a></td>
|
|
|
|
@else
|
|
|
|
{{ $requestableModel->name }}
|
|
|
|
@endif
|
|
|
|
</td>
|
|
|
|
|
2017-10-25 20:07:10 -07:00
|
|
|
<td>{{$requestableModel->assets->where('requestable', '1')->count()}}</td>
|
2017-12-19 20:48:26 -08:00
|
|
|
|
2017-10-25 20:07:10 -07:00
|
|
|
<td>
|
2017-12-19 20:48:26 -08:00
|
|
|
<form action="{{route('account/request-item', ['itemType' => 'asset_model', 'itemId' => $requestableModel->id])}}" method="POST" accept-charset="utf-8">
|
|
|
|
{{ csrf_field() }}
|
|
|
|
<input type="text" style="width: 70px; margin-right: 10px;" class="form-control pull-left" name="request-quantity" value="" placeholder="{{ trans('general.qty') }}">
|
2017-10-25 20:07:10 -07:00
|
|
|
@if ($requestableModel->isRequestedBy(Auth::user()))
|
2017-12-19 20:48:26 -08:00
|
|
|
{{ Form::submit(trans('button.cancel'), ['class' => 'btn btn-danger btn-sm'])}}
|
2017-10-25 20:07:10 -07:00
|
|
|
@else
|
2017-12-19 20:48:26 -08:00
|
|
|
{{ Form::submit(trans('button.request'), ['class' => 'btn btn-primary btn-sm'])}}
|
2017-10-25 20:07:10 -07:00
|
|
|
@endif
|
2017-12-19 20:48:26 -08:00
|
|
|
</form>
|
2017-10-25 20:07:10 -07:00
|
|
|
</td>
|
|
|
|
</tr>
|
2017-12-19 20:48:26 -08:00
|
|
|
|
2017-10-25 20:07:10 -07:00
|
|
|
@endforeach
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
@else
|
|
|
|
<div class="alert alert-info alert-block">
|
2021-09-26 01:11:08 -07:00
|
|
|
<i class="fas fa-info-circle"></i>
|
2017-10-25 20:07:10 -07:00
|
|
|
{{ trans('general.no_results') }}
|
|
|
|
</div>
|
|
|
|
@endif
|
2016-09-15 19:58:27 -07:00
|
|
|
</div>
|
2016-03-25 01:18:05 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2016-09-15 19:58:27 -07:00
|
|
|
</div> <!-- .tab-content-->
|
|
|
|
</div> <!-- .nav-tabs-custom -->
|
|
|
|
</div> <!-- .col-md-12> -->
|
|
|
|
</div> <!-- .row -->
|
2016-12-27 12:03:47 -08:00
|
|
|
@stop
|
2016-03-25 01:18:05 -07:00
|
|
|
|
|
|
|
|
2016-09-15 19:58:27 -07:00
|
|
|
@section('moar_scripts')
|
2017-11-02 04:17:14 -07:00
|
|
|
@include ('partials.bootstrap-table', [
|
|
|
|
'exportFile' => 'requested-export',
|
|
|
|
'search' => true,
|
|
|
|
'clientSearch' => true,
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
<script nonce="{{ csrf_token() }}">
|
2016-09-15 19:58:27 -07:00
|
|
|
|
|
|
|
$( "a[name='Request']").click(function(event) {
|
|
|
|
// event.preventDefault();
|
|
|
|
quantity = $(this).closest('td').siblings().find('input').val();
|
|
|
|
currentUrl = $(this).attr('href');
|
|
|
|
// $(this).attr('href', currentUrl + '?quantity=' + quantity);
|
|
|
|
// alert($(this).attr('href'));
|
|
|
|
});
|
|
|
|
</script>
|
2016-03-25 01:18:05 -07:00
|
|
|
@stop
|
2017-11-02 04:17:14 -07:00
|
|
|
|
|
|
|
|