mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 21:24:13 -08:00
Use blade component for redirect option
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
f77d300549
commit
73a80a5fbc
|
@ -1490,22 +1490,24 @@ class Helper
|
|||
$redirect_option = Session::get('redirect_option');
|
||||
$checkout_to_type = Session::get('checkout_to_type');
|
||||
|
||||
//return to index
|
||||
if ($redirect_option == '0') {
|
||||
// return to index
|
||||
if ($redirect_option == 'index') {
|
||||
switch ($table) {
|
||||
case "Assets":
|
||||
return redirect()->route('hardware.index')->with('success', trans('admin/hardware/message.checkout.success'));
|
||||
}
|
||||
}
|
||||
//return to thing being assigned
|
||||
if ($redirect_option == '1') {
|
||||
|
||||
// return to thing being assigned
|
||||
if ($redirect_option == 'item') {
|
||||
switch ($table) {
|
||||
case "Assets":
|
||||
return redirect()->route('hardware.show', $id ? $id : $asset_id)->with('success', trans('admin/hardware/message.checkout.success'));
|
||||
}
|
||||
}
|
||||
//return to thing being assigned to
|
||||
if ($redirect_option == '2') {
|
||||
|
||||
// return to assignment target
|
||||
if ($redirect_option == 'target') {
|
||||
switch ($checkout_to_type) {
|
||||
case 'user':
|
||||
return redirect()->route('users.show', $request->assigned_user)->with('success', trans('admin/hardware/message.checkout.success'));
|
||||
|
|
|
@ -23,6 +23,7 @@ use Illuminate\Support\Facades\DB;
|
|||
use Illuminate\Support\Facades\Gate;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Crypt;
|
||||
use Illuminate\Support\Facades\Session;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use League\Csv\Reader;
|
||||
|
@ -204,6 +205,8 @@ class AssetsController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
session()->put(['redirect_option' => $request->get('redirect_option'), 'checkout_to_type' => $request->get('checkout_to_type')]);
|
||||
|
||||
if ($success) {
|
||||
return redirect()->route('hardware.index')
|
||||
->with('success-unescaped', trans('admin/hardware/message.create.success_linked', ['link' => route('hardware.show', ['hardware' => $asset->id]), 'id', 'tag' => e($asset->asset_tag)]));
|
||||
|
@ -289,6 +292,8 @@ class AssetsController extends Controller
|
|||
*/
|
||||
public function update(ImageUploadRequest $request, $assetId = null) : RedirectResponse
|
||||
{
|
||||
|
||||
|
||||
// Check if the asset exists
|
||||
if (! $asset = Asset::find($assetId)) {
|
||||
// Redirect to the asset management page with error
|
||||
|
@ -387,10 +392,10 @@ class AssetsController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
session()->put(['redirect_option' => $request->get('redirect_option'), 'checkout_to_type' => $request->get('checkout_to_type')]);
|
||||
|
||||
if ($asset->save()) {
|
||||
return redirect()->route('hardware.show', $assetId)
|
||||
->with('success', trans('admin/hardware/message.update.success'));
|
||||
return Helper::getRedirectOption($request, $assetId, 'Assets');
|
||||
}
|
||||
|
||||
return redirect()->back()->withInput()->withErrors($asset->getErrors());
|
||||
|
|
38
resources/views/blade/redirect_submit_options.blade.php
Normal file
38
resources/views/blade/redirect_submit_options.blade.php
Normal file
|
@ -0,0 +1,38 @@
|
|||
<!-- begin redirect submit options -->
|
||||
@props([
|
||||
'route' => 'hardware.index',
|
||||
'button_label',
|
||||
'disabled_select' => false,
|
||||
'options' => [],
|
||||
])
|
||||
|
||||
<div class="box-footer">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-3">
|
||||
<a class="btn btn-link" href="{{ route($route) }}">{{ trans('button.cancel') }}</a>
|
||||
</div>
|
||||
|
||||
<div class="col-md-9 text-right">
|
||||
<div class="btn-group text-left">
|
||||
|
||||
@if (($options) && (count($options) > 0))
|
||||
<select class="redirect-options form-control select2" data-minimum-results-for-search="Infinity" name="redirect_option" style="min-width: 200px"{{ ($disabled_select ? ' disabled' : '') }}>
|
||||
@foreach ($options as $key => $value)
|
||||
<option value="{{ $key }}"{{ Session::get('redirect_option') == $key ? ' selected' : ''}}>
|
||||
{{ $value }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@endif
|
||||
|
||||
<button type="submit" class="btn btn-primary pull-right{{ ($disabled_select ? ' disabled' : '') }}" style="margin-left:5px; border-radius: 3px;"{!! ($disabled_select ? ' data-tooltip="true" title="'.trans('admin/hardware/general.edit').'" disabled' : '') !!}>
|
||||
<i class="fas fa-check icon-white" aria-hidden="true"></i>
|
||||
{{ $button_label }}
|
||||
</button>
|
||||
|
||||
</div><!-- /.btn-group -->
|
||||
</div><!-- /.col-md-9 -->
|
||||
</div><!-- /.row -->
|
||||
</div> <!-- /.box-footer -->
|
||||
<!-- end redirect submit options -->
|
|
@ -2,132 +2,144 @@
|
|||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('admin/hardware/general.checkin') }}
|
||||
@parent
|
||||
{{ trans('admin/hardware/general.checkin') }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
<style>
|
||||
<style>
|
||||
|
||||
.input-group {
|
||||
padding-left: 0px !important;
|
||||
}
|
||||
</style>
|
||||
.input-group {
|
||||
padding-left: 0px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<div class="row"><!-- .row -->
|
||||
<!-- left column -->
|
||||
<div class="col-md-7 col-sm-11 col-xs-12 col-md-offset-2">
|
||||
<div class="box box-default"><!-- .box-default -->
|
||||
<div class="box-header with-border"><!-- .box-header -->
|
||||
<h2 class="box-title">
|
||||
{{ trans('admin/hardware/form.tag') }}
|
||||
{{ $asset->asset_tag }}
|
||||
</h2>
|
||||
</div><!-- /.box-header -->
|
||||
<div class="row"><!-- .row -->
|
||||
<!-- left column -->
|
||||
<div class="col-md-7 col-sm-11 col-xs-12 col-md-offset-2">
|
||||
<div class="box box-default"><!-- .box-default -->
|
||||
<div class="box-header with-border"><!-- .box-header -->
|
||||
<h2 class="box-title">
|
||||
{{ trans('admin/hardware/form.tag') }}
|
||||
{{ $asset->asset_tag }}
|
||||
</h2>
|
||||
</div><!-- /.box-header -->
|
||||
|
||||
<div class="box-body"><!-- .box-body -->
|
||||
<div class="col-md-12"><!-- .col-md-12 -->
|
||||
<div class="box-body"><!-- .box-body -->
|
||||
<div class="col-md-12"><!-- .col-md-12 -->
|
||||
|
||||
@if ($backto == 'user')
|
||||
<form class="form-horizontal" method="post" action="{{ route('hardware.checkin.store', array('assetId'=> $asset->id, 'backto'=>'user')) }}" autocomplete="off">
|
||||
@else
|
||||
<form class="form-horizontal" method="post" action="{{ route('hardware.checkin.store', array('assetId'=> $asset->id)) }}" autocomplete="off">
|
||||
@endif
|
||||
{{csrf_field()}}
|
||||
@if ($backto == 'user')
|
||||
<form class="form-horizontal" method="post"
|
||||
action="{{ route('hardware.checkin.store', array('assetId'=> $asset->id, 'backto'=>'user')) }}"
|
||||
autocomplete="off">
|
||||
@else
|
||||
<form class="form-horizontal" method="post"
|
||||
action="{{ route('hardware.checkin.store', array('assetId'=> $asset->id)) }}"
|
||||
autocomplete="off">
|
||||
@endif
|
||||
{{csrf_field()}}
|
||||
|
||||
<!-- AssetModel name -->
|
||||
<div class="form-group">
|
||||
<label for="model" class="col-sm-3 control-label">
|
||||
{{ trans('admin/hardware/form.model') }}
|
||||
</label>
|
||||
<div class="col-md-8">
|
||||
<!-- AssetModel name -->
|
||||
<div class="form-group">
|
||||
<label for="model" class="col-sm-3 control-label">
|
||||
{{ trans('admin/hardware/form.model') }}
|
||||
</label>
|
||||
<div class="col-md-8">
|
||||
|
||||
<p class="form-control-static">
|
||||
@if (($asset->model) && ($asset->model->name))
|
||||
{{ $asset->model->name }}
|
||||
@else
|
||||
<span class="text-danger text-bold">
|
||||
<p class="form-control-static">
|
||||
@if (($asset->model) && ($asset->model->name))
|
||||
{{ $asset->model->name }}
|
||||
@else
|
||||
<span class="text-danger text-bold">
|
||||
<i class="fas fa-exclamation-triangle" aria-hidden="true"></i>
|
||||
{{ 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
|
||||
</p>
|
||||
{{ trans('admin/hardware/general.model_invalid_fix')}}
|
||||
<a href="{{ route('hardware.edit', $asset->id) }}">
|
||||
<strong>{{ trans('admin/hardware/general.edit') }}</strong>
|
||||
</a>
|
||||
@endif
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Asset Name -->
|
||||
<div class="form-group {{ $errors->has('name') ? 'error' : '' }}">
|
||||
<label for="name" class="col-sm-3 control-label">
|
||||
{{ trans('general.name') }}
|
||||
</label>
|
||||
<div class="col-md-8">
|
||||
<input class="form-control" type="text" name="name" aria-label="name" id="name" value="{{ old('name', $asset->name) }}"/>
|
||||
{!! $errors->first('name', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
<!-- Asset Name -->
|
||||
<div class="form-group {{ $errors->has('name') ? 'error' : '' }}">
|
||||
<label for="name" class="col-sm-3 control-label">
|
||||
{{ trans('general.name') }}
|
||||
</label>
|
||||
<div class="col-md-8">
|
||||
<input class="form-control" type="text" name="name" aria-label="name"
|
||||
id="name" value="{{ old('name', $asset->name) }}"/>
|
||||
{!! $errors->first('name', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Status -->
|
||||
<div class="form-group {{ $errors->has('status_id') ? 'error' : '' }}">
|
||||
<label for="status_id" class="col-sm-3 control-label">
|
||||
{{ trans('admin/hardware/form.status') }}
|
||||
</label>
|
||||
<div class="col-md-8 required">
|
||||
{{ Form::select('status_id', $statusLabel_list, '', array('class'=>'select2', 'style'=>'width:100%','id' =>'modal-statuslabel_types', 'aria-label'=>'status_id')) }}
|
||||
{!! $errors->first('status_id', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
<!-- Status -->
|
||||
<div class="form-group {{ $errors->has('status_id') ? 'error' : '' }}">
|
||||
<label for="status_id" class="col-sm-3 control-label">
|
||||
{{ trans('admin/hardware/form.status') }}
|
||||
</label>
|
||||
<div class="col-md-8 required">
|
||||
{{ Form::select('status_id', $statusLabel_list, '', array('class'=>'select2', 'style'=>'width:100%','id' =>'modal-statuslabel_types', 'aria-label'=>'status_id')) }}
|
||||
{!! $errors->first('status_id', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'location_id', 'help_text' => ($asset->defaultLoc) ? trans('general.checkin_to_diff_location', ['default_location' => $asset->defaultLoc->name]) : null, 'hide_location_radio' => true])
|
||||
@include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'location_id', 'help_text' => ($asset->defaultLoc) ? trans('general.checkin_to_diff_location', ['default_location' => $asset->defaultLoc->name]) : null, 'hide_location_radio' => true])
|
||||
|
||||
<!-- Checkout/Checkin Date -->
|
||||
<div class="form-group{{ $errors->has('checkin_at') ? ' has-error' : '' }}">
|
||||
<label for="checkin_at" class="col-sm-3 control-label">
|
||||
{{ trans('admin/hardware/form.checkin_date') }}
|
||||
</label>
|
||||
<!-- Checkout/Checkin Date -->
|
||||
<div class="form-group{{ $errors->has('checkin_at') ? ' has-error' : '' }}">
|
||||
<label for="checkin_at" class="col-sm-3 control-label">
|
||||
{{ trans('admin/hardware/form.checkin_date') }}
|
||||
</label>
|
||||
|
||||
<div class="col-md-8">
|
||||
<div class="input-group col-md-5 required">
|
||||
<div class="input-group date" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-autoclose="true">
|
||||
<input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="checkin_at" id="checkin_at" value="{{ old('checkin_at', date('Y-m-d')) }}">
|
||||
<span class="input-group-addon"><i class="fas fa-calendar" aria-hidden="true"></i></span>
|
||||
</div>
|
||||
{!! $errors->first('checkin_at', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="input-group col-md-5 required">
|
||||
<div class="input-group date" data-provide="datepicker"
|
||||
data-date-format="yyyy-mm-dd" data-autoclose="true">
|
||||
<input type="text" class="form-control"
|
||||
placeholder="{{ trans('general.select_date') }}"
|
||||
name="checkin_at" id="checkin_at"
|
||||
value="{{ old('checkin_at', date('Y-m-d')) }}">
|
||||
<span class="input-group-addon"><i class="fas fa-calendar"
|
||||
aria-hidden="true"></i></span>
|
||||
</div>
|
||||
{!! $errors->first('checkin_at', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</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', $asset->note) }}</textarea>
|
||||
{!! $errors->first('note', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</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', $asset->note) }}</textarea>
|
||||
{!! $errors->first('note', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
</div> <!--/.box-body-->
|
||||
</div> <!--/.box-body-->
|
||||
|
||||
@include ('partials.forms.redirect_submit_options',
|
||||
[
|
||||
'route' => 'hardware.index',
|
||||
'table_name' => $table_name,
|
||||
'type'=> ($asset->model ? $asset->model->name : trans('general.asset_model')),
|
||||
'checkin' => true
|
||||
])
|
||||
</form>
|
||||
<x-redirect_submit_options
|
||||
route="hardware.index"
|
||||
:button_label="trans('general.checkout')"
|
||||
:disabled_select="!$asset->model"
|
||||
:options="[
|
||||
'index' => trans('admin/hardware/form.redirect_to_all', ['type' => 'assets']),
|
||||
'item' => trans('admin/hardware/form.redirect_to_type', ['type' => trans('general.asset')]),
|
||||
]"
|
||||
/>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@stop
|
|
@ -25,7 +25,7 @@
|
|||
<h2 class="box-title"> {{ trans('admin/hardware/form.tag') }} {{ $asset->asset_tag }}</h2>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
{{csrf_field()}}
|
||||
{{csrf_field()}}
|
||||
@if ($asset->company && $asset->company->name)
|
||||
<div class="form-group">
|
||||
<label for="company" class="col-md-3 control-label">
|
||||
|
@ -70,7 +70,8 @@
|
|||
</label>
|
||||
|
||||
<div class="col-md-8">
|
||||
<input class="form-control" type="text" name="name" id="name" value="{{ old('name', $asset->name) }}" tabindex="1">
|
||||
<input class="form-control" type="text" name="name" id="name"
|
||||
value="{{ old('name', $asset->name) }}" tabindex="1">
|
||||
{!! $errors->first('name', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -86,26 +87,30 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
@include ('partials.forms.checkout-selector', ['user_select' => 'true','asset_select' => 'true', 'location_select' => 'true'])
|
||||
@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', 'required'=>'true'])
|
||||
@include ('partials.forms.edit.user-select', ['translated_name' => trans('general.user'), 'fieldname' => 'assigned_user', 'required'=>'true'])
|
||||
|
||||
<!-- 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'), 'fieldname' => 'assigned_asset', 'unselect' => 'true', 'style' => 'display:none;', 'required'=>'true'])
|
||||
<!-- 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'), 'fieldname' => 'assigned_asset', 'unselect' => 'true', 'style' => 'display:none;', 'required'=>'true'])
|
||||
|
||||
@include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'assigned_location', 'style' => 'display:none;', 'required'=>'true'])
|
||||
@include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'assigned_location', 'style' => 'display:none;', 'required'=>'true'])
|
||||
|
||||
|
||||
|
||||
<!-- Checkout/Checkin Date -->
|
||||
<!-- 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-7" 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', date('Y-m-d')) }}">
|
||||
<span class="input-group-addon"><i class="fas fa-calendar" aria-hidden="true"></i></span>
|
||||
<div class="input-group date col-md-7" 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', date('Y-m-d')) }}">
|
||||
<span class="input-group-addon"><i class="fas fa-calendar"
|
||||
aria-hidden="true"></i></span>
|
||||
</div>
|
||||
{!! $errors->first('checkout_at', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
|
@ -118,9 +123,13 @@
|
|||
</label>
|
||||
|
||||
<div class="col-md-8">
|
||||
<div class="input-group date col-md-7" 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"><i class="fas fa-calendar" aria-hidden="true"></i></span>
|
||||
<div class="input-group date col-md-7" 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"><i class="fas fa-calendar"
|
||||
aria-hidden="true"></i></span>
|
||||
</div>
|
||||
{!! $errors->first('expected_checkin', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
|
@ -132,7 +141,8 @@
|
|||
{{ trans('general.notes') }}
|
||||
</label>
|
||||
<div class="col-md-8">
|
||||
<textarea class="col-md-6 form-control" id="note" name="note">{{ old('note', $asset->note) }}</textarea>
|
||||
<textarea class="col-md-6 form-control" id="note"
|
||||
name="note">{{ old('note', $asset->note) }}</textarea>
|
||||
{!! $errors->first('note', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -164,13 +174,19 @@
|
|||
@endif
|
||||
|
||||
</div> <!--/.box-body-->
|
||||
@include ('partials.forms.redirect_submit_options',
|
||||
[
|
||||
'route' => 'hardware.index',
|
||||
'table_name' => $table_name,
|
||||
'type'=> ($asset->model ? $asset->model->name : trans('general.asset_model')),
|
||||
'checkin' => false
|
||||
])
|
||||
|
||||
<x-redirect_submit_options
|
||||
route="hardware.index"
|
||||
:button_label="trans('general.checkout')"
|
||||
:disabled_select="!$asset->model"
|
||||
:options="[
|
||||
'index' => trans('admin/hardware/form.redirect_to_all', ['type' => 'assets']),
|
||||
'item' => trans('admin/hardware/form.redirect_to_type', ['type' => trans('general.asset')]),
|
||||
'target' => trans('admin/hardware/form.redirect_to_checked_out_to'),
|
||||
|
||||
]"
|
||||
/>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div> <!--/.col-md-7-->
|
||||
|
|
|
@ -6,6 +6,10 @@
|
|||
'helpText' => trans('help.assets'),
|
||||
'helpPosition' => 'right',
|
||||
'formAction' => ($item->id) ? route('hardware.update', ['hardware' => $item->id]) : route('hardware.store'),
|
||||
'options' => [
|
||||
'index' => trans('admin/hardware/form.redirect_to_all', ['type' => 'assets']),
|
||||
'item' => trans('admin/hardware/form.redirect_to_type', ['type' => trans('general.asset')]),
|
||||
]
|
||||
])
|
||||
|
||||
|
||||
|
@ -130,8 +134,6 @@
|
|||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- byod checkbox -->
|
||||
<div class="form-group">
|
||||
<div class="col-md-7 col-md-offset-3">
|
||||
|
|
|
@ -66,7 +66,11 @@
|
|||
<!-- CSRF Token -->
|
||||
{{ csrf_field() }}
|
||||
@yield('inputFields')
|
||||
@include('partials.forms.edit.submit')
|
||||
<x-redirect_submit_options
|
||||
route="hardware.index"
|
||||
:button_label="trans('general.save')"
|
||||
:options="$options ?? []"
|
||||
/>
|
||||
</div>
|
||||
|
||||
</div> <!-- ./box-body -->
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
<!-- begin redirect submit options -->
|
||||
|
||||
<div class="box-footer">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-3">
|
||||
<a class="btn btn-link" href="{{ route($route) }}">{{ trans('button.cancel') }}</a>
|
||||
</div>
|
||||
|
||||
<div class="col-md-9 text-right">
|
||||
<div class="btn-group text-left">
|
||||
|
||||
<select class="redirect-options form-control select2" data-minimum-results-for-search="Infinity" name="redirect_option" style="min-width: 200px"{{ (!$asset->model ? ' disabled' : '') }}>
|
||||
|
||||
<option {{ (Session::get('redirect_option')=="0" || (Session::get('redirect_option')=="2" && $checkin)) ? 'selected' : '' }} value="0">
|
||||
{{ trans('admin/hardware/form.redirect_to_all', ['type' => $table_name]) }}
|
||||
</option>
|
||||
<option {{ Session::get('redirect_option')=="1" ? 'selected' : ''}} value="1">
|
||||
{{ trans('admin/hardware/form.redirect_to_type', ['type' => $type]) }}
|
||||
</option>
|
||||
<option {{ Session::get('redirect_option')=="2" && !$checkin ? 'selected' : ''}}{{ $checkin ? 'hidden disabled' : '' }} value="2" >
|
||||
{{ !$checkin ? trans('admin/hardware/form.redirect_to_checked_out_to') : '' }}
|
||||
</option>
|
||||
|
||||
</select>
|
||||
|
||||
<button type="submit" class="btn btn-primary pull-right{{ (!$asset->model ? ' disabled' : '') }}" style="margin-left:5px; border-radius: 3px;"{!! (!$asset->model ? ' data-tooltip="true" title="'.trans('admin/hardware/general.edit').'" disabled' : '') !!}>
|
||||
<i class="fas fa-check icon-white" aria-hidden="true"></i>
|
||||
{{ $checkin ? trans('general.checkin') : trans('general.checkout') }}
|
||||
</button>
|
||||
|
||||
</div><!-- /.btn-group -->
|
||||
</div><!-- /.col-md-9 -->
|
||||
</div><!-- /.row -->
|
||||
</div> <!-- /.box-footer -->
|
||||
<!-- end redirect submit options -->
|
Loading…
Reference in a new issue