mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
Fix a regression in Helper::usersList and ::managerList() where the "Select a User" option disappeared. Also format names the way they used to be formatted.
This commit is contained in:
parent
45d3d90c94
commit
1c1ef951e9
|
@ -164,10 +164,11 @@ class Helper
|
||||||
|
|
||||||
public static function managerList()
|
public static function managerList()
|
||||||
{
|
{
|
||||||
$manager_list = User::where('deleted_at', '=', null)
|
$manager_list = array('' => '') +
|
||||||
->orderBy('last_name', 'asc')
|
User::where('deleted_at', '=', null)
|
||||||
->orderBy('first_name', 'asc')->get()
|
->orderBy('last_name', 'asc')
|
||||||
->lists('full_name', 'id');
|
->orderBy('first_name', 'asc')->get()
|
||||||
|
->lists('complete_name', 'id')->toArray();
|
||||||
|
|
||||||
return $manager_list;
|
return $manager_list;
|
||||||
}
|
}
|
||||||
|
@ -187,11 +188,12 @@ class Helper
|
||||||
|
|
||||||
public static function usersList()
|
public static function usersList()
|
||||||
{
|
{
|
||||||
$users_list = User::where('deleted_at', '=', null)
|
$users_list = array( '' => trans('general.select_user')) +
|
||||||
->where('show_in_list','=',1)
|
User::where('deleted_at', '=', null)
|
||||||
->orderBy('last_name', 'asc')
|
->where('show_in_list','=',1)
|
||||||
->orderBy('first_name', 'asc')->get()
|
->orderBy('last_name', 'asc')
|
||||||
->lists('full_name', 'id');
|
->orderBy('first_name', 'asc')->get()
|
||||||
|
->lists('complete_name', 'id')->toArray();
|
||||||
|
|
||||||
return $users_list;
|
return $users_list;
|
||||||
}
|
}
|
||||||
|
|
|
@ -123,6 +123,11 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
|
||||||
return $this->first_name . " " . $this->last_name;
|
return $this->first_name . " " . $this->last_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getCompleteNameAttribute()
|
||||||
|
{
|
||||||
|
return $this->last_name . ", " . $this->first_name . " (" . $this->username . ")";
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the user Gravatar image url.
|
* Returns the user Gravatar image url.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue