mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-23 11:43:47 -08:00
Fixed #4581 - renamed print method
This commit is contained in:
parent
83547e3fed
commit
dfb0c09c51
|
@ -1155,15 +1155,15 @@ class UsersController extends Controller
|
|||
* @since [v1.8]
|
||||
* @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();
|
||||
$licenses = $user->licenses()->get();
|
||||
$accessories = $user->accessories()->get();
|
||||
$consumables = $user->consumables()->get();
|
||||
return view('users/print')->with('assets', $assets)->with('licenses',$licenses)->with('accessories', $accessories)->with('consumables', $consumables);
|
||||
$licenses = $show_user->licenses()->get();
|
||||
$accessories = $show_user->accessories()->get();
|
||||
$consumables = $show_user->consumables()->get();
|
||||
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">
|
||||
<head>
|
||||
<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>
|
||||
body {
|
||||
font-family: "Arial, Helvetica", sans-serif;
|
||||
|
@ -25,7 +25,7 @@
|
|||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h3>Assigned to {{ $user->present()->fullName() }}</h3>
|
||||
<h3>Assigned to {{ $show_user->present()->fullName() }}</h3>
|
||||
|
||||
@if ($assets->count() > 0)
|
||||
@php
|
||||
|
|
|
@ -20,7 +20,7 @@ Route::group([ 'prefix' => 'users', 'middleware' => ['auth']], function () {
|
|||
|
||||
Route::get(
|
||||
'{userId}/print',
|
||||
[ 'as' => 'users.print', 'uses' => 'UsersController@print' ]
|
||||
[ 'as' => 'users.print', 'uses' => 'UsersController@printInventory' ]
|
||||
);
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue