From 76e664d647f7aa7d0f6471e96aceb7a7f0e87a0a Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 31 May 2024 18:47:18 +0100 Subject: [PATCH] Warn and disable the checkout button if model is invalid Signed-off-by: snipe --- resources/views/hardware/checkin.blade.php | 74 +++++++++++++--------- 1 file changed, 43 insertions(+), 31 deletions(-) diff --git a/resources/views/hardware/checkin.blade.php b/resources/views/hardware/checkin.blade.php index debfdef91c..9bd88f3f4f 100755 --- a/resources/views/hardware/checkin.blade.php +++ b/resources/views/hardware/checkin.blade.php @@ -16,50 +16,56 @@ -
+
-
-
-
-

{{ trans('admin/hardware/form.tag') }} {{ $asset->asset_tag }}

+
+
+
+

+ {{ trans('admin/hardware/form.tag') }} + {{ $asset->asset_tag }} +

-
-
- @if ($backto=='user') +
+
+ + @if ($backto == 'user') +
+ @else - @else - - @endif + action="{{ route('hardware.checkin.store', array('assetId'=> $asset->id)) }}" autocomplete="off"> + @endif {{csrf_field()}}
{{ Form::label('model', trans('admin/hardware/form.model'), array('class' => 'col-md-3 control-label')) }}
+

@if (($asset->model) && ($asset->model->name)) {{ $asset->model->name }} - @else - {{ trans('admin/hardware/general.model_invalid')}} - {{ trans('admin/hardware/general.model_invalid_fix')}} + + {{ trans('admin/hardware/general.model_invalid')}} + + {{ trans('admin/hardware/general.model_invalid_fix')}} + + {{ trans('admin/hardware/general.edit') }} + @endif

+
-
{{ Form::label('name', trans('admin/hardware/form.name'), array('class' => 'col-md-3 control-label')) }}
- + {!! $errors->first('name', '') !!}
@@ -67,7 +73,7 @@
{{ Form::label('status_id', trans('admin/hardware/form.status'), array('class' => 'col-md-3 control-label')) }} -
+
{{ Form::select('status_id', $statusLabel_list, '', array('class'=>'select2', 'style'=>'width:100%','id' =>'modal-statuslabel_types', 'aria-label'=>'status_id')) }} {!! $errors->first('status_id', '') !!}
@@ -77,7 +83,9 @@
+ {{ Form::label('checkin_at', trans('admin/hardware/form.checkin_date'), array('class' => 'col-md-3 control-label')) }} +
@@ -89,25 +97,29 @@
-
- {{ Form::label('note', trans('admin/hardware/form.notes'), array('class' => 'col-md-3 control-label')) }} -
- + {!! $errors->first('note', '') !!}
- @include ('partials.forms.redirect_submit_options', ['route' => 'hardware.index', 'table_name' => $table_name, 'type'=> $asset->model->name, 'checkin' => true]) - -
-
+
+
-
+ @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 + ]) + + +
+ @stop \ No newline at end of file