diff --git a/phpgwapi/inc/class.uiaccountsel.inc.php b/phpgwapi/inc/class.uiaccountsel.inc.php index f66bb843af..17f4edd5ce 100644 --- a/phpgwapi/inc/class.uiaccountsel.inc.php +++ b/phpgwapi/inc/class.uiaccountsel.inc.php @@ -39,6 +39,12 @@ $this->accounts($account_id,$account_type); // call constructor of extended class $this->account_selection = $GLOBALS['phpgw_info']['user']['preferences']['common']['account_selection']; + + if (!is_object($GLOBALS['phpgw']->html)) + { + $GLOBALS['phpgw']->html = CreateObject('phpgwapi.html'); + } + $this->html = $GLOBALS['phpgw']->html; } /** @@ -59,10 +65,6 @@ function selection($name,$element_id,$selected,$use='accounts',$lines=1,$not=False,$options='',$onchange='') { //echo "
uiaccountsel::selection('$name',".print_r($selected,True).",'$use',$lines,$not,'$options')
\n"; - if (!is_object($GLOBALS['phpgw']->html)) - { - $GLOBALS['phpgw']->html = CreateObject('phpgwapi.html'); - } if (!is_array($selected)) { $selected = $selected ? array($selected) : array(); @@ -153,35 +155,38 @@ 'element_id' => $element_id, 'single' => !$lines, // single selection, closes after the first selection )); + $popup_options = 'width=600,height=400,toolbar=no,scrollbars=auto,resizable=yes'; + $app = $GLOBALS['phpgw_info']['flags']['currentapp']; + $single = (int) !$lines; if (!$lines) { - $options .= ' onchange="if (this.value==\'popup\') '."window.open('$link','uiaccountsel','width=800,height=600,toolbar=no,scrollbars=yes,resizable=yes')".';'. + $options .= ' onchange="if (this.value==\'popup\') '."window.open('$link','uiaccountsel','$popup_options');". ($onchange ? " else { $onchange }" : '' ).'"'; $select['popup'] = lang('Search').' ...'; + $need_js_popup = True; } elseif ($onchange) { $options .= ' onchange="'.$onchange.'"'; } //echo "html::select('$name',".print_r($selected,True).",".print_r($select,True).",True,'$options')
\n"; - $html = $GLOBALS['phpgw']->html->select($name,$selected,$select,True,$options.' id="'.$element_id.'"',$lines); + $html = $this->html->select($name,$selected,$select,True,$options.' id="'.$element_id.'"',$lines); if ($lines > 1 && ($this->account_selection == 'popup' || $this->account_selection == 'primary_group')) { - $html .= ''. - $GLOBALS['phpgw']->html->image('calendar','multi_3',lang('click to select or search accounts')).''; + $html .= ''. + $this->html->image('phpgwapi','users',lang('search or select accounts')).''; + $need_js_popup = True; } - if(!$GLOBALS['phpgw_info']['flags']['uiaccountsel']['addOption_installed']) + if($need_js_popup && !$GLOBALS['phpgw_info']['flags']['uiaccountsel']['addOption_installed']) { $html .= ' -
-
| {accountsel_icon} | ++ | ||||||||
- + |
+
|
|||||||||
{lang_showing} | + {right} +
{lang_accounts} | |||||||
{sort_lid} | -{sort_firstname} | -{sort_lastname} | -+ | {sort_lid} | +{sort_firstname} | +{sort_lastname} | +
{lang_selection} {remove} | +|
+ {selection} + | +|
+ + | +
- -