From 47b2cdb8469e6d4904f9ad3ffb34bdc6d9a196db Mon Sep 17 00:00:00 2001 From: snipe Date: Sun, 10 Nov 2024 18:04:13 +0000 Subject: [PATCH] Allow user to specify null for calculation or explicit on bulk edit Signed-off-by: snipe --- app/Http/Controllers/Assets/BulkAssetsController.php | 6 +++++- resources/lang/en-US/admin/hardware/form.php | 3 ++- resources/views/hardware/bulk.blade.php | 11 ++++++++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Assets/BulkAssetsController.php b/app/Http/Controllers/Assets/BulkAssetsController.php index 01c2cb2fa9..93f7255c0b 100644 --- a/app/Http/Controllers/Assets/BulkAssetsController.php +++ b/app/Http/Controllers/Assets/BulkAssetsController.php @@ -321,7 +321,11 @@ class BulkAssetsController extends Controller if ($request->input('null_asset_eol_date')=='1') { $this->update_array['asset_eol_date'] = null; - $this->update_array['eol_explicit'] = 1; + + // If they are nulling the EOL date to allow it to calculate, set eol explicit to 0 + if ($request->input('calc_eol')=='1') { + $this->update_array['eol_explicit'] = 0; + } } diff --git a/resources/lang/en-US/admin/hardware/form.php b/resources/lang/en-US/admin/hardware/form.php index 03b8f04add..e50a32bd06 100644 --- a/resources/lang/en-US/admin/hardware/form.php +++ b/resources/lang/en-US/admin/hardware/form.php @@ -59,5 +59,6 @@ return [ '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)', 'optional_infos' => 'Optional Information', - 'order_details' => 'Order Related Information' + 'order_details' => 'Order Related Information', + 'calc_eol' => 'If nulling the EOL date, use automatic EOL calculation based on the purchase date and EOL rate.', ]; diff --git a/resources/views/hardware/bulk.blade.php b/resources/views/hardware/bulk.blade.php index 73594ca6b2..cc44993af5 100755 --- a/resources/views/hardware/bulk.blade.php +++ b/resources/views/hardware/bulk.blade.php @@ -91,7 +91,7 @@ - +
@@ -109,6 +109,15 @@
+
+
+ +
+
+