diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-12-20 20:27:23 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-12-20 20:27:23 -0500 |
commit | 9d5d389de841705450190fb1ebbaa11393870dfe (patch) | |
tree | 29e99117c2abc456d4d44adf3eb7ea6e80c860c7 /app/Formatter/UserAutoCompleteFormatter.php | |
parent | efbab9ed4cb1c6f9515dac2495999bb9a4226754 (diff) |
Display user full name in auto-complete field value
Diffstat (limited to 'app/Formatter/UserAutoCompleteFormatter.php')
-rw-r--r-- | app/Formatter/UserAutoCompleteFormatter.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/Formatter/UserAutoCompleteFormatter.php b/app/Formatter/UserAutoCompleteFormatter.php index 32a83608..c81af00a 100644 --- a/app/Formatter/UserAutoCompleteFormatter.php +++ b/app/Formatter/UserAutoCompleteFormatter.php @@ -24,11 +24,11 @@ class UserAutoCompleteFormatter extends BaseFormatter implements FormatterInterf $users = $this->query->columns(UserModel::TABLE.'.id', UserModel::TABLE.'.username', UserModel::TABLE.'.name')->findAll(); foreach ($users as &$user) { - $user['value'] = $user['username'].' (#'.$user['id'].')'; - if (empty($user['name'])) { + $user['value'] = $user['username'].' (#'.$user['id'].')'; $user['label'] = $user['username']; } else { + $user['value'] = $user['name'].' (#'.$user['id'].')'; $user['label'] = $user['name'].' ('.$user['username'].')'; } } |