* Preferences - Add 'Firstname Lastname (Primary Group)' and 'Lastname, Firstname (Primary Group)' as account display options

This commit is contained in:
nathangray 2019-01-09 10:41:24 -07:00
parent 00885da412
commit f8c742cdbb
2 changed files with 13 additions and 1 deletions

View File

@ -325,10 +325,12 @@ class Accounts
{
case 'firstname':
case 'firstall':
case 'firstgroup':
$order = 'account_firstname,account_lastname';
break;
case 'lastname':
case 'lastall':
case 'firstgroup':
$order = 'account_lastname,account_firstname';
break;
default:
@ -492,6 +494,14 @@ class Accounts
case 'allfirst':
$name = '['.$lid.'] ' . $firstname . ' ' . $lastname;
break;
case 'firstgroup':
$group = Accounts::id2name($lid, 'account_primary_group');
$name = $firstname . ' ' . $lastname . ($is_group ? '' : ' ('.Accounts::id2name($group).')');
break;
case 'lastgroup':
$group = Accounts::id2name($lid, 'account_primary_group');
$name = $lastname . $delimiter . $firstname . ($is_group ? '' : ' ('.Accounts::id2name($group).')');
break;
case 'all':
/* fall through */
default:

View File

@ -86,6 +86,8 @@ class preferences_hooks
'lastall' => lang('Lastname').', '.lang('Firstname').' ['.lang('username').']',
'allfirst' => '['.lang('username').'] '.lang('Firstname').' '.lang('Lastname'),
'all' => '['.lang('username').'] '.lang('Lastname').','.lang('Firstname'),
'firstgroup'=> lang('Firstname').' '.lang('Lastname').' ('.lang('primary group').')',
'lastgroup' => lang('Lastname').', '.lang('Firstname').' ('.lang('primary group').')',
);
if ($hook_data['setup']) // called via setup