Skip to content

A free open source IT asset/license management system

Allow checkout to non-user objects even if the object requires checkout

snipe15916e66684d
diff --git a/app/Models/Asset.php b/app/Models/Asset.php
index 6a4398b2e3..5595b2d2b1 100644
--- a/app/Models/Asset.php
+++ b/app/Models/Asset.php
@@ -189,13 +189,7 @@ class Asset extends Depreciable
$this->location_id = $target->location->id;
}
}
-
- if ($this->requireAcceptance()) {
- if(get_class($target) != User::class) {
- throw new CheckoutNotAllowed;
- }
- $this->accepted="pending";
- }
+
if ($this->save()) {
$this->logCheckout($note, $target);
diff --git a/resources/views/hardware/checkout.blade.php b/resources/views/hardware/checkout.blade.php
index 1823db3863..4a5203c36d 100755
--- a/resources/views/hardware/checkout.blade.php
+++ b/resources/views/hardware/checkout.blade.php
@@ -47,23 +47,13 @@
@include ('partials.forms.checkout-selector', ['user_select' => 'true','asset_select' => 'true', 'location_select' => 'true'])
@include ('partials.forms.edit.user-select', ['translated_name' => trans('general.user'), 'fieldname' => 'assigned_user', 'required'=>'true'])
- @if ($asset->requireAcceptance())
- <div class="form-group">
- <div class="col-md-8 col-md-offset-3">
- <p class="help-block">
- Because this asset category requires acceptance,
- it cannot be checked out to another asset or to a location.
- </p>
- </div>
- </div>
- @else
<!-- We have to pass unselect here so that we don't default to the asset that's being checked out. We want that asset to be pre-selected everywhere else. -->
@include ('partials.forms.edit.asset-select', ['translated_name' => trans('general.asset'), 'fieldname' => 'assigned_asset', 'unselect' => 'true', 'style' => 'display:none;', 'required'=>'true'])
@include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'assigned_location', 'style' => 'display:none;', 'required'=>'true'])
- @endif
+
<!-- Checkout/Checkin Date -->
<div class="form-group {{ $errors->has('checkout_at') ? 'error' : '' }}">