mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-02 08:21:09 -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')));
|
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');
|
)->name('users.print');
|
||||||
|
|
||||||
|
Route::get('print-all-things', [Users\UsersController::class, 'printAllThings'])->name('users.print-all-things');
|
||||||
|
|
||||||
Route::post(
|
Route::post(
|
||||||
'{userId}/email',
|
'{userId}/email',
|
||||||
[
|
[
|
||||||
|
|
Loading…
Reference in a new issue