From 2216b83ca70bedb0790cc36c9041d7f5de42b8b3 Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Wed, 5 Nov 2025 11:16:35 -0800 Subject: [PATCH 1/4] get warning/success status check to display --- .../Assets/BulkAssetsController.php | 1 - resources/lang/en-US/admin/hardware/form.php | 2 +- resources/views/hardware/bulk.blade.php | 35 +++++++++++++++++++ 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Assets/BulkAssetsController.php b/app/Http/Controllers/Assets/BulkAssetsController.php index 55fbe82cc9c7..2d8ae1c3c4de 100644 --- a/app/Http/Controllers/Assets/BulkAssetsController.php +++ b/app/Http/Controllers/Assets/BulkAssetsController.php @@ -409,7 +409,6 @@ public function update(Request $request) : RedirectResponse $unassigned = $asset->assigned_to == ''; $deployable = $updated_status->deployable == '1' && $asset->assetstatus?->deployable == '1'; $pending = $updated_status->pending === 1; - if ($unassigned || $deployable || $pending) { $this->update_array['status_id'] = $updated_status->id; } diff --git a/resources/lang/en-US/admin/hardware/form.php b/resources/lang/en-US/admin/hardware/form.php index dc4754e71a9d..fd19fb4d70c8 100644 --- a/resources/lang/en-US/admin/hardware/form.php +++ b/resources/lang/en-US/admin/hardware/form.php @@ -57,7 +57,7 @@ 'asset_location_update_default' => 'Update only default location', 'asset_location_update_actual' => 'Update only actual location', 'asset_not_deployable' => 'That asset status is not deployable. This asset cannot be checked out.', - 'asset_not_deployable_checkin' => 'That asset status is not deployable. Using this status label will checkin the asset.', + 'asset_not_deployable_checkin' => '{1} That asset status is not deployable. Using this status label will check in the asset.|[2,*] That asset status in not deployable. Using this status label will check in all checked out assets.', 'asset_deployable' => 'This asset can be checked out.', 'processing_spinner' => 'Processing... (This might take a bit of time on large files)', 'processing' => 'Processing... ', diff --git a/resources/views/hardware/bulk.blade.php b/resources/views/hardware/bulk.blade.php index 2b18bb0e1c7e..d69ee06c4306 100755 --- a/resources/views/hardware/bulk.blade.php +++ b/resources/views/hardware/bulk.blade.php @@ -133,6 +133,7 @@ aria-label="status_id" />

{{ trans('general.status_compatibility') }}

