From e8daf45b020217bee367aaba14566754d9817e0d Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sat, 12 Jun 2004 09:48:59 +0000 Subject: [PATCH] using account-selection widget --- admin/inc/class.uiaccounts.inc.php | 45 ++------------------------ admin/templates/default/group_form.tpl | 12 ++----- 2 files changed, 5 insertions(+), 52 deletions(-) diff --git a/admin/inc/class.uiaccounts.inc.php b/admin/inc/class.uiaccounts.inc.php index 885adc7cfe..20c3ca5dcd 100755 --- a/admin/inc/class.uiaccounts.inc.php +++ b/admin/inc/class.uiaccounts.inc.php @@ -26,7 +26,6 @@ 'view_user' => True, 'edit_view_user_hook' => True, 'group_manager' => True, - 'accounts_popup' => True ); var $bo; @@ -836,11 +835,6 @@ } } - function accounts_popup() - { - $GLOBALS['phpgw']->accounts->accounts_popup('admin'); - } - function create_edit_group($group_info,$_errors='') { // Maybe we should list this in setup/setup.inc.php and put it into the @@ -880,44 +874,11 @@ $accounts = CreateObject('phpgwapi.accounts',$group_info['account_id'],'u'); - if ($GLOBALS['phpgw_info']['user']['preferences']['common']['account_selection'] == 'popup') + if (!is_object($GLOBALS['phpgw']->uiaccountsel)) { - $p->set_var('accounts_link',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.accounts_popup')); - $p->set_var('lang_open_popup',lang('open popup window')); - - while(is_array($group_info['account_user']) && list($ac_id,) = each($group_info['account_user'])) - { - $ac_name = $GLOBALS['phpgw']->accounts->get_account_data($ac_id); - - $user_list .= ''."\n"; - } - $account_num = max(count($group_info['account_user']),5); - $p->set_var('select_size',($account_num < 25?$account_num:25)); - $p->set_var('user_list',$user_list); - $p->fp('accounts','popwin',True); - } - else - { - $account_list = $accounts->get_list('accounts'); - $account_num = count($account_list); - - $user_list = ''; - while (list($key,$entry) = each($account_list)) - { - $user_list .= ''."\n"; - } - $p->set_var('select_size',($account_num < 7?$account_num:7)); - $p->set_var('user_list',$user_list); - $p->fp('accounts','select',True); + $GLOBALS['phpgw']->uiaccountsel = CreateObject('phpgwapi.uiaccountsel'); } + $p->set_var('accounts',$GLOBALS['phpgw']->uiaccountsel->selection('account_user[]','admin_uiaccounts_user',$group_info['account_user'],'accounts',min(3+count($group_info['account_user']),10))); $var = Array( 'form_action' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.boaccounts.'.($group_info['account_id']?'edit':'add').'_group'), diff --git a/admin/templates/default/group_form.tpl b/admin/templates/default/group_form.tpl index 012bd15057..149cb44ad6 100644 --- a/admin/templates/default/group_form.tpl +++ b/admin/templates/default/group_form.tpl @@ -1,11 +1,3 @@ - - {error} @@ -24,8 +16,8 @@ -
{lang_include_user} - {accounts} + + {accounts}