mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 14:41:29 +01:00
"sort users/groups by account_display pref"
This commit is contained in:
parent
666e6793a7
commit
785189d884
@ -114,17 +114,34 @@ class ui_acl
|
||||
|
||||
function selectlist($right,$users_only=false)
|
||||
{
|
||||
foreach ($GLOBALS['egw']->accounts->get_list() as $num => $account)
|
||||
switch($GLOBALS['egw_info']['user']['preferences']['common']['account_display'])
|
||||
{
|
||||
if(!($users_only && $account['account_lastname'] == 'Group'))
|
||||
case 'firstname':
|
||||
case 'firstall':
|
||||
$order = 'n_given,n_family';
|
||||
break;
|
||||
case 'lastall':
|
||||
case 'lastname':
|
||||
$order = 'n_family,n_given';
|
||||
break;
|
||||
default:
|
||||
$order = 'account_lid,n_family,n_given';
|
||||
break;
|
||||
}
|
||||
foreach ($GLOBALS['egw']->accounts->search(array(
|
||||
'type' => 'both',
|
||||
'order' => $order,
|
||||
)) as $num => $account)
|
||||
{
|
||||
if(!($users_only && $account['account_type'] == 'g'))
|
||||
{
|
||||
$selectlist .= '<option value="' . $account['account_id'] . '"';
|
||||
if($this->rights[$account['account_id']] & $right)
|
||||
if($this->rights[$account['account_id']] & $right)
|
||||
{
|
||||
$selectlist .= ' selected="selected"';
|
||||
}
|
||||
$selectlist .= '>' . $account['account_firstname'] . ' ' . $account['account_lastname']
|
||||
. ' [ ' . $account['account_lid'] . ' ]' . '</option>' . "\n";
|
||||
$selectlist .= '>' . $GLOBALS['egw']->common->display_fullname($account['account_lid'],$account['account_firstname'],
|
||||
$account['account_lastname'],$account['account_id']) . '</option>' . "\n";
|
||||
}
|
||||
}
|
||||
return $selectlist;
|
||||
|
Loading…
Reference in New Issue
Block a user