+ {!! $errors->first('status_id', '') !!} @@ -288,5 +289,39 @@ }); }); }); + function status_check() { + var status_id = $('select[name="status_id"]').val(); + if (status_id != '') { + $(".status_spinner").css("display", "inline"); + $.ajax({ + url: "{{config('app.url') }}/api/v1/statuslabels/" + status_id + "/deployable", + headers: { + "X-Requested-With": 'XMLHttpRequest', + "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content') + }, + success: function (data) { + $(".status_spinner").css("display", "none"); + $("#selected_status_status").fadeIn(); + + if (data == true) { + $("#selected_status_status").removeClass('text-danger'); + $("#selected_status_status").addClass('text-success'); + $("#selected_status_status").html(' {{ trans('admin/hardware/form.asset_deployable')}}'); + + + } else { + $("#assignto_selector").hide(); + $("#selected_status_status").removeClass('text-success'); + $("#selected_status_status").addClass('text-danger'); + $("#selected_status_status").html(' {{ trans_choice('admin/hardware/form.asset_not_deployable_checkin', 2) }} '); + } + } + }); + } + } + $(function () { + $('select[name="status_id"]').on('change', status_check); + }); + @endsection From 776c7caaa5cce24f42801484ed5d700945e1d59c Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Wed, 5 Nov 2025 11:19:05 -0800 Subject: [PATCH 2/4] get warning/success status check to display --- resources/lang/en-US/admin/hardware/form.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/en-US/admin/hardware/form.php b/resources/lang/en-US/admin/hardware/form.php index fd19fb4d70c8..8b6f6a72c3a5 100644 --- a/resources/lang/en-US/admin/hardware/form.php +++ b/resources/lang/en-US/admin/hardware/form.php @@ -57,7 +57,7 @@ 'asset_location_update_default' => 'Update only default location', 'asset_location_update_actual' => 'Update only actual location', 'asset_not_deployable' => 'That asset status is not deployable. This asset cannot be checked out.', - 'asset_not_deployable_checkin' => '{1} That asset status is not deployable. Using this status label will check in the asset.|[2,*] That asset status in not deployable. Using this status label will check in all checked out assets.', + 'asset_not_deployable_checkin' => '{1} That asset status is not deployable. Using this status label will check in the asset.|[2,*] That asset status in not deployable. Using this status label will result in no change.', 'asset_deployable' => 'This asset can be checked out.', 'processing_spinner' => 'Processing... (This might take a bit of time on large files)', 'processing' => 'Processing... ', From 9348204987407818d803a842e7d6cd0408e3d0e3 Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Wed, 5 Nov 2025 11:22:11 -0800 Subject: [PATCH 3/4] remove spacing adjustment --- app/Http/Controllers/Assets/BulkAssetsController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Http/Controllers/Assets/BulkAssetsController.php b/app/Http/Controllers/Assets/BulkAssetsController.php index 2d8ae1c3c4de..55fbe82cc9c7 100644 --- a/app/Http/Controllers/Assets/BulkAssetsController.php +++ b/app/Http/Controllers/Assets/BulkAssetsController.php @@ -409,6 +409,7 @@ public function update(Request $request) : RedirectResponse $unassigned = $asset->assigned_to == ''; $deployable = $updated_status->deployable == '1' && $asset->assetstatus?->deployable == '1'; $pending = $updated_status->pending === 1; + if ($unassigned || $deployable || $pending) { $this->update_array['status_id'] = $updated_status->id; } From 6faf1710075f92fedc877e0c7a8c8fb5b2224026 Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Mon, 10 Nov 2025 16:58:42 -0800 Subject: [PATCH 4/4] update asset_deployable translation --- resources/lang/en-US/admin/hardware/form.php | 2 +- resources/views/hardware/bulk.blade.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/lang/en-US/admin/hardware/form.php b/resources/lang/en-US/admin/hardware/form.php index 8b6f6a72c3a5..8210b91d2334 100644 --- a/resources/lang/en-US/admin/hardware/form.php +++ b/resources/lang/en-US/admin/hardware/form.php @@ -58,7 +58,7 @@ 'asset_location_update_actual' => 'Update only actual location', 'asset_not_deployable' => 'That asset status is not deployable. This asset cannot be checked out.', 'asset_not_deployable_checkin' => '{1} That asset status is not deployable. Using this status label will check in the asset.|[2,*] That asset status in not deployable. Using this status label will result in no change.', - 'asset_deployable' => 'This asset can be checked out.', + 'asset_deployable' => '{1} This asset can be checked out.|[2,*] These assets can be checked out.', 'processing_spinner' => 'Processing... (This might take a bit of time on large files)', 'processing' => 'Processing... ', 'optional_infos' => 'Optional Information', diff --git a/resources/views/hardware/bulk.blade.php b/resources/views/hardware/bulk.blade.php index d69ee06c4306..ee8dc577e89e 100755 --- a/resources/views/hardware/bulk.blade.php +++ b/resources/views/hardware/bulk.blade.php @@ -306,7 +306,7 @@ function status_check() { if (data == true) { $("#selected_status_status").removeClass('text-danger'); $("#selected_status_status").addClass('text-success'); - $("#selected_status_status").html(' {{ trans('admin/hardware/form.asset_deployable')}}'); + $("#selected_status_status").html(' {{ trans_choice('admin/hardware/form.asset_deployable', 2)}}'); } else {