Merge branch 'develop'

This commit is contained in:
snipe 2017-10-23 17:50:58 -07:00
commit 249f86bb21
6 changed files with 287 additions and 267 deletions

View file

@ -31,6 +31,7 @@ class UsersController extends Controller
'users.two_factor_enrolled', 'users.two_factor_enrolled',
'users.jobtitle', 'users.jobtitle',
'users.email', 'users.email',
'users.phone',
'users.username', 'users.username',
'users.location_id', 'users.location_id',
'users.manager_id', 'users.manager_id',
@ -93,7 +94,7 @@ class UsersController extends Controller
'last_name','first_name','email','jobtitle','username','employee_num', 'last_name','first_name','email','jobtitle','username','employee_num',
'assets','accessories', 'consumables','licenses','groups','activated','created_at', 'assets','accessories', 'consumables','licenses','groups','activated','created_at',
'two_factor_enrolled','two_factor_optin','last_login', 'assets_count', 'licenses_count', 'two_factor_enrolled','two_factor_optin','last_login', 'assets_count', 'licenses_count',
'consumables_count', 'accessories_count' 'consumables_count', 'accessories_count', 'phone'
]; ];
$sort = in_array($request->get('sort'), $allowed_columns) ? $request->get('sort') : 'first_name'; $sort = in_array($request->get('sort'), $allowed_columns) ? $request->get('sort') : 'first_name';

View file

@ -33,6 +33,7 @@ class UsersTransformer
'name'=> e($user->manager->username) 'name'=> e($user->manager->username)
] : null, ] : null,
'jobtitle' => ($user->jobtitle) ? e($user->jobtitle) : null, 'jobtitle' => ($user->jobtitle) ? e($user->jobtitle) : null,
'phone' => ($user->phone) ? e($user->phone) : null,
'email' => e($user->email), 'email' => e($user->email),
'department' => ($user->department) ? [ 'department' => ($user->department) ? [
'id' => (int) $user->department->id, 'id' => (int) $user->department->id,

View file

@ -403,6 +403,7 @@ class User extends SnipeModel implements AuthenticatableContract, CanResetPasswo
->orWhere('users.email', 'LIKE', "%$search%") ->orWhere('users.email', 'LIKE', "%$search%")
->orWhere('users.username', 'LIKE', "%$search%") ->orWhere('users.username', 'LIKE', "%$search%")
->orWhere('users.notes', 'LIKE', "%$search%") ->orWhere('users.notes', 'LIKE', "%$search%")
->orWhere('users.phone', 'LIKE', "%$search%")
->orWhere('users.jobtitle', 'LIKE', "%$search%") ->orWhere('users.jobtitle', 'LIKE', "%$search%")
->orWhere('users.employee_num', 'LIKE', "%$search%") ->orWhere('users.employee_num', 'LIKE', "%$search%")
->orWhere(function ($query) use ($search) { ->orWhere(function ($query) use ($search) {

View file

@ -69,6 +69,14 @@ class UserPresenter extends Presenter
"visible" => true, "visible" => true,
"formatter" => "emailFormatter" "formatter" => "emailFormatter"
], ],
[
"field" => "phone",
"searchable" => true,
"sortable" => true,
"switchable" => true,
"title" => trans('admin/users/table.phone'),
"visible" => true,
],
[ [
"field" => "username", "field" => "username",
"searchable" => true, "searchable" => true,

View file

@ -19,7 +19,7 @@
"javiereguiluz/easyslugger": "^1.0", "javiereguiluz/easyslugger": "^1.0",
"jenssegers/rollbar": "^1.5", "jenssegers/rollbar": "^1.5",
"laravel/framework": "5.4.*", "laravel/framework": "5.4.*",
"laravel/passport": "^1.0", "laravel/passport": "^3.0",
"laravel/tinker": "^1.0", "laravel/tinker": "^1.0",
"laravelcollective/html": "^5.3", "laravelcollective/html": "^5.3",
"league/csv": "^8.1", "league/csv": "^8.1",

539
composer.lock generated

File diff suppressed because it is too large Load diff