From e6f70f2ab7bd4583deaf99d4ff854360ff9254cb Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 19 Jan 2018 23:47:37 -0800 Subject: [PATCH] Fixed #4821 - add username to user selection dropdown --- app/Http/Controllers/Api/UsersController.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Api/UsersController.php b/app/Http/Controllers/Api/UsersController.php index 4d12c7bd71..f5b7ce08e4 100644 --- a/app/Http/Controllers/Api/UsersController.php +++ b/app/Http/Controllers/Api/UsersController.php @@ -132,6 +132,7 @@ class UsersController extends Controller $users = User::select( [ 'users.id', + 'users.username', 'users.employee_num', 'users.first_name', 'users.last_name', @@ -160,8 +161,12 @@ class UsersController extends Controller } $name_str .= e($user->first_name); + if ($user->username!='') { + $name_str .= ' ('.e($user->username).')'; + } + if ($user->employee_num!='') { - $name_str .= ' (#'.e($user->employee_num).')'; + $name_str .= ' - #'.e($user->employee_num); } $user->use_text = $name_str;