From dfb0c09c5101de1847528e9a658685f908f56f38 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 6 Dec 2017 11:17:42 -0800 Subject: [PATCH] Fixed #4581 - renamed print method --- app/Http/Controllers/UsersController.php | 12 ++++++------ resources/views/users/print.blade.php | 4 ++-- routes/web/users.php | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/Http/Controllers/UsersController.php b/app/Http/Controllers/UsersController.php index 2252a154d0..fd6f0ca75c 100755 --- a/app/Http/Controllers/UsersController.php +++ b/app/Http/Controllers/UsersController.php @@ -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); } diff --git a/resources/views/users/print.blade.php b/resources/views/users/print.blade.php index ce5415b36f..4ddfecae4c 100644 --- a/resources/views/users/print.blade.php +++ b/resources/views/users/print.blade.php @@ -2,7 +2,7 @@ - Assigned to {{ $user->present()->fullName() }} + Assigned to {{ $show_user->present()->fullName() }} -

Assigned to {{ $user->present()->fullName() }}

+

Assigned to {{ $show_user->present()->fullName() }}

@if ($assets->count() > 0) @php diff --git a/routes/web/users.php b/routes/web/users.php index 8e467f14d7..1541e36bea 100644 --- a/routes/web/users.php +++ b/routes/web/users.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' ] );