added other target options to accessories and assets

This commit is contained in:
Godfrey M
2025-04-09 10:50:42 -07:00
parent 715fc2de59
commit 9824f43780
7 changed files with 35 additions and 18 deletions
+4 -4
View File
@@ -1480,7 +1480,7 @@ class Helper
$redirect_option = Session::get('redirect_option');
$checkout_to_type = Session::get('checkout_to_type');
$checkedInBy = Session::get('checkedInBy');
$checkedInFrom = Session::get('checkedInFrom');
// return to index
if ($redirect_option == 'index') {
@@ -1522,11 +1522,11 @@ class Helper
if ($redirect_option == 'target') {
switch ($checkout_to_type) {
case 'user':
return route('users.show', $request->assigned_user ?? $checkedInBy);
return route('users.show', $request->assigned_user ?? $checkedInFrom);
case 'location':
return route('locations.show', $request->assigned_location);
return route('locations.show', $request->assigned_location ?? $checkedInFrom);
case 'asset':
return route('hardware.show', $request->assigned_asset);
return route('hardware.show', $request->assigned_asset ?? $checkedInFrom);
}
}
return redirect()->back()->with('error', trans('admin/hardware/message.checkout.error'));