A free open source IT asset/license management system
Switch to API for requested items
snipe5d8320ee0a1e
diff --git a/resources/views/hardware/requested.blade.php b/resources/views/hardware/requested.blade.phpindex ea565f57f0..7848cfdecc 100644--- a/resources/views/hardware/requested.blade.php+++ b/resources/views/hardware/requested.blade.php@@ -12,135 +12,37 @@{{-- Page content --}}@section('content')--<div class="row"><!-- .row -->- <div class="col-md-12"><!-- .col-md-12 -->- <div class="box box-default"><!-- .box -->- <div class="box-body"><!-- .bow-body -->- <div class="row"><!-- .row -->- <div class="col-md-12"><!-- col-md-12 -->-- <table- data-toolbar="#toolbar"- class="table table-striped snipe-table"- id="requestedAssets"- data-id-table="requestedAssets"- data-cookie-id-table="requestedAssets"- data-export-options='{- "fileName": "export-assetrequests-{{ date('Y-m-d') }}",- "ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]- }'>- <thead>- <tr role="row">- <th scope="col" class="col-md-1">{{ trans('general.image') }}</th>- <th scope="col" class="col-md-2">{{ trans('general.name') }}</th>- <th scope="col" class="col-md-2" data-sortable="true">{{ trans('admin/hardware/table.location') }}</th>- <th scope="col" class="col-md-2" data-sortable="true">{{ trans('admin/hardware/form.expected_checkin') }}</th>- <th scope="col" class="col-md-3" data-sortable="true">{{ trans('admin/hardware/table.requesting_user') }}</th>- <th scope="col" class="col-md-2">{{ trans('admin/hardware/table.requested_date') }}</th>- <th scope="col" class="col-md-1">{{ trans('button.actions') }}</th>- <th scope="col" class="col-md-1">{{ trans('general.checkout') }}</th>- </tr>- </thead>- <tbody>- @foreach ($requestedItems as $request)-- @if ($request->requestable)- <tr>- {{ csrf_field() }}- <td>- @if (($request->itemType() == "asset") && ($request->requestable))- <a href="{{ $request->requestable->getImageUrl() }}" data-toggle="lightbox" data-type="image"><img src="{{ $request->requestable->getImageUrl() }}" style="max-height: {{ $snipeSettings->thumbnail_max_h }}px; width: auto;" class="img-responsive" alt="{{ $request->requestable->name }}"></a>- @elseif (($request->itemType() == "asset_model") && ($request->requestable))- <a href="{{ Storage::disk('public')->url(app('models_upload_path') . $request->requestable->image) }}" data-toggle="lightbox" data-type="image"><img src="{{ Storage::disk('public')->url(app('models_upload_path') . $request->requestable->image) }}" style="max-height: {{ $snipeSettings->thumbnail_max_h }}px; width: auto;" class="img-responsive" alt="{{ $request->requestable->name }}"></a>- @elseif (($request->itemType() == "accessory") && ($request->requestable) && ($request->requestable->getImageUrl()))- <a href="{{ $request->requestable->getImageUrl() }}" data-toggle="lightbox" data-type="image"><img src="{{ $request->requestable->getImageUrl() }}" style="max-height: {{ $snipeSettings->thumbnail_max_h }}px; width: auto;" class="img-responsive" alt="{{ $request->requestable->name }}"></a>- @endif- </td>- <td>-- @if ($request->itemType() == "asset")- <a href="{{ config('app.url') }}/hardware/{{ $request->requestable->id }}">- {{ $request->name() }}- </a>- @elseif ($request->itemType() == "asset_model")- <a href="{{ config('app.url') }}/models/{{ $request->requestable->id }}">- {{ $request->name() }}- </a>- @elseif ($request->itemType() == "accessory")- <a href="{{ config('app.url') }}/accessories/{{ $request->requestable->id }}">- {{ $request->name() }}- </a>- @endif-- </td>- <td>- {{ $request->location() ? $request->location()->name : '' }}- </td>-- <td>- @if ($request->itemType() == "asset")- {{ App\Helpers\Helper::getFormattedDateObject($request->requestable->expected_checkin, 'datetime', false) }}- @endif- </td>- <td>- @if ($request->requestingUser() && !$request->requestingUser()->trashed())- <a href="{{ config('app.url') }}/users/{{ $request->requestingUser()->id }}">- {{ $request->requestingUser()->display_name }}- </a>- @else- {{ trans('admin/reports/general.deleted_user') }}- @endif- </td>- <td>- {{ App\Helpers\Helper::getFormattedDateObject($request->created_at, 'datetime', false) }}- </td>- <td>- <form- method="POST"- action="{{ route('account/request-item', [- $request->itemType(),- $request->requestable->id,- true,- $request->requestingUser()?->id- ]) }}"- accept-charset="UTF-8"- >- @csrf- <button class="btn btn-warning btn-sm" data-tooltip="true" title="{{ trans('general.cancel_request') }}">{{ trans('button.cancel') }}</button>- </form>- </td>- <td>- @if ($request->itemType() == "asset")- @if ($request->requestable->assigned_to=='')- <a href="{{ config('app.url') }}/hardware/{{ $request->requestable->id }}/checkout" class="btn btn-sm bg-maroon" data-tooltip="true" title="{{ trans('general.checkout_user_tooltip') }}">{{ trans('general.checkout') }}</a>- @else- <a href="{{ config('app.url') }}/hardware/{{ $request->requestable->id }}/checkin" class="btn btn-sm bg-purple" data-tooltip="true" title="{{ trans('general.checkin_tooltip') }}">{{ trans('general.checkin') }}</a>- @endif- @elseif ($request->itemType() == "accessory")- <a href="{{ config('app.url') }}/accessories/{{ $request->requestable->id }}/checkout" class="btn btn-sm bg-maroon" data-tooltip="true" title="{{ trans('general.checkout_user_tooltip') }}">{{ trans('general.checkout') }}</a>- @endif- </td>-- </tr>- @endif- @endforeach- </tbody>- </table>-- </div> <!-- /.col-md-12 -->- </div> <!-- /.row -->- </div><!-- /.box-body -->- </div><!-- /.box -->- </div> <!-- .col-md-12 -->-</div> <!-- .row -->+ <x-container>+ <x-box name="checkoutRequests">+ <x-slot:table_header>+ {{ trans('admin/hardware/general.requested') }}+ </x-slot:table_header>++ <x-slot:bulkactions>+ <x-table.bulk-checkoutrequests/>+ </x-slot:bulkactions>++ <x-table+ name="checkoutRequests"+ :presenter="\App\Presenters\CheckoutRequestPresenter::dataTableLayout()"+ :api_url="route('api.requests.index')"+ :sort_field="null"+ :fixed_right_number="1"+ :show_search="true"+ export_filename="export-requests-{{ date('Y-m-d') }}"+ />+ </x-box>+ <x-shiftclick/>+ </x-container>++ {{-- Shared adjust-quantity modal, opened by the Adjust Quantity+ button on each request row (see the replenish branch of+ checkoutRequestActionsFormatter). Snipeit.js binds to+ .adjust-quantity and hydrates the modal from the button's+ data-* attrs. --}}+ <x-modals.adjust-quantity />@stop@section('moar_scripts')- @include ('partials.bootstrap-table', [- 'exportFile' => 'requested-export',- 'search' => true,- 'clientSearch' => true,- ])-+ @include ('partials.bootstrap-table')@stop