mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 21:24:13 -08:00
Allow printing all users
This commit is contained in:
parent
2d2d5bdc7e
commit
5128fd49e6
|
@ -617,7 +617,27 @@ class UsersController extends Controller
|
|||
}
|
||||
|
||||
return redirect()->route('users.index')->with('error', trans('admin/users/message.user_not_found', compact('id')));
|
||||
}
|
||||
|
||||
public function printAllThings()
|
||||
{
|
||||
$this->authorize('view', User::class);
|
||||
|
||||
$users = User::query()
|
||||
->with([
|
||||
'assets',
|
||||
'accessories',
|
||||
'consumables',
|
||||
'licenses',
|
||||
])
|
||||
->withTrashed()
|
||||
->get();
|
||||
|
||||
// @todo: more authorization
|
||||
|
||||
return view('users.print')
|
||||
->with('users', $users)
|
||||
->with('settings', Setting::getSettings());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -104,6 +104,8 @@ Route::group(['prefix' => 'users', 'middleware' => ['auth']], function () {
|
|||
]
|
||||
)->name('users.print');
|
||||
|
||||
Route::get('print-all-things', [Users\UsersController::class, 'printAllThings'])->name('users.print-all-things');
|
||||
|
||||
Route::post(
|
||||
'{userId}/email',
|
||||
[
|
||||
|
@ -153,4 +155,4 @@ Route::resource('users', Users\UsersController::class, [
|
|||
'middleware' => ['auth'],
|
||||
'parameters' => ['user' => 'user_id'],
|
||||
'except' => ['update']
|
||||
]);
|
||||
]);
|
||||
|
|
Loading…
Reference in a new issue