From f8c742cdbb81e9e0083cfb6dddd8112f9bcf9894 Mon Sep 17 00:00:00 2001 From: nathangray Date: Wed, 9 Jan 2019 10:41:24 -0700 Subject: [PATCH] * Preferences - Add 'Firstname Lastname (Primary Group)' and 'Lastname, Firstname (Primary Group)' as account display options --- api/src/Accounts.php | 10 ++++++++++ preferences/inc/class.preferences_hooks.inc.php | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/api/src/Accounts.php b/api/src/Accounts.php index dc00a7b5ac..79b26cc8ec 100644 --- a/api/src/Accounts.php +++ b/api/src/Accounts.php @@ -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: diff --git a/preferences/inc/class.preferences_hooks.inc.php b/preferences/inc/class.preferences_hooks.inc.php index 1c80fd393d..43eb4a5400 100644 --- a/preferences/inc/class.preferences_hooks.inc.php +++ b/preferences/inc/class.preferences_hooks.inc.php @@ -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 @@ -132,7 +134,7 @@ class preferences_hooks 'app' => 'api' ); } - + if (!$GLOBALS['egw_info']['user']['preferences']['common']['rte_toolbar']) { $GLOBALS['egw']->preferences->add('common', 'rte_toolbar', 'fontselect,fontsizeselect,bold,italic,forecolor,backcolor,'.