Fixed #4581 - renamed print method

This commit is contained in:
snipe 2017-12-06 11:17:42 -08:00
parent 83547e3fed
commit dfb0c09c51
3 changed files with 9 additions and 9 deletions

View file

@ -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);
}

View file

@ -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

View file

@ -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' ]
);