Merge remote-tracking branch 'origin/develop'

This commit is contained in:
snipe 2024-08-15 10:28:08 +01:00
commit 6c0cf94473
7 changed files with 26 additions and 11 deletions

View file

@ -928,7 +928,7 @@ class AssetsController extends Controller
} }
} }
if ($request->has('status_id')) { if ($request->filled('status_id')) {
$asset->status_id = $request->input('status_id'); $asset->status_id = $request->input('status_id');
} }
@ -978,7 +978,7 @@ class AssetsController extends Controller
public function checkinByTag(Request $request, $tag = null) : JsonResponse public function checkinByTag(Request $request, $tag = null) : JsonResponse
{ {
$this->authorize('checkin', Asset::class); $this->authorize('checkin', Asset::class);
if(null == $tag && null !== ($request->input('asset_tag'))) { if (null == $tag && null !== ($request->input('asset_tag'))) {
$tag = $request->input('asset_tag'); $tag = $request->input('asset_tag');
} }
$asset = Asset::where('asset_tag', $tag)->first(); $asset = Asset::where('asset_tag', $tag)->first();

View file

@ -844,7 +844,7 @@ class AssetsController extends Controller
{ {
$this->authorize('checkin', Asset::class); $this->authorize('checkin', Asset::class);
return view('hardware/quickscan-checkin'); return view('hardware/quickscan-checkin')->with('statusLabel_list', Helper::statusLabelList());
} }
public function audit($id) public function audit($id)

View file

@ -78,7 +78,7 @@
"fakerphp/faker": "^1.16", "fakerphp/faker": "^1.16",
"larastan/larastan": "^2.9", "larastan/larastan": "^2.9",
"mockery/mockery": "^1.4", "mockery/mockery": "^1.4",
"nunomaduro/phpinsights": "^2.7", "nunomaduro/phpinsights": "^2.11",
"php-mock/php-mock-phpunit": "^2.10", "php-mock/php-mock-phpunit": "^2.10",
"phpunit/phpunit": "^10.0", "phpunit/phpunit": "^10.0",
"squizlabs/php_codesniffer": "^3.5", "squizlabs/php_codesniffer": "^3.5",

2
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "35c741a2d3300848d758b187554b5b17", "content-hash": "3819ab4ef72eb77fabe494c0e746b83b",
"packages": [ "packages": [
{ {
"name": "alek13/slack", "name": "alek13/slack",

View file

@ -279,6 +279,7 @@ return [
'site_name' => 'Site Name', 'site_name' => 'Site Name',
'state' => 'State', 'state' => 'State',
'status_labels' => 'Status Labels', 'status_labels' => 'Status Labels',
'status_label' => 'Status Label',
'status' => 'Status', 'status' => 'Status',
'accept_eula' => 'Acceptance Agreement', 'accept_eula' => 'Acceptance Agreement',
'supplier' => 'Supplier', 'supplier' => 'Supplier',

View file

@ -33,14 +33,25 @@
<div class="form-group {{ $errors->has('asset_tag') ? 'error' : '' }}"> <div class="form-group {{ $errors->has('asset_tag') ? 'error' : '' }}">
{{ Form::label('asset_tag', trans('general.asset_tag'), array('class' => 'col-md-3 control-label', 'id' => 'checkin_tag')) }} {{ Form::label('asset_tag', trans('general.asset_tag'), array('class' => 'col-md-3 control-label', 'id' => 'checkin_tag')) }}
<div class="col-md-9"> <div class="col-md-9">
<div class="input-group date col-md-5" data-date-format="yyyy-mm-dd"> <div class="input-group col-md-11 required">
<input type="text" class="form-control" name="asset_tag" id="asset_tag" value="{{ old('asset_tag') }}"> <input type="text" class="form-control" name="asset_tag" id="asset_tag" value="{{ old('asset_tag') }}" required>
</div> </div>
{!! $errors->first('asset_tag', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!} {!! $errors->first('asset_tag', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div> </div>
</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">
{{ Form::select('status_id', $statusLabel_list, '', array('class'=>'select2', 'style'=>'width:100%','', '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>
<!-- Locations --> <!-- Locations -->
@include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'location_id']) @include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'location_id'])

View file

@ -31,7 +31,7 @@
<div class="form-group {{ $errors->has('asset_tag') ? 'error' : '' }}"> <div class="form-group {{ $errors->has('asset_tag') ? 'error' : '' }}">
{{ Form::label('asset_tag', trans('general.asset_tag'), array('class' => 'col-md-3 control-label', 'id' => 'audit_tag')) }} {{ Form::label('asset_tag', trans('general.asset_tag'), array('class' => 'col-md-3 control-label', 'id' => 'audit_tag')) }}
<div class="col-md-9"> <div class="col-md-9">
<div class="input-group date col-md-5" data-date-format="yyyy-mm-dd"> <div class="input-group date col-md-11 required" data-date-format="yyyy-mm-dd">
<input type="text" class="form-control" name="asset_tag" id="asset_tag" value="{{ old('asset_tag') }}"> <input type="text" class="form-control" name="asset_tag" id="asset_tag" value="{{ old('asset_tag') }}">
</div> </div>
@ -49,10 +49,13 @@
<div class="form-group"> <div class="form-group">
<div class="col-sm-offset-3 col-md-9"> <div class="col-sm-offset-3 col-md-9">
<label class="form-control"> <label class="form-control">
<input type="checkbox" value="1" name="update_location" {{ old('update_location') == '1' ? ' checked="checked"' : '' }}> {{ trans('admin/hardware/form.asset_location') }} <input type="checkbox" value="1" name="update_location" {{ old('update_location') == '1' ? ' checked="checked"' : '' }}>
<span>{{ trans('admin/hardware/form.asset_location') }}
<a href="#" class="text-dark-gray" tabindex="0" role="button" data-toggle="popover" data-trigger="focus" title="<i class='far fa-life-ring'></i> {{ trans('general.more_info') }}" data-html="true" data-content="{{ trans('general.quickscan_bulk_help') }}"><i class="far fa-life-ring"></i></a></span>
</label> </label>
<a href="#" class="text-dark-gray" tabindex="0" role="button" data-toggle="popover" data-trigger="focus" title="<i class='far fa-life-ring'></i>"{{ trans('general.more_info') }} data-html="true" data-content="{{ trans('general.quickscan_bulk_help') }}"><i class="far fa-life-ring"></i></a>
</div> </div>
</div> </div>