Merge pull request #14552 from snipe/bug/sc-25229/redirect_if_already_checked_in

Redirect on checkin if the asset is already checked in
This commit is contained in:
snipe 2024-04-04 15:01:43 +01:00 committed by GitHub
commit db1c44f921
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -39,6 +39,12 @@ class AssetCheckinController extends Controller
$this->authorize('checkin', $asset); $this->authorize('checkin', $asset);
// This asset is already checked in, redirect
if (is_null($asset->assignedTo)) {
return redirect()->route('hardware.index')->with('error', trans('admin/hardware/message.checkin.already_checked_in'));
}
return view('hardware/checkin', compact('asset'))->with('statusLabel_list', Helper::statusLabelList())->with('backto', $backto); return view('hardware/checkin', compact('asset'))->with('statusLabel_list', Helper::statusLabelList())->with('backto', $backto);
} }