From c4d66d7ecffa0ab5b8402c27d6b57e895fb5a11b Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sat, 12 Jun 2004 10:04:48 +0000 Subject: [PATCH] using account-selection widget --- calendar/inc/class.uicalendar.inc.php | 52 ++++----------------------- 1 file changed, 6 insertions(+), 46 deletions(-) diff --git a/calendar/inc/class.uicalendar.inc.php b/calendar/inc/class.uicalendar.inc.php index e544b55477..487da3f1d5 100755 --- a/calendar/inc/class.uicalendar.inc.php +++ b/calendar/inc/class.uicalendar.inc.php @@ -83,7 +83,6 @@ 'header' => True, 'footer' => True, 'css' => True, - 'accounts_popup' => True ); function uicalendar() @@ -3774,11 +3773,6 @@ return ''."\n".$str.'
'."\n"; } - function accounts_popup() - { - $GLOBALS['phpgw']->accounts->accounts_popup('calendar'); - } - function edit_form($param) { if(!is_array($param)) @@ -3821,7 +3815,6 @@ 'font' => $this->theme['font'], 'bg_color' => $this->theme['bg_text'], 'action_url' => $GLOBALS['phpgw']->link('/index.php',Array('menuaction'=>'calendar.bocalendar.update')), - 'accounts_link' => $GLOBALS['phpgw']->link('/index.php','menuaction=calendar.uicalendar.accounts_popup'), 'common_hidden' => ''."\n" . ''."\n" . ''."\n" @@ -3972,47 +3965,14 @@ // Participants if(!isset($GLOBALS['phpgw_info']['server']['deny_user_grants_access']) || !$GLOBALS['phpgw_info']['server']['deny_user_grants_access']) { - $accounts = $GLOBALS['phpgw']->acl->get_ids_for_location('run',1,'calendar'); - $users = Array(); - $this->build_part_list($users,$accounts,$event['owner']); - - $str = ''; - @asort($users); - @reset($users); - - switch($GLOBALS['phpgw_info']['user']['preferences']['common']['account_selection']) + if (!is_object($GLOBALS['phpgw']->uiaccountsel)) { - case 'popup': - while (is_array($event['participants']) && list($id) = each($event['participants'])) - { - if($id != (int)$event['owner']) - { - $str .= '' . "\n"; - } - } - $var['participants'] = array - ( - 'field' => '' . "\n" - . '', - 'data' => "\n".' ' - ); - break; - default: - foreach($users as $id => $user_array) - { - if($id != (int)$event['owner']) - { - $str .= ' '."\n"; - } - } - $var['participants'] = array - ( - 'field' => lang('Participants'), - 'data' => "\n".' ' - ); - break; + $GLOBALS['phpgw']->uiaccountsel = CreateObject('phpgwapi.uiaccountsel'); } + $var['participants'] = array( + 'field' => lang('Participants'), + 'data' => "\n ".$GLOBALS['phpgw']->uiaccountsel->selection('participants[]','uicalendar_select_participants',$event['participants'],'calendar',7,$event['owner']), + ); /* // External Participants