summaryrefslogtreecommitdiff
path: root/app/Formatter/UserAutoCompleteFormatter.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-12-20 20:27:23 -0500
committerFrederic Guillot <fred@kanboard.net>2016-12-20 20:27:23 -0500
commit9d5d389de841705450190fb1ebbaa11393870dfe (patch)
tree29e99117c2abc456d4d44adf3eb7ea6e80c860c7 /app/Formatter/UserAutoCompleteFormatter.php
parentefbab9ed4cb1c6f9515dac2495999bb9a4226754 (diff)
Display user full name in auto-complete field value
Diffstat (limited to 'app/Formatter/UserAutoCompleteFormatter.php')
-rw-r--r--app/Formatter/UserAutoCompleteFormatter.php4
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'].')';
}
}