diff --git a/api/src/Accounts.php b/api/src/Accounts.php index 517ed968fd..15e54a29fb 100644 --- a/api/src/Accounts.php +++ b/api/src/Accounts.php @@ -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; diff --git a/preferences/inc/class.preferences_hooks.inc.php b/preferences/inc/class.preferences_hooks.inc.php index e8c973a535..1f2ffbf5b8 100644 --- a/preferences/inc/class.preferences_hooks.inc.php +++ b/preferences/inc/class.preferences_hooks.inc.php @@ -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').']', );