From 2fe984013bb567ea24e77ea3bf468f7dba06ec3c Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 22 Dec 2016 15:53:34 -0800 Subject: [PATCH] Fixes #3092 - user location not being exported correctly --- app/Http/Controllers/UsersController.php | 2 +- config/app.php | 1 + resources/views/users/index.blade.php | 2 +- routes/web/users.php | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/UsersController.php b/app/Http/Controllers/UsersController.php index 97d67b656f..65da6528cb 100755 --- a/app/Http/Controllers/UsersController.php +++ b/app/Http/Controllers/UsersController.php @@ -1250,7 +1250,7 @@ class UsersController extends Controller $user->username, $user->email, ($user->manager) ? $user->manager->fullName() : '', - ($user->location) ? $user->location->name : '', + ($user->userloc) ? $user->userloc->name : '', $user->assets->count(), $user->licenses->count(), $user->accessories->count(), diff --git a/config/app.php b/config/app.php index 6f711461bb..10c9029151 100755 --- a/config/app.php +++ b/config/app.php @@ -287,6 +287,7 @@ return [ 'Form' => 'Collective\Html\FormFacade', 'Html' => 'Collective\Html\HtmlFacade', 'Google2FA' => PragmaRX\Google2FA\Vendor\Laravel\Facade::class, + 'Debugbar' => Barryvdh\Debugbar\Facade::class, ], diff --git a/resources/views/users/index.blade.php b/resources/views/users/index.blade.php index 9c6a018c39..9d517b689c 100755 --- a/resources/views/users/index.blade.php +++ b/resources/views/users/index.blade.php @@ -29,7 +29,7 @@ {{ trans('admin/users/table.show_deleted') }} @endif @can('view', \App\Models\User::class) - Export + Export @endcan @stop diff --git a/routes/web/users.php b/routes/web/users.php index 574d9bfab8..b9137cce08 100644 --- a/routes/web/users.php +++ b/routes/web/users.php @@ -7,7 +7,7 @@ Route::group([ 'prefix' => 'users', 'middleware' => ['web','auth']], function () Route::post('ldap', 'UsersController@postLDAP'); Route::get('import', [ 'as' => 'import/user', 'uses' => 'UsersController@getImport' ]); Route::post('import', [ 'uses' => 'UsersController@postImport' ]); - Route::get('export', [ 'uses' => 'UsersController@getExportUserCsv' ]); + Route::get('export', [ 'as' => 'users.export', 'uses' => 'UsersController@getExportUserCsv' ]); Route::get('{userId}/clone', [ 'as' => 'clone/user', 'uses' => 'UsersController@getClone' ]); Route::post('{userId}/clone', [ 'uses' => 'UsersController@postCreate' ]); Route::get('{userId}/restore', [ 'as' => 'restore/user', 'uses' => 'UsersController@getRestore' ]);