Skip to content

A free open source IT asset/license management system

allows to change the status to pending in bulk edit while deployed

Godfrey Mfe006d05d3c2
diff --git a/app/Http/Controllers/Assets/BulkAssetsController.php b/app/Http/Controllers/Assets/BulkAssetsController.php
index 124afa6f75..c1cba08aae 100644
--- a/app/Http/Controllers/Assets/BulkAssetsController.php
+++ b/app/Http/Controllers/Assets/BulkAssetsController.php
@@ -374,10 +374,12 @@ class BulkAssetsController extends Controller
// This could probably be added to a form request.
// If the asset isn't assigned, we don't care what the status is.
// Otherwise we need to make sure the status type is still a deployable one.
- if (
- ($asset->assigned_to == '')
- || ($updated_status->deployable == '1') && ($asset->assetstatus?->deployable == '1')
- ) {
+
+ $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;
}