A free open source IT asset/license management system
Updated checkout screens to use form components
snipe000c9993d6e5
diff --git a/resources/views/hardware/bulk-checkout.blade.php b/resources/views/hardware/bulk-checkout.blade.phpindex d1c1761332..2b47225436 100644--- a/resources/views/hardware/bulk-checkout.blade.php+++ b/resources/views/hardware/bulk-checkout.blade.php@@ -2,191 +2,174 @@{{-- Page title --}}@section('title')- {{ trans('admin/hardware/general.bulk_checkout') }}-@parent+ {{ trans('admin/hardware/general.bulk_checkout') }}+ @parent@stop{{-- Page content --}}@section('content')-<style>- .input-group {- padding-left: 0px !important;- }-</style>---<div class="row">- <!-- left column -->- <div class="col-md-7">- <div class="box box-default">- <div class="box-header with-border">- <h2 class="box-title"> {{ trans('admin/hardware/form.tag') }} </h2>- </div>- <div class="box-body">- <form class="form-horizontal" method="post" action="" autocomplete="off">- {{ csrf_field() }}-- @if ($removed_assets->isNotEmpty())- <div class="box box-solid box-warning">- <div class="box-header with-border">- <span class="box-title col-xs-12">Warning</span>- </div>- <div class="box-body">- <p>{{ trans('general.assigned_assets_removed') }}</p>- <ul>- @foreach($removed_assets as $removed_asset)- <li>- <a href="{{ route('hardware.show', $removed_asset->id) }}">- {{ $removed_asset->present()->fullName }}- </a>- </li>- @endforeach- </ul>- </div>- </div>- @endif-- @include ('partials.forms.edit.asset-select', [- 'translated_name' => trans('general.assets'),- 'fieldname' => 'selected_assets[]',- 'multiple' => true,- 'required' => true,- 'asset_status_type' => 'RTD',- 'select_id' => 'assigned_assets_select',- 'asset_selector_div_id' => 'assets_to_checkout_div',- 'asset_ids' => old('selected_assets')- ])--- <!-- Status -->- <div class="form-group {{ $errors->has('status_id') ? 'error' : '' }}">- <label for="status_id" class="col-md-3 control-label">- {{ trans('admin/hardware/form.status') }}- </label>- <div class="col-md-7 required">- <x-input.select- name="status_id"- :options="$statusLabel_list"- :selected="old('status_id', $status_id ?? null)"- style="width: 100%;"- aria-label="status_id"- />- <x-form.error name="status_id" />- </div>- </div>-- <div class="form-group {{ $errors->has('set_not_requestable') ? 'error' : '' }}">- <label for="set_not_requestable" class="col-md-3 control-label">- {{ trans('admin/hardware/form.requestable') }}- </label>- <div class="col-md-7">- <x-input.select+ <style>+ .input-group {+ padding-left: 0px !important;+ }+ </style>++ <x-container columns="2">+ <x-page-column class="col-md-7">++ <x-form id="checkout_form" route="{{ url()->current() }}">++ <x-box header="{{ trans('admin/hardware/form.tag') }}">++ @if ($removed_assets->isNotEmpty())+ <x-box box_style="solid box-warning" header="Warning">+ <p>{{ trans('general.assigned_assets_removed') }}</p>+ <ul>+ @foreach ($removed_assets as $removed_asset)+ <li>+ <a href="{{ route('hardware.show', $removed_asset->id) }}">+ {{ $removed_asset->present()->fullName }}+ </a>+ </li>+ @endforeach+ </ul>+ </x-box>+ @endif++ @include ('partials.forms.edit.asset-select', [+ 'translated_name' => trans('general.assets'),+ 'fieldname' => 'selected_assets[]',+ 'multiple' => true,+ 'required' => true,+ 'asset_status_type' => 'RTD',+ 'select_id' => 'assigned_assets_select',+ 'asset_selector_div_id' => 'assets_to_checkout_div',+ 'asset_ids' => old('selected_assets'),+ ])++ <x-form.row+ :label="trans('admin/hardware/form.status')"+ name="status_id"+ >+ <x-slot:input>+ <x-input.select+ name="status_id"+ :options="$statusLabel_list"+ :selected="old('status_id', $status_id ?? null)"+ required+ style="width: 100%;"+ aria-label="status_id"+ />+ </x-slot:input>+ </x-form.row>++ <x-form.row+ :label="trans('admin/hardware/form.requestable')"name="set_not_requestable"- id="set_not_requestable"- :options="[- '' => trans('general.do_not_change'),- '1' => trans('admin/hardware/general.not_requestable'),- ]"- :selected="old('set_not_requestable', '')"- style="width: 100%;"- aria-label="set_not_requestable"- />- <x-form.error name="set_not_requestable" />- </div>- </div>--- <!-- Checkout selector -->--- @include ('partials.forms.checkout-selector', ['user_select' => 'true','asset_select' => 'true', 'location_select' => 'true'])- @include ('partials.forms.edit.user-select', ['translated_name' => trans('general.user'), 'fieldname' => 'assigned_user', 'style' => session('checkout_to_type') == 'user' ? '' : ''])- <!-- We have to pass unselect here so that we don't default to the asset that's being checked out. We want that asset to be pre-selected everywhere else. -->- @include ('partials.forms.edit.asset-select', ['translated_name' => trans('general.asset'), 'asset_selector_div_id' => 'assigned_asset', 'fieldname' => 'assigned_asset', 'unselect' => 'true', 'style' => session('checkout_to_type') == 'asset' ? '' : 'display: none;'])- @include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'assigned_location', 'style' => session('checkout_to_type') == 'location' ? '' : 'display: none;'])-- <!-- Checkout/Checkin Date -->- <div class="form-group {{ $errors->has('checkout_at') ? 'error' : '' }}">- <label for="checkout_at" class="col-sm-3 control-label">- {{ trans('admin/hardware/form.checkout_date') }}- </label>- <div class="col-md-8">- <div class="input-group date col-md-5" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-date-end-date="0d" data-date-clear-btn="true">- <input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="checkout_at" id="checkout_at" value="{{ old('checkout_at') }}">- <span class="input-group-addon"><x-icon type="calendar" /></span>- </div>- <x-form.error name="checkout_at" />- </div>- </div>-- <!-- Expected Checkin Date -->- <div class="form-group {{ $errors->has('expected_checkin') ? 'error' : '' }}">- <label for="expected_checkin" class="col-sm-3 control-label">- {{ trans('admin/hardware/form.expected_checkin') }}- </label>- <div class="col-md-8">- <div class="input-group date col-md-5" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-date-start-date="0d" data-date-clear-btn="true">- <input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="expected_checkin" id="expected_checkin" value="{{ old('expected_checkin') }}">- <span class="input-group-addon"><x-icon type="calendar" /></span>- </div>- <x-form.error name="expected_checkin" />- </div>- </div>--- <!-- Note -->- <div class="form-group {{ $errors->has('note') ? 'error' : '' }}">- <label for="note" class="col-sm-3 control-label">- {{ trans('general.notes') }}- </label>- <div class="col-md-8">- <textarea class="col-md-6 form-control" id="note" name="note">{{ old('note') }}</textarea>- <x-form.error name="note" />- </div>- </div>---- </div> <!--./box-body-->- <div class="box-footer">- <a class="btn btn-link" href="{{ URL::previous() }}"> {{ trans('button.cancel') }}</a>- <button type="submit" class="btn btn-primary pull-right"><x-icon type="checkmark" /> {{ trans('general.checkout') }}</button>- </div>- </div>- </form>- </div> <!--/.col-md-7-->-- <livewire:checkout-target-panel type="assets" />-</div>+ >+ <x-slot:input>+ <x-input.select+ name="set_not_requestable"+ id="set_not_requestable"+ :options="[+ '' => trans('general.do_not_change'),+ '1' => trans('admin/hardware/general.not_requestable'),+ ]"+ :selected="old('set_not_requestable', '')"+ style="width: 100%;"+ aria-label="set_not_requestable"+ />+ </x-slot:input>+ </x-form.row>++ @include ('partials.forms.checkout-selector', ['user_select' => 'true', 'asset_select' => 'true', 'location_select' => 'true'])+ @include ('partials.forms.edit.user-select', ['translated_name' => trans('general.user'), 'fieldname' => 'assigned_user', 'style' => session('checkout_to_type') == 'user' ? '' : ''])+ <!-- unselect keeps the asset being checked out from being pre-selected in this picker -->+ @include ('partials.forms.edit.asset-select', ['translated_name' => trans('general.asset'), 'asset_selector_div_id' => 'assigned_asset', 'fieldname' => 'assigned_asset', 'unselect' => 'true', 'style' => session('checkout_to_type') == 'asset' ? '' : 'display: none;'])+ @include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'assigned_location', 'style' => session('checkout_to_type') == 'location' ? '' : 'display: none;'])++ <x-form.row+ :label="trans('admin/hardware/form.checkout_date')"+ name="checkout_at"+ input_div_class="col-md-4"+ >+ <x-slot:input>+ <x-input.datepicker+ name="checkout_at"+ end_date="0d"+ :value="old('checkout_at')"+ :placeholder="trans('general.select_date')"+ />+ </x-slot:input>+ </x-form.row>++ <x-form.row+ :label="trans('admin/hardware/form.expected_checkin')"+ name="expected_checkin"+ input_div_class="col-md-4"+ >+ <x-slot:input>+ <x-input.datepicker+ name="expected_checkin"+ :value="old('expected_checkin')"+ :placeholder="trans('general.select_date')"+ />+ </x-slot:input>+ </x-form.row>++ <x-form.row+ :label="trans('general.notes')"+ name="note"+ >+ <x-slot:input>+ <textarea class="form-control" id="note" name="note">{{ old('note') }}</textarea>+ </x-slot:input>+ </x-form.row>++ <x-slot:customfooter>+ <div class="box-footer">+ <a class="btn btn-link" href="{{ URL::previous() }}">{{ trans('button.cancel') }}</a>+ <button type="submit" class="btn btn-primary pull-right"><x-icon type="checkmark"/> {{ trans('general.checkout') }}</button>+ </div>+ </x-slot:customfooter>++ </x-box>++ </x-form>++ </x-page-column>++ <livewire:checkout-target-panel type="assets" />++ </x-container>@stop@section('moar_scripts')-<script nonce="{{ csrf_token() }}">- $(function () {- // Add the disabled attribute to empty inputs on submit to handle the case where someone does not pick a status ID- // and the form is submitted with an empty status ID which will fail validation via the form request- $("form").submit(function() {- $(this).find(":input").filter(function(){ return !this.value; }).attr("disabled", "disabled");- return true; // ensure form still submits- });+ <script nonce="{{ csrf_token() }}">+ $(function () {+ // Add the disabled attribute to empty inputs on submit to handle the case where someone does not pick a status ID+ // and the form is submitted with an empty status ID which will fail validation via the form request+ $("form").submit(function() {+ $(this).find(":input").filter(function(){ return !this.value; }).attr("disabled", "disabled");+ return true; // ensure form still submits+ });- setTimeout(function () {- const $searchField = $('.select2-search__field');- const $results = $('.select2-results');+ setTimeout(function () {+ const $searchField = $('.select2-search__field');+ const $results = $('.select2-results');- // Focus the search input- $searchField.focus();+ // Focus the search input+ $searchField.focus();- // Hide results initially- $results.hide();-- // Show results when a user starts typing- $searchField.on('input', function () {- $results.show();- });- }, 0);- });-</script>+ // Hide results initially+ $results.hide();+ // Show results when a user starts typing+ $searchField.on('input', function () {+ $results.show();+ });+ }, 0);+ });+ </script>@stopdiff --git a/resources/views/hardware/checkout.blade.php b/resources/views/hardware/checkout.blade.phpindex a8ec0ef147..4ba1053cde 100755--- a/resources/views/hardware/checkout.blade.php+++ b/resources/views/hardware/checkout.blade.php@@ -10,216 +10,159 @@@section('content')<style>-.input-group {padding-left: 0px !important;}</style>- <div class="row">- <!-- left column -->- <div class="col-md-7">- <div class="box box-default">- <form class="form-horizontal" method="post" action="" autocomplete="off">- <div class="box-header with-border">- <h2 class="box-title"> {{ trans('admin/hardware/form.tag') }} {{ $asset->asset_tag }}</h2>- </div>- <div class="box-body">- {{csrf_field()}}- @if ($asset->company)- <!-- accessory name -->- <div class="form-group">- <label class="col-sm-3 control-label">{{ trans('general.company') }}</label>- <div class="col-md-6">- <p class="form-control-static">{!! $asset->company->present()->formattedNameLink !!}</p>- </div>- </div>+ <x-container columns="2">+ <x-page-column class="col-md-7">++ <x-form id="checkout_form" route="{{ url()->current() }}">++ <x-box header="{{ trans('admin/hardware/form.tag') }} {{ $asset->asset_tag }}">++ @if ($asset->company)+ <x-form.static :label="trans('general.company')">{!! $asset->company->present()->formattedNameLink !!}</x-form.static>+ @endif++ @if ($asset->model->category)+ <x-form.static :label="trans('general.category')">{!! $asset->model->category->present()->formattedNameLink !!}</x-form.static>+ @endif++ <x-form.static :label="trans('admin/hardware/form.model')">+ @if (($asset->model) && ($asset->model->name))+ {{ $asset->model->name }}+ @else+ <span class="text-danger text-bold">+ <x-icon type="warning" />+ {{ trans('admin/hardware/general.model_invalid') }}+ </span>+ {{ trans('admin/hardware/general.model_invalid_fix') }}+ <a href="{{ route('hardware.edit', $asset->id) }}">+ <strong>{{ trans('admin/hardware/general.edit') }}</strong>+ </a>@endif+ </x-form.static>+ <x-form.row+ :label="trans('admin/hardware/form.name')"+ :$item+ name="name"+ />- @if ($asset->model->category)- <!-- category name -->- <div class="form-group">- <label class="col-sm-3 control-label">{{ trans('general.category') }}</label>- <div class="col-md-6">- <p class="form-control-static">{!! $asset->model->category->present()->formattedNameLink !!}</p>- </div>- </div>- @endif+ <x-form.row+ :label="trans('admin/hardware/form.status')"+ name="status_id"+ >+ <x-slot:input>+ <x-input.select+ name="status_id"+ :options="$statusLabel_list"+ :selected="$asset->status_id"+ required+ style="width: 100%;"+ aria-label="status_id"+ />+ </x-slot:input>+ </x-form.row>++ <x-form.checkbox-row+ name="requestable"+ :label="trans('admin/hardware/general.requestable')"+ :item="$asset"+ />- <!-- AssetModel name -->- <div class="form-group">- <label for="model" class="col-md-3 control-label">- {{ trans('admin/hardware/form.model') }}- </label>- <div class="col-md-8">- <p class="form-control-static" style="padding-top: 7px;">- @if (($asset->model) && ($asset->model->name))- {{ $asset->model->name }}- @else- <span class="text-danger text-bold">- <x-icon type="warning" />- {{ trans('admin/hardware/general.model_invalid')}}- </span>-- {{ trans('admin/hardware/general.model_invalid_fix')}}- <a href="{{ route('hardware.edit', $asset->id) }}">- <strong>{{ trans('admin/hardware/general.edit') }}</strong>- </a>+ @include ('partials.forms.checkout-selector', ['user_select' => 'true', 'asset_select' => 'true', 'location_select' => 'true'])+ @include ('partials.forms.edit.user-select', ['translated_name' => trans('general.user'), 'fieldname' => 'assigned_user', 'company_id' => $asset->company_id, 'style' => (session('checkout_to_type') ?: 'user') == 'user' ? '' : 'display: none;'])+ <!-- unselect keeps the asset being checked out from being pre-selected in this picker -->+ @include ('partials.forms.edit.asset-select', ['translated_name' => trans('general.select_asset'), 'fieldname' => 'assigned_asset', 'company_id' => $asset->company_id, 'unselect' => 'true', 'exclude_id' => $asset->id, 'style' => session('checkout_to_type') == 'asset' ? '' : 'display: none;'])+ @include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'assigned_location', 'company_id' => $asset->company_id, 'style' => session('checkout_to_type') == 'location' ? '' : 'display: none;'])++ <x-form.row+ :label="trans('admin/hardware/form.checkout_date')"+ name="checkout_at"+ input_div_class="col-md-4"+ >+ <x-slot:input>+ <x-input.datepicker+ name="checkout_at"+ end_date="0d"+ :value="old('expected_checkin', date('Y-m-d'))"+ :placeholder="trans('general.select_date')"+ required="{{ Helper::checkIfRequired($item, 'checkout_at') }}"+ />+ </x-slot:input>+ </x-form.row>++ <x-form.row+ :label="trans('admin/hardware/form.expected_checkin')"+ name="expected_checkin"+ input_div_class="col-md-4"+ >+ <x-slot:input>+ <x-input.datepicker+ name="expected_checkin"+ :value="old('expected_checkin', $item->expected_checkin)"+ :placeholder="trans('general.select_date')"+ required="{{ Helper::checkIfRequired($item, 'expected_checkin') }}"+ />+ </x-slot:input>+ </x-form.row>++ <x-form.row+ :label="trans('general.notes')"+ name="note"+ >+ <x-slot:input>+ <textarea class="col-md-6 form-control" id="note" name="note" @required($snipeSettings->require_checkinout_notes)>{{ old('note', $asset->note) }}</textarea>+ </x-slot:input>+ </x-form.row>++ <!-- Custom fields -->+ @include('models/custom_fields_form', [+ 'model' => $asset->model,+ 'show_custom_fields_type' => 'checkout',+ ])++ @if ($asset->requireAcceptance() || (string) $snipeSettings->require_accept_signature === '1' || $asset->getEula() || ($snipeSettings->webhook_endpoint != ''))+ <div class="form-group notification-callout" style="display:none;">+ <div class="col-md-8 col-md-offset-3">+ <div class="callout callout-info" role="status" aria-live="polite" aria-atomic="true">++ @if ($asset->requireAcceptance())+ <x-icon type="email"/>+ {{ trans('admin/categories/general.required_acceptance') }}+ <br>@endif- </p>- </div>- </div>-- <!-- Asset Name -->- <div class="form-group {{ $errors->has('name') ? 'error' : '' }}">- <label for="name" class="col-md-3 control-label">- {{ trans('admin/hardware/form.name') }}- </label>-- <div class="col-md-7">- <input class="form-control" type="text" name="name" id="name"- value="{{ old('name', $asset->name) }}" tabindex="1">- <x-form.error name="name" />- </div>- </div>-- <!-- Status -->- <div class="form-group {{ $errors->has('status_id') ? 'error' : '' }}">- <label for="status_id" class="col-md-3 control-label">- {{ trans('admin/hardware/form.status') }}- </label>- <div class="col-md-7 required">- <x-input.select- name="status_id"- :options="$statusLabel_list"- :selected="$asset->status_id"- style="width: 100%;"- aria-label="status_id"- />- <x-form.error name="status_id" />- </div>- </div>-- <div class="form-group">- <div class="col-md-7 col-md-offset-3">- <label class="form-control" for="requestable">- <input- type="checkbox"- value="1"- name="requestable"- id="requestable"- @checked((bool) old('requestable', $asset->requestable))- />- {{ trans('admin/hardware/general.requestable') }}- </label>- </div>- </div>- @include ('partials.forms.checkout-selector', ['user_select' => 'true','asset_select' => 'true', 'location_select' => 'true'])- @include ('partials.forms.edit.user-select', ['translated_name' => trans('general.user'), 'fieldname' => 'assigned_user', 'company_id' => $asset->company_id, 'style' => (session('checkout_to_type') ?: 'user') == 'user' ? '' : 'display: none;'])- <!-- We have to pass unselect here so that we don't default to the asset that's being checked out. We want that asset to be pre-selected everywhere else. -->- @include ('partials.forms.edit.asset-select', ['translated_name' => trans('general.select_asset'), 'fieldname' => 'assigned_asset', 'company_id' => $asset->company_id, 'unselect' => 'true', 'exclude_id' => $asset->id, 'style' => session('checkout_to_type') == 'asset' ? '' : 'display: none;'])- @include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'assigned_location', 'company_id' => $asset->company_id, 'style' => session('checkout_to_type') == 'location' ? '' : 'display: none;'])---- <!-- Checkout/Checkin Date -->- <div class="form-group {{ $errors->has('checkout_at') ? 'error' : '' }}">- <label for="checkout_at" class="col-md-3 control-label">- {{ trans('admin/hardware/form.checkout_date') }}- </label>- <div class="col-md-8">-- <x-input.datepicker- name="checkout_at"- end_date="0d"- col_size_class="col-md-7"- :value="old('expected_checkin', date('Y-m-d'))"- placeholder="{{ trans('general.select_date') }}"- required="{{ Helper::checkIfRequired($item, 'checkout_at') }}"- />- <x-form.error name="checkout_at" />- </div>- </div>-- <!-- Expected Checkin Date -->- <div class="form-group {{ $errors->has('expected_checkin') ? 'error' : '' }}">- <label for="expected_checkin" class="col-md-3 control-label">- {{ trans('admin/hardware/form.expected_checkin') }}- </label>-- <div class="col-md-8">- <x-input.datepicker- name="expected_checkin"- col_size_class="col-md-7"- :value="old('expected_checkin', $item->expected_checkin)"- placeholder="{{ trans('general.select_date') }}"- required="{{ Helper::checkIfRequired($item, 'expected_checkin') }}"- />- <x-form.error name="expected_checkin" />- </div>- </div>+ @if ((string) $snipeSettings->require_accept_signature === '1')+ <x-icon type="edit"/>+ {{ trans('admin/categories/general.required_signature') }}+ <br>+ @endif- <!-- Note -->- <div class="form-group {{ $errors->has('note') ? 'error' : '' }}">- <label for="note" class="col-md-3 control-label">- {{ trans('general.notes') }}- </label>+ @if ($asset->getEula())+ <x-icon type="email"/>+ {{ trans('admin/categories/general.required_eula') }}+ <br>+ @endif- <div class="col-md-8">- <textarea class="col-md-6 form-control" id="note" @required($snipeSettings->require_checkinout_notes)- name="note">{{ old('note', $asset->note) }}</textarea>- <x-form.error name="note" />- </div>- </div>+ @if (($asset->model?->category) && ($asset->model->category->checkin_email))+ <x-icon type="email"/>+ {{ trans('admin/categories/general.checkin_email_notification') }}+ <br>+ @endif- <!-- Custom fields -->- @include("models/custom_fields_form", [- 'model' => $asset->model,- 'show_custom_fields_type' => 'checkout'- ])---- @if ($asset->requireAcceptance() || (string) $snipeSettings->require_accept_signature === '1' || $asset->getEula() || ($snipeSettings->webhook_endpoint!=''))- <div class="form-group notification-callout" style="display:none;">- <div class="col-md-8 col-md-offset-3">- <div class="callout callout-info" role="status" aria-live="polite" aria-atomic="true">-- @if ($asset->requireAcceptance())- <x-icon type="email"/>- {{ trans('admin/categories/general.required_acceptance') }}- <br>- @endif-- @if ((string) $snipeSettings->require_accept_signature === '1')- <x-icon type="edit"/>- {{ trans('admin/categories/general.required_signature') }}- <br>- @endif-- @if ($asset->getEula())- <x-icon type="email"/>- {{ trans('admin/categories/general.required_eula') }}- <br>- @endif-- @if (($asset->model?->category) && ($asset->model->category->checkin_email))- <x-icon type="email"/>- {{ trans('admin/categories/general.checkin_email_notification') }}- <br>- @endif-- @if ($snipeSettings->webhook_endpoint!='')- <i class="fab fa-slack" aria-hidden="true"></i>- {{ trans('general.webhook_msg_note') }}- @endif- </div>+ @if ($snipeSettings->webhook_endpoint != '')+ <i class="fab fa-slack" aria-hidden="true"></i>+ {{ trans('general.webhook_msg_note') }}+ @endif</div>+ </div>- <!-- Sign in place checkbox -->- @if ($asset->requireAcceptance() || (string) $snipeSettings->require_accept_signature === '1')+ <!-- Sign in place checkbox -->+ @if ($asset->requireAcceptance() || (string) $snipeSettings->require_accept_signature === '1')<div id="sign_in_place_div" class="col-md-7 col-md-offset-3"><label class="form-control"><input type="checkbox" value="1" name="sign_in_place" @checked(old('sign_in_place', session('sign_in_place', false))) aria-label="sign_in_place">@@ -229,14 +172,12 @@{{ trans('general.sign_in_place_help') }}</p></div>- @endif- </div>- @endif--- </div> <!--/.box-body-->+ @endif+ </div>+ @endif- <x-redirect_submit_options+ <x-slot:customfooter>+ <x-redirect_submit_optionsindex_route="hardware.index":button_label="trans('general.checkout')":disabled_select="!$asset->model"@@ -244,16 +185,19 @@'index' => trans('admin/hardware/form.redirect_to_all', ['type' => trans('general.assets')]),'item' => trans('admin/hardware/form.redirect_to_type', ['type' => trans('general.asset')]),'target' => trans('admin/hardware/form.redirect_to_checked_out_to'),+ ]"+ />+ </x-slot:customfooter>- ]"- />+ </x-box>- </form>- </div>- </div> <!--/.col-md-7-->+ </x-form>++ </x-page-column><livewire:checkout-target-panel type="assets" />- </div>++ </x-container>@stop@section('moar_scripts')diff --git a/resources/views/kits/checkout.blade.php b/resources/views/kits/checkout.blade.phpindex baf34cc1be..c86552d802 100644--- a/resources/views/kits/checkout.blade.php+++ b/resources/views/kits/checkout.blade.php@@ -2,83 +2,84 @@{{-- Page title --}}@section('title')- {{ trans('admin/kits/general.checkout') }}-@parent+ {{ trans('admin/kits/general.checkout') }}+ @parent@stop{{-- Page content --}}@section('content')-<style>- .input-group {- padding-left: 0px !important;- }-</style>---<div class="row">- <!-- left column -->- <div class="col-md-7">- <div class="box box-default">- <div class="box-body">- <form class="form-horizontal" method="post" action="" autocomplete="off">- {{ csrf_field() }}- @include ('partials.forms.edit.user-select', ['translated_name' => trans('general.select_user'), 'fieldname' => 'user_id', 'required'=> 'true'])-- <!-- Checkout/Checkin Date -->- <div class="form-group {{ $errors->has('checkout_at') ? 'error' : '' }}">- <label for="checkout_at" class="col-md-3 control-label">- {{ trans('admin/hardware/form.checkout_date') }}- </label>- <div class="col-md-8">- <div class="input-group date col-md-5" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-date-end-date="0d" data-date-clear-btn="true">- <input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="checkout_at" id="checkout_at" value="{{ old('checkout_at') }}">- <span class="input-group-addon"><x-icon type="calendar" /></span>- </div>- <x-form.error name="checkout_at" />- </div>- </div>-- <!-- Expected Checkin Date -->- <div class="form-group {{ $errors->has('expected_checkin') ? 'error' : '' }}">- <label for="expected_checkin" class="col-md-3 control-label">- {{ trans('admin/hardware/form.expected_checkin') }}- </label>- <div class="col-md-8">- <div class="input-group date col-md-5" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-date-start-date="0d">- <input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="expected_checkin" id="expected_checkin" value="{{ old('expected_checkin') }}">- <span class="input-group-addon"><x-icon type="calendar" /></span>- </div>- <x-form.error name="expected_checkin" />- </div>- </div>--- <!-- Note -->- <div class="form-group {{ $errors->has('note') ? 'error' : '' }}">- <label for="note" class="col-md-3 control-label">- {{ trans('general.notes') }}- </label>- <div class="col-md-8">- <textarea class="col-md-6 form-control" id="note" name="note">{{ old('note') }}</textarea>- <x-form.error name="note" />- </div>- </div>-- </div> <!--./box-body-->- <div class="box-footer">- <a class="btn btn-link" href="{{ route('kits.index') }}"> {{ trans('button.cancel') }}</a>- <button type="submit" class="btn btn-success pull-right"><x-icon type="checkmark" /> {{ trans('general.checkout') }}</button>- </div>- </div>- </form>- </div> <!--/.col-md-7-->-- <livewire:checkout-target-panel type="assets" />-</div>+ <style>+ .input-group {+ padding-left: 0px !important;+ }+ </style>++ <x-container columns="2">+ <x-page-column class="col-md-7">++ <x-form id="checkout_form" route="{{ url()->current() }}">++ <x-box>++ @include ('partials.forms.edit.user-select', ['translated_name' => trans('general.select_user'), 'fieldname' => 'user_id', 'required' => 'true'])++ <x-form.row+ :label="trans('admin/hardware/form.checkout_date')"+ name="checkout_at"+ input_div_class="col-md-4"+ >+ <x-slot:input>+ <x-input.datepicker+ name="checkout_at"+ end_date="0d"+ :value="old('checkout_at')"+ :placeholder="trans('general.select_date')"+ />+ </x-slot:input>+ </x-form.row>++ <x-form.row+ :label="trans('admin/hardware/form.expected_checkin')"+ name="expected_checkin"+ input_div_class="col-md-4"+ >+ <x-slot:input>+ <x-input.datepicker+ name="expected_checkin"+ :value="old('expected_checkin')"+ :placeholder="trans('general.select_date')"+ />+ </x-slot:input>+ </x-form.row>++ <x-form.row+ :label="trans('general.notes')"+ name="note"+ >+ <x-slot:input>+ <textarea class="form-control" id="note" name="note">{{ old('note') }}</textarea>+ </x-slot:input>+ </x-form.row>++ <x-slot:customfooter>+ <div class="box-footer">+ <a class="btn btn-link" href="{{ route('kits.index') }}">{{ trans('button.cancel') }}</a>+ <button type="submit" class="btn btn-success pull-right"><x-icon type="checkmark"/> {{ trans('general.checkout') }}</button>+ </div>+ </x-slot:customfooter>++ </x-box>++ </x-form>++ </x-page-column>++ <livewire:checkout-target-panel type="assets" />++ </x-container>@stop@section('notifications')-@parent-<!-- included content -->+ @parent@stopdiff --git a/resources/views/licenses/checkout.blade.php b/resources/views/licenses/checkout.blade.phpindex f04fbe5ec0..b6f77c6297 100755--- a/resources/views/licenses/checkout.blade.php+++ b/resources/views/licenses/checkout.blade.php@@ -2,149 +2,123 @@{{-- Page title --}}@section('title')- {{ trans('admin/licenses/general.checkout') }}-@parent+ {{ trans('admin/licenses/general.checkout') }}+ @parent@stop@section('header_right')<a href="{{ URL::previous() }}" class="btn btn-primary pull-right">- {{ trans('general.back') }}</a>+ {{ trans('general.back') }}+ </a>@stop{{-- Page content --}}@section('content')-<div class="row">- <!-- left column -->- <div class="col-md-7">- <form class="form-horizontal" method="post" action="" autocomplete="off">- {{csrf_field()}}-- <div class="box box-default">- <div class="box-header with-border">- <h2 class="box-title"> {{ $license->name }} ({{ trans('admin/licenses/message.seats_available', ['seat_count' => $license->availCount()->count()]) }})</h2>- </div>- <div class="box-body">--- <!-- License name -->- <div class="form-group">- <label class="col-sm-3 control-label">{{ trans('admin/hardware/form.name') }}</label>- <div class="col-md-9">- <p class="form-control-static">{{ $license->name }}</p>- </div>- </div>++ <x-container columns="2">+ <x-page-column class="col-md-7">++ <x-form id="checkout_form" route="{{ url()->current() }}">++ <x-box header="{{ $license->name }} ({{ trans('admin/licenses/message.seats_available', ['seat_count' => $license->availCount()->count()]) }})">++ <x-form.static :label="trans('admin/hardware/form.name')">{{ $license->name }}</x-form.static>@if ($license->company)- <!-- company name -->- <div class="form-group">- <label class="col-sm-3 control-label">{{ trans('general.company') }}</label>- <div class="col-md-6">- <p class="form-control-static">{!! $license->company->present()->formattedNameLink !!}</p>- </div>- </div>+ <x-form.static :label="trans('general.company')">{!! $license->company->present()->formattedNameLink !!}</x-form.static>@endif-@if ($license->category)- <!-- category name -->- <div class="form-group">- <label class="col-sm-3 control-label">{{ trans('general.category') }}</label>- <div class="col-md-6">- <p class="form-control-static">{!! $license->category->present()->formattedNameLink !!}</p>- </div>- </div>+ <x-form.static :label="trans('general.category')">{!! $license->category->present()->formattedNameLink !!}</x-form.static>@endif- <!-- Serial -->@if ($license->serial)@can('viewKeys', $license)- <div class="form-group">- <label class="col-sm-3 control-label">{{ trans('admin/licenses/form.license_key') }}-- </label>- <div class="col-md-9">- <p class="form-control-static">- <x-copy-to-clipboard copy_what="license_key">- <code>{!! nl2br(e($license->serial)) !!}</code>- </x-copy-to-clipboard>- </p>- </div>- </div>+ <x-form.static :label="trans('admin/licenses/form.license_key')">+ <x-copy-to-clipboard copy_what="license_key">+ <code>{!! nl2br(e($license->serial)) !!}</code>+ </x-copy-to-clipboard>+ </x-form.static>@endcan@endif- @include ('partials.forms.checkout-selector', ['user_select' => 'true','asset_select' => 'true', 'location_select' => 'false'])+ @include ('partials.forms.checkout-selector', ['user_select' => 'true', 'asset_select' => 'true', 'location_select' => 'false'])@include ('partials.forms.edit.user-select', ['translated_name' => trans('general.user'), 'fieldname' => 'assigned_to', 'company_id' => $license->company_id, 'style' => (session('checkout_to_type') ?: 'user') == 'user' ? '' : 'display: none;'])@include ('partials.forms.edit.asset-select', ['translated_name' => trans('general.select_asset'), 'fieldname' => 'asset_id', 'company_id' => $license->company_id, 'style' => session('checkout_to_type') == 'asset' ? '' : 'display: none;'])- <!-- Note -->- <div class="form-group {{ $errors->has('notes') ? 'error' : '' }}">- <label for="note" class="col-md-3 control-label">{{ trans('general.checkout_note') }}</label>- <div class="col-md-8">- <textarea class="col-md-6 form-control" id="notes" name="notes" rows="5">{{ old('note') }}</textarea>- <x-form.error name="note" />- </div>- </div>- </div>--- @if ($license->requireAcceptance() || (string) $snipeSettings->require_accept_signature === '1' || $license->getEula() || ($snipeSettings->webhook_endpoint!=''))- <div class="form-group notification-callout">- <div class="col-md-8 col-md-offset-3">- <div class="callout callout-info" role="status" aria-live="polite" aria-atomic="true">-- @if ($license->requireAcceptance())- <i class="far fa-envelope"></i>- {{ trans('admin/categories/general.required_acceptance') }}- <br>- @endif-- @if ($license->getEula())- <i class="far fa-envelope"></i>- {{ trans('admin/categories/general.required_eula') }}- <br>- @endif-- @if (($license->category) && ($license->category->checkin_email))- <i class="far fa-envelope"></i>- {{ trans('admin/categories/general.checkin_email_notification') }}- <br>- @endif-- @if ($snipeSettings->webhook_endpoint!='')- <i class="fab fa-slack"></i>- {{ trans('general.webhook_msg_note') }}- @endif+ <x-form.row+ :label="trans('general.checkout_note')"+ name="notes"+ >+ <x-slot:input>+ <textarea class="form-control" id="notes" name="notes" rows="5">{{ old('note') }}</textarea>+ </x-slot:input>+ </x-form.row>++ @if ($license->requireAcceptance() || (string) $snipeSettings->require_accept_signature === '1' || $license->getEula() || ($snipeSettings->webhook_endpoint != ''))+ <div class="form-group notification-callout">+ <div class="col-md-8 col-md-offset-3">+ <div class="callout callout-info" role="status" aria-live="polite" aria-atomic="true">++ @if ($license->requireAcceptance())+ <i class="far fa-envelope"></i>+ {{ trans('admin/categories/general.required_acceptance') }}+ <br>+ @endif++ @if ($license->getEula())+ <i class="far fa-envelope"></i>+ {{ trans('admin/categories/general.required_eula') }}+ <br>+ @endif++ @if (($license->category) && ($license->category->checkin_email))+ <i class="far fa-envelope"></i>+ {{ trans('admin/categories/general.checkin_email_notification') }}+ <br>+ @endif++ @if ($snipeSettings->webhook_endpoint != '')+ <i class="fab fa-slack"></i>+ {{ trans('general.webhook_msg_note') }}+ @endif+ </div></div>- </div>- <!-- Sign in place checkbox -->- @if ($license->requireAcceptance() || (string) $snipeSettings->require_accept_signature === '1')- <div id="sign_in_place_div" class="col-md-7 col-md-offset-3">- <label class="form-control">- <input type="checkbox" value="1" name="sign_in_place" @checked(old('sign_in_place', session('sign_in_place', false))) aria-label="sign_in_place">- {{ trans('general.sign_in_place') }}- </label>- <p class="help-block">- {{ trans('general.sign_in_place_help') }}- </p>+ <!-- Sign in place checkbox -->+ @if ($license->requireAcceptance() || (string) $snipeSettings->require_accept_signature === '1')+ <div id="sign_in_place_div" class="col-md-7 col-md-offset-3">+ <label class="form-control">+ <input type="checkbox" value="1" name="sign_in_place" @checked(old('sign_in_place', session('sign_in_place', false))) aria-label="sign_in_place">+ {{ trans('general.sign_in_place') }}+ </label>+ <p class="help-block">+ {{ trans('general.sign_in_place_help') }}+ </p>+ </div>+ @endif</div>- @endif- </div>- @endif-- <x-redirect_submit_options- index_route="licenses.index"- :button_label="trans('general.checkout')"- :options="[+ @endif++ <x-slot:customfooter>+ <x-redirect_submit_options+ index_route="licenses.index"+ :button_label="trans('general.checkout')"+ :options="['index' => trans('admin/hardware/form.redirect_to_all', ['type' => trans('general.licenses')]),'item' => trans('admin/hardware/form.redirect_to_type', ['type' => trans('general.license')]),'target' => trans('admin/hardware/form.redirect_to_checked_out_to'),- ]"- />- </div> <!-- /.box-->- </form>- </div> <!-- /.col-md-7-->- <livewire:checkout-target-panel type="licenses" />-</div>-@stop\ No newline at end of file+ ]"+ />+ </x-slot:customfooter>++ </x-box>++ </x-form>++ </x-page-column>++ <livewire:checkout-target-panel type="licenses" />++ </x-container>+@stopdiff --git a/resources/views/partials/forms/checkout-selector.blade.php b/resources/views/partials/forms/checkout-selector.blade.phpindex eba5094bae..e119bd9282 100644--- a/resources/views/partials/forms/checkout-selector.blade.php+++ b/resources/views/partials/forms/checkout-selector.blade.php@@ -4,25 +4,28 @@<div class="btn-group" data-toggle="buttons">@if ((isset($user_select)) && ($user_select!='false'))- <label class="btn btn-theme{{ (session('checkout_to_type') ?: 'user') == 'user' ? ' active' : '' }}">+ <label class="btn btn-theme @if((session('checkout_to_type') ?: 'user') == 'user') active @endif"><input name="checkout_to_type" value="user" aria-label="checkout_to_type"- type="radio" {{ (session('checkout_to_type') ?: 'user') == 'user' ? 'checked' : '' }}>+ type="radio" data-required-select="#assigned_user_select"+ @checked((session('checkout_to_type') ?: 'user') == 'user')><x-icon type="user" />{{ trans('general.user') }}</label>@endif@if ((isset($asset_select)) && ($asset_select!='false'))- <label class="btn btn-theme{{ session('checkout_to_type') == 'asset' ? ' active' : '' }}">+ <label class="btn btn-theme @if(session('checkout_to_type') == 'asset') active @endif"><input name="checkout_to_type" value="asset" aria-label="checkout_to_type"- type="radio" {{ session('checkout_to_type') == 'asset' ? 'checked': '' }}>+ type="radio" data-required-select="#assigned_asset_select"+ @checked(session('checkout_to_type') == 'asset')><i class="fas fa-barcode" aria-hidden="true"></i>{{ trans('general.asset') }}</label>@endif@if ((isset($location_select)) && ($location_select!='false'))- <label class="btn btn-theme{{ session('checkout_to_type') == 'location' ? ' active' : '' }}">+ <label class="btn btn-theme @if(session('checkout_to_type') == 'location') active @endif"><input name="checkout_to_type" value="location" aria-label="checkout_to_type"- type="radio" {{ session('checkout_to_type') == 'location' ? 'checked' : '' }}>+ type="radio" data-required-select="#assigned_location_location_select"+ @checked(session('checkout_to_type') == 'location')><i class="fas fa-map-marker-alt" aria-hidden="true"></i>{{ trans('general.location') }}</label>