Preferences: New account display preferences that include email address

This commit is contained in:
nathan 2023-11-02 14:37:26 -06:00
parent 5ba1ef4d34
commit 999a3298c0
2 changed files with 12 additions and 0 deletions

View File

@ -394,11 +394,13 @@ class Accounts
case 'firstname':
case 'firstall':
case 'firstgroup':
case 'firstemail':
$order = 'account_firstname,account_lastname';
break;
case 'lastname':
case 'lastall':
case 'firstgroup':
case 'lastemail':
$order = 'account_lastname,account_firstname';
break;
default:
@ -608,6 +610,14 @@ class Accounts
$group = Accounts::id2name($lid, 'account_primary_group');
$name = $lastname . $delimiter . $firstname . ($is_group ? '' : ' ('.Accounts::id2name($group).')');
break;
case 'firstemail':
$email = Accounts::id2name($lid, 'account_email');
$name = $firstname . ' ' . $lastname . ($email ? ' [' . $email . ']' : '');
break;
case 'lastemail':
$email = Accounts::id2name($lid, 'account_email');
$name = $lastname . $delimiter . $firstname . ($email ? ' [' . $email . ']' : '');
break;
case 'firstinital':
$name = $firstname.' '.mb_substr($lastname, 0, 1).'.';
break;

View File

@ -105,6 +105,8 @@ class preferences_hooks
'all' => '['.lang('username').'] '.lang('Lastname').','.lang('Firstname'),
'firstgroup'=> lang('Firstname').' '.lang('Lastname').' ('.lang('primary group').')',
'lastgroup' => lang('Lastname').', '.lang('Firstname').' ('.lang('primary group').')',
'firstemail' => lang('Firstname') . ' ' . lang('Lastname') . ' [' . lang('email') . ']',
'lastemail' => lang('Lastname') . ', ' . lang('Firstname') . ' [' . lang('email') . ']',
'firstinital' => lang('Firstname').' '.lang('Initial'),
'firstid' => lang('Firstname').' ['.lang('ID').']',
);