From ad2096866ec22d7a5ce46048de85368ba3f21283 Mon Sep 17 00:00:00 2001 From: nathan Date: Fri, 4 Aug 2023 14:45:56 -0600 Subject: [PATCH] Can't use Framework::ajax_user_list(), it sends its data which conflicts with export wizard --- ...ss.calendar_owner_etemplate_widget.inc.php | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/calendar/inc/class.calendar_owner_etemplate_widget.inc.php b/calendar/inc/class.calendar_owner_etemplate_widget.inc.php index 0d01478613..5bb48b1dd6 100644 --- a/calendar/inc/class.calendar_owner_etemplate_widget.inc.php +++ b/calendar/inc/class.calendar_owner_etemplate_widget.inc.php @@ -64,14 +64,35 @@ class calendar_owner_etemplate_widget extends Etemplate\Widget\Taglist } else { - $accounts = Framework::ajax_user_list(); + // close session now, to not block other user actions + $GLOBALS['egw']->session->commit_session(); + + $list = array('accounts' => array('num_rows' => Link::DEFAULT_NUM_ROWS), 'groups' => array(), + 'owngroups' => array()); if($type == "primary_groups") { - unset($accounts['groups']); + unset($list['groups']); } else { - unset($accounts['owngroups']); + unset($list['owngroups']); + } + if($GLOBALS['egw_info']['user']['preferences']['common']['account_selection'] == 'primary_group') + { + $list['accounts']['filter']['group'] = $GLOBALS['egw_info']['user']['account_primary_group']; + } + foreach($list as $type => &$accounts) + { + $options = array('account_type' => $type, 'tag_list' => true) + $accounts; + $accounts = Accounts::link_query('', $options); + } + unset($list["accounts"][9]); + // Make sure the user themselves is in there + if(!array_key_exists($GLOBALS['egw_info']['user']['account_id'], $list['accounts'])) + { + $options = array('account_type' => 'accounts', 'tag_list' => true, + 'account_id' => $GLOBALS['egw_info']['user']['account_id']) + $list['accounts']; + $list['accounts'] += Accounts::link_query('', $options); } } foreach($accounts as $type_account_list)