mirror of
https://github.com/snipe/snipe-it.git
synced 2026-02-06 00:45:40 +00:00
Use updated redirect() reference
This commit is contained in:
@ -49,7 +49,7 @@ class ViewAssetsController extends Controller
|
||||
$error = trans('admin/users/message.user_not_found', compact('id'));
|
||||
|
||||
// Redirect to the user management page
|
||||
return Redirect::route('users')->with('error', $error);
|
||||
return redirect()->route('users')->with('error', $error);
|
||||
}
|
||||
|
||||
}
|
||||
@ -72,9 +72,9 @@ class ViewAssetsController extends Controller
|
||||
// Check if the asset exists and is requestable
|
||||
if (is_null($asset = Asset::RequestableAssets()->find($assetId))) {
|
||||
// Redirect to the asset management page
|
||||
return Redirect::route('requestable-assets')->with('error', trans('admin/hardware/message.does_not_exist_or_not_requestable'));
|
||||
return redirect()->route('requestable-assets')->with('error', trans('admin/hardware/message.does_not_exist_or_not_requestable'));
|
||||
} elseif (!Company::isCurrentUserHasAccess($asset)) {
|
||||
return Redirect::route('requestable-assets')->with('error', trans('general.insufficient_permissions'));
|
||||
return redirect()->route('requestable-assets')->with('error', trans('general.insufficient_permissions'));
|
||||
} else {
|
||||
|
||||
$logaction = new Actionlog();
|
||||
@ -130,7 +130,7 @@ class ViewAssetsController extends Controller
|
||||
|
||||
}
|
||||
|
||||
return Redirect::route('requestable-assets')->with('success')->with('success', trans('admin/hardware/message.requests.success'));
|
||||
return redirect()->route('requestable-assets')->with('success')->with('success', trans('admin/hardware/message.requests.success'));
|
||||
}
|
||||
|
||||
|
||||
@ -144,13 +144,13 @@ class ViewAssetsController extends Controller
|
||||
|
||||
if (is_null($findlog = Actionlog::find($logID))) {
|
||||
// Redirect to the asset management page
|
||||
return Redirect::to('account')->with('error', trans('admin/hardware/message.does_not_exist'));
|
||||
return redirect()->to('account')->with('error', trans('admin/hardware/message.does_not_exist'));
|
||||
}
|
||||
|
||||
$user = Auth::user();
|
||||
|
||||
if ($user->id != $findlog->checkedout_to) {
|
||||
return Redirect::to('account/view-assets')->with('error', trans('admin/users/message.error.incorrect_user_accepted'));
|
||||
return redirect()->to('account/view-assets')->with('error', trans('admin/users/message.error.incorrect_user_accepted'));
|
||||
}
|
||||
|
||||
// Asset
|
||||
@ -168,9 +168,9 @@ class ViewAssetsController extends Controller
|
||||
// Check if the asset exists
|
||||
if (is_null($item)) {
|
||||
// Redirect to the asset management page
|
||||
return Redirect::to('account')->with('error', trans('admin/hardware/message.does_not_exist'));
|
||||
return redirect()->to('account')->with('error', trans('admin/hardware/message.does_not_exist'));
|
||||
} elseif (!Company::isCurrentUserHasAccess($item)) {
|
||||
return Redirect::route('requestable-assets')->with('error', trans('general.insufficient_permissions'));
|
||||
return redirect()->route('requestable-assets')->with('error', trans('general.insufficient_permissions'));
|
||||
} else {
|
||||
return View::make('account/accept-asset', compact('item'))->with('findlog', $findlog);
|
||||
}
|
||||
@ -183,28 +183,28 @@ class ViewAssetsController extends Controller
|
||||
// Check if the asset exists
|
||||
if (is_null($findlog = Actionlog::find($logID))) {
|
||||
// Redirect to the asset management page
|
||||
return Redirect::to('account/view-assets')->with('error', trans('admin/hardware/message.does_not_exist'));
|
||||
return redirect()->to('account/view-assets')->with('error', trans('admin/hardware/message.does_not_exist'));
|
||||
}
|
||||
|
||||
// NOTE: make sure the global scope is applied
|
||||
$is_unauthorized = is_null(Actionlog::where('id', '=', $logID)->first());
|
||||
if ($is_unauthorized) {
|
||||
return Redirect::route('requestable-assets')->with('error', trans('general.insufficient_permissions'));
|
||||
return redirect()->route('requestable-assets')->with('error', trans('general.insufficient_permissions'));
|
||||
}
|
||||
|
||||
if ($findlog->accepted_id!='') {
|
||||
// Redirect to the asset management page
|
||||
return Redirect::to('account/view-assets')->with('error', trans('admin/users/message.error.asset_already_accepted'));
|
||||
return redirect()->to('account/view-assets')->with('error', trans('admin/users/message.error.asset_already_accepted'));
|
||||
}
|
||||
|
||||
if (!Input::has('asset_acceptance')) {
|
||||
return Redirect::to('account/view-assets')->with('error', trans('admin/users/message.error.accept_or_decline'));
|
||||
return redirect()->to('account/view-assets')->with('error', trans('admin/users/message.error.accept_or_decline'));
|
||||
}
|
||||
|
||||
$user = Auth::user();
|
||||
|
||||
if ($user->id != $findlog->checkedout_to) {
|
||||
return Redirect::to('account/view-assets')->with('error', trans('admin/users/message.error.incorrect_user_accepted'));
|
||||
return redirect()->to('account/view-assets')->with('error', trans('admin/users/message.error.incorrect_user_accepted'));
|
||||
}
|
||||
|
||||
$logaction = new Actionlog();
|
||||
@ -261,10 +261,10 @@ class ViewAssetsController extends Controller
|
||||
$affected_asset->save();
|
||||
|
||||
if ($update_checkout) {
|
||||
return Redirect::to('account/view-assets')->with('success', $return_msg);
|
||||
return redirect()->to('account/view-assets')->with('success', $return_msg);
|
||||
|
||||
} else {
|
||||
return Redirect::to('account/view-assets')->with('error', 'Something went wrong ');
|
||||
return redirect()->to('account/view-assets')->with('error', 'Something went wrong ');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user