From e73b16846e79284751c39c101aa5d4f701d13e73 Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Mon, 11 Sep 2023 11:21:56 -0700 Subject: [PATCH] adds an option to bulk edit actual location for bulk edit and fixes update issue --- app/Http/Controllers/Assets/BulkAssetsController.php | 8 +++++++- resources/lang/en/admin/hardware/form.php | 1 + resources/views/hardware/bulk.blade.php | 8 ++++++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Assets/BulkAssetsController.php b/app/Http/Controllers/Assets/BulkAssetsController.php index a744db578..c3c7e21ab 100644 --- a/app/Http/Controllers/Assets/BulkAssetsController.php +++ b/app/Http/Controllers/Assets/BulkAssetsController.php @@ -189,9 +189,15 @@ class BulkAssetsController extends Controller } if ($request->filled('rtd_location_id')) { - $this->update_array['rtd_location_id'] = $request->input('rtd_location_id'); + if (($request->filled('update_real_loc')) && (($request->input('update_real_loc')) == '0')) { + $this->update_array['rtd_location_id'] = $request->input('rtd_location_id'); + } if (($request->filled('update_real_loc')) && (($request->input('update_real_loc')) == '1')) { $this->update_array['location_id'] = $request->input('rtd_location_id'); + $this->update_array['rtd_location_id'] = $request->input('rtd_location_id'); + } + if (($request->filled('update_real_loc')) && (($request->input('update_real_loc')) == '2')) { + $this->update_array['location_id'] = $request->input('rtd_location_id'); } } diff --git a/resources/lang/en/admin/hardware/form.php b/resources/lang/en/admin/hardware/form.php index ef877c837..ee3fa20fb 100644 --- a/resources/lang/en/admin/hardware/form.php +++ b/resources/lang/en/admin/hardware/form.php @@ -49,6 +49,7 @@ return [ 'asset_location' => 'Update Asset Location', 'asset_location_update_default_current' => 'Update default location AND actual location', '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_deployable' => 'That status is deployable. This asset can be checked out.', 'processing_spinner' => 'Processing... (This might take a bit of time on large files)', diff --git a/resources/views/hardware/bulk.blade.php b/resources/views/hardware/bulk.blade.php index 667126ec9..e26b95705 100755 --- a/resources/views/hardware/bulk.blade.php +++ b/resources/views/hardware/bulk.blade.php @@ -92,9 +92,13 @@ {{ Form::radio('update_real_loc', '1', old('update_real_loc'), ['checked'=> 'checked', 'aria-label'=>'update_real_loc']) }} {{ trans('admin/hardware/form.asset_location_update_default_current') }} +