mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-02 08:21:09 -08:00
Merge branch 'develop'
This commit is contained in:
commit
25bf10b125
|
@ -1155,15 +1155,15 @@ class UsersController extends Controller
|
||||||
* @since [v1.8]
|
* @since [v1.8]
|
||||||
* @return \Illuminate\Http\RedirectResponse
|
* @return \Illuminate\Http\RedirectResponse
|
||||||
*/
|
*/
|
||||||
public function print($id)
|
public function printInventory($id)
|
||||||
{
|
{
|
||||||
|
|
||||||
$user = User::where('id',$id)->withTrashed()->first();
|
$show_user = User::where('id',$id)->withTrashed()->first();
|
||||||
$assets = Asset::where('assigned_to', $id)->where('assigned_type', User::class)->with('model', 'model.category')->get();
|
$assets = Asset::where('assigned_to', $id)->where('assigned_type', User::class)->with('model', 'model.category')->get();
|
||||||
$licenses = $user->licenses()->get();
|
$licenses = $show_user->licenses()->get();
|
||||||
$accessories = $user->accessories()->get();
|
$accessories = $show_user->accessories()->get();
|
||||||
$consumables = $user->consumables()->get();
|
$consumables = $show_user->consumables()->get();
|
||||||
return view('users/print')->with('assets', $assets)->with('licenses',$licenses)->with('accessories', $accessories)->with('consumables', $consumables);
|
return view('users/print')->with('assets', $assets)->with('licenses',$licenses)->with('accessories', $accessories)->with('consumables', $consumables)->with('show_user', $show_user);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||||
<title>Assigned to {{ $user->present()->fullName() }}</title>
|
<title>Assigned to {{ $show_user->present()->fullName() }}</title>
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
font-family: "Arial, Helvetica", sans-serif;
|
font-family: "Arial, Helvetica", sans-serif;
|
||||||
|
@ -25,7 +25,7 @@
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h3>Assigned to {{ $user->present()->fullName() }}</h3>
|
<h3>Assigned to {{ $show_user->present()->fullName() }}</h3>
|
||||||
|
|
||||||
@if ($assets->count() > 0)
|
@if ($assets->count() > 0)
|
||||||
@php
|
@php
|
||||||
|
|
|
@ -20,7 +20,7 @@ Route::group([ 'prefix' => 'users', 'middleware' => ['auth']], function () {
|
||||||
|
|
||||||
Route::get(
|
Route::get(
|
||||||
'{userId}/print',
|
'{userId}/print',
|
||||||
[ 'as' => 'users.print', 'uses' => 'UsersController@print' ]
|
[ 'as' => 'users.print', 'uses' => 'UsersController@printInventory' ]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue