Commit 23210afc authored by Robert Lyon's avatar Robert Lyon

Bug 1529753: Passing through the preferred name value

When displaying names for adding group members to groups

behatnotneeded

Change-Id: I0fb09eb1a17bd94c58533b8272db38e439897cbe
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
(cherry picked from commit 564caacd)
parent d22c3042
......@@ -59,7 +59,7 @@ $results = get_group_user_search_results(
);
if (!param_integer('html', 1)) {
foreach ($results['data'] as &$result) {
$result = array('id' => $result['id'], 'name' => $result['name']);
$result = array('id' => $result['id'], 'name' => display_name($result['id'], $USER->get('id')));
}
json_reply(false, $results);
}
......
......@@ -552,7 +552,7 @@ class PluginSearchInternal extends PluginSearch {
if ($membershiptype == 'nonmember') {
$select = '
u.id, u.firstname, u.lastname, u.username, u.email, u.profileicon, u.staff, u.urlid';
u.id, u.firstname, u.lastname, u.username, u.email, u.profileicon, u.staff, u.urlid, u.preferredname';
$from = '
FROM {usr} u
LEFT OUTER JOIN {usr_account_preference} h ON (u.id = h.usr AND h.field = \'hiderealname\')
......@@ -563,7 +563,7 @@ class PluginSearchInternal extends PluginSearch {
}
else if ($membershiptype == 'notinvited') {
$select = '
u.id, u.firstname, u.lastname, u.username, u.email, u.profileicon, u.staff, u.urlid';
u.id, u.firstname, u.lastname, u.username, u.email, u.profileicon, u.staff, u.urlid, u.preferredname';
$from = '
FROM {usr} u
LEFT OUTER JOIN {usr_account_preference} h ON (u.id = h.usr AND h.field = \'hiderealname\')
......@@ -577,7 +577,7 @@ class PluginSearchInternal extends PluginSearch {
else if ($membershiptype == 'request') {
$select = '
u.id, u.firstname, u.lastname, u.username, u.email, u.profileicon,
u.staff, u.urlid, ' . db_format_tsfield('gm.ctime', 'jointime');
u.staff, u.urlid, u.preferredname, ' . db_format_tsfield('gm.ctime', 'jointime');
$from = '
FROM {usr} u
INNER JOIN {group_member_request} gm ON (gm.member = u.id)
......@@ -593,7 +593,7 @@ class PluginSearchInternal extends PluginSearch {
else if ($membershiptype == 'invite') {
$select = '
u.id, u.firstname, u.lastname, u.username, u.email, u.profileicon,
u.staff, u.urlid, ' . db_format_tsfield('gm.ctime', 'jointime');
u.staff, u.urlid, u.preferredname, ' . db_format_tsfield('gm.ctime', 'jointime');
$from = '
FROM {usr} u
INNER JOIN {group_member_invite} gm ON (gm.member = u.id)
......@@ -606,7 +606,7 @@ class PluginSearchInternal extends PluginSearch {
else { // All group members
$select = '
u.id, u.firstname, u.lastname, u.username, u.preferredname, u.email, u.profileicon,
u.staff, u.urlid, ' . db_format_tsfield('gm.ctime', 'jointime') . ', gm.role';
u.staff, u.urlid, u.preferredname, ' . db_format_tsfield('gm.ctime', 'jointime') . ', gm.role';
$from = '
FROM {usr} u
INNER JOIN {group_member} gm ON (gm.member = u.id)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment