3
0
mirror of https://github.com/snipe/snipe-it.git synced 2026-02-04 20:25:43 +00:00

Use blade component for redirect option

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe
2024-07-25 21:35:13 +01:00
parent f77d300549
commit 73a80a5fbc
8 changed files with 213 additions and 170 deletions

View File

@ -1490,22 +1490,24 @@ class Helper
$redirect_option = Session::get('redirect_option');
$checkout_to_type = Session::get('checkout_to_type');
//return to index
if ($redirect_option == '0') {
// return to index
if ($redirect_option == 'index') {
switch ($table) {
case "Assets":
return redirect()->route('hardware.index')->with('success', trans('admin/hardware/message.checkout.success'));
}
}
//return to thing being assigned
if ($redirect_option == '1') {
// return to thing being assigned
if ($redirect_option == 'item') {
switch ($table) {
case "Assets":
return redirect()->route('hardware.show', $id ? $id : $asset_id)->with('success', trans('admin/hardware/message.checkout.success'));
}
}
//return to thing being assigned to
if ($redirect_option == '2') {
// return to assignment target
if ($redirect_option == 'target') {
switch ($checkout_to_type) {
case 'user':
return redirect()->route('users.show', $request->assigned_user)->with('success', trans('admin/hardware/message.checkout.success'));