From 0b3ac2a9cd21720cc3b1dc041fd4d16fc7eff715 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 14 Aug 2024 12:08:49 +0100 Subject: [PATCH 1/5] Updated phpinsights Signed-off-by: snipe --- composer.json | 2 +- composer.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 5467e94e3..a72d80839 100644 --- a/composer.json +++ b/composer.json @@ -78,7 +78,7 @@ "fakerphp/faker": "^1.16", "larastan/larastan": "^2.9", "mockery/mockery": "^1.4", - "nunomaduro/phpinsights": "^2.7", + "nunomaduro/phpinsights": "^2.11", "php-mock/php-mock-phpunit": "^2.10", "phpunit/phpunit": "^10.0", "squizlabs/php_codesniffer": "^3.5", diff --git a/composer.lock b/composer.lock index f7c46672d..715070df0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "35c741a2d3300848d758b187554b5b17", + "content-hash": "3819ab4ef72eb77fabe494c0e746b83b", "packages": [ { "name": "alek13/slack", From 01c69c8f8f974df179a1d5fb89d7b0595b8269ba Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 15 Aug 2024 10:08:48 +0100 Subject: [PATCH 2/5] Allow optional status label on quickscan checkin Signed-off-by: snipe --- app/Http/Controllers/Api/AssetsController.php | 4 ++-- .../Controllers/Assets/AssetsController.php | 4 ++-- resources/lang/en-US/general.php | 1 + .../views/hardware/quickscan-checkin.blade.php | 17 ++++++++++++++--- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.php index 8361971d5..855bc5126 100644 --- a/app/Http/Controllers/Api/AssetsController.php +++ b/app/Http/Controllers/Api/AssetsController.php @@ -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'); } @@ -978,7 +978,7 @@ class AssetsController extends Controller public function checkinByTag(Request $request, $tag = null) : JsonResponse { $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'); } $asset = Asset::where('asset_tag', $tag)->first(); diff --git a/app/Http/Controllers/Assets/AssetsController.php b/app/Http/Controllers/Assets/AssetsController.php index 2430cd00f..ee0f7dbec 100755 --- a/app/Http/Controllers/Assets/AssetsController.php +++ b/app/Http/Controllers/Assets/AssetsController.php @@ -837,14 +837,14 @@ class AssetsController extends Controller $this->authorize('audit', Asset::class); $dt = Carbon::now()->addMonths(12)->toDateString(); - return view('hardware/quickscan')->with('next_audit_date', $dt); + return view('hardware/quickscan')->with('statusLabel_list', Helper::statusLabelList())->with('next_audit_date', $dt); } public function quickScanCheckin() { $this->authorize('checkin', Asset::class); - return view('hardware/quickscan-checkin'); + return view('hardware/quickscan-checkin')->with('statusLabel_list', Helper::statusLabelList()); } public function audit($id) diff --git a/resources/lang/en-US/general.php b/resources/lang/en-US/general.php index 255a1564d..444ed5408 100644 --- a/resources/lang/en-US/general.php +++ b/resources/lang/en-US/general.php @@ -279,6 +279,7 @@ return [ 'site_name' => 'Site Name', 'state' => 'State', 'status_labels' => 'Status Labels', + 'status_label' => 'Status Label', 'status' => 'Status', 'accept_eula' => 'Acceptance Agreement', 'supplier' => 'Supplier', diff --git a/resources/views/hardware/quickscan-checkin.blade.php b/resources/views/hardware/quickscan-checkin.blade.php index d71f4e9cb..43c6d318f 100644 --- a/resources/views/hardware/quickscan-checkin.blade.php +++ b/resources/views/hardware/quickscan-checkin.blade.php @@ -33,14 +33,25 @@
{{ Form::label('asset_tag', trans('general.asset_tag'), array('class' => 'col-md-3 control-label', 'id' => 'checkin_tag')) }}
-
- +
+
{!! $errors->first('asset_tag', '') !!}
- + + +
+ +
+ {{ Form::select('status_id', $statusLabel_list, '', array('class'=>'select2', 'style'=>'width:100%','', 'aria-label'=>'status_id')) }} + {!! $errors->first('status_id', '') !!} +
+
+ @include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'location_id']) From d268f25f16268492e7b9c07aa8746dbc6e7e9438 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 15 Aug 2024 10:16:57 +0100 Subject: [PATCH 3/5] Make asset tag required Signed-off-by: snipe --- resources/views/hardware/quickscan.blade.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/resources/views/hardware/quickscan.blade.php b/resources/views/hardware/quickscan.blade.php index 32166b64f..e4f6c8a55 100644 --- a/resources/views/hardware/quickscan.blade.php +++ b/resources/views/hardware/quickscan.blade.php @@ -31,7 +31,7 @@
{{ Form::label('asset_tag', trans('general.asset_tag'), array('class' => 'col-md-3 control-label', 'id' => 'audit_tag')) }}
-
+
@@ -49,10 +49,13 @@
- +
From d8038ac483a38770de9108df5c9da8358247a62e Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 15 Aug 2024 10:17:08 +0100 Subject: [PATCH 4/5] Removed status label list Signed-off-by: snipe --- app/Http/Controllers/Assets/AssetsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Assets/AssetsController.php b/app/Http/Controllers/Assets/AssetsController.php index ee0f7dbec..75646e726 100755 --- a/app/Http/Controllers/Assets/AssetsController.php +++ b/app/Http/Controllers/Assets/AssetsController.php @@ -837,7 +837,7 @@ class AssetsController extends Controller $this->authorize('audit', Asset::class); $dt = Carbon::now()->addMonths(12)->toDateString(); - return view('hardware/quickscan')->with('statusLabel_list', Helper::statusLabelList())->with('next_audit_date', $dt); + return view('hardware/quickscan')->with('next_audit_date', $dt); } public function quickScanCheckin() From 381003eeabf7861a877ea20dd77af53fae762209 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 15 Aug 2024 10:27:31 +0100 Subject: [PATCH 5/5] Cleaned up asset tag field on quickscan checkin Signed-off-by: snipe --- resources/views/hardware/quickscan-checkin.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/hardware/quickscan-checkin.blade.php b/resources/views/hardware/quickscan-checkin.blade.php index 43c6d318f..ec6ef5719 100644 --- a/resources/views/hardware/quickscan-checkin.blade.php +++ b/resources/views/hardware/quickscan-checkin.blade.php @@ -33,7 +33,7 @@
{{ Form::label('asset_tag', trans('general.asset_tag'), array('class' => 'col-md-3 control-label', 'id' => 'checkin_tag')) }}
-
+