When getting account data via AJAX, make sure account name is in user's preferred format.

This commit is contained in:
Nathan Gray 2015-11-16 17:32:37 +00:00
parent 71bd17628d
commit 48d779a337

View File

@ -2432,10 +2432,23 @@ abstract class egw_framework
{ {
foreach($account_id < 0 && $_resolve_groups ? foreach($account_id < 0 && $_resolve_groups ?
$GLOBALS['egw']->accounts->members($account_id, true) : array($account_id) as $account_id) $GLOBALS['egw']->accounts->members($account_id, true) : array($account_id) as $account_id)
{
// Make sure name is formatted according to preference
if($_field == 'account_fullname')
{
$list[$account_id] = common::display_fullname(
$GLOBALS['egw']->accounts->id2name($account_id, 'lid'),
$GLOBALS['egw']->accounts->id2name($account_id, 'account_firstname'),
$GLOBALS['egw']->accounts->id2name($account_id, 'account_lastname'),
$account_id
);
}
else
{ {
$list[$account_id] = $GLOBALS['egw']->accounts->id2name($account_id, $_field); $list[$account_id] = $GLOBALS['egw']->accounts->id2name($account_id, $_field);
} }
} }
}
egw_json_response::get()->data($list); egw_json_response::get()->data($list);
return $list; return $list;