diff --git a/etemplate/js/et2_widget_selectAccount.js b/etemplate/js/et2_widget_selectAccount.js index e37a7859f1..45f8946a5d 100644 --- a/etemplate/js/et2_widget_selectAccount.js +++ b/etemplate/js/et2_widget_selectAccount.js @@ -380,7 +380,22 @@ var et2_selectAccount = et2_selectbox.extend( } } } - return this.options.select_options.concat(this.egw().accounts(this.options.account_type)); + var type = this.egw().preference('account_selection', 'common'); + var accounts = []; + // for primary_group we only display owngroups == own memberships, not other groups + if (type == 'primary_group' && this.options.account_type != 'accounts') + { + if (this.options.account_type == 'both') + { + accounts = this.egw().accounts('accounts'); + } + accounts = accounts.concat(this.egw().accounts('owngroups')); + } + else + { + accounts = this.egw().accounts(this.options.account_type); + } + return this.options.select_options.concat(accounts); }, /** diff --git a/phpgwapi/inc/class.accounts.inc.php b/phpgwapi/inc/class.accounts.inc.php index b92441c3b3..60c1b121d7 100644 --- a/phpgwapi/inc/class.accounts.inc.php +++ b/phpgwapi/inc/class.accounts.inc.php @@ -392,6 +392,7 @@ class accounts case 'groups': $type = $only_own ? 'memberships' : 'groups'; break; + case 'owngroups': case 'groupmembers': case 'memberships': $type = $options['account_type'];