- Add special handling for ids like something[{$row}] to only send select options once

- Don't need to process or send options for account, it is done client side now.
This commit is contained in:
Nathan Gray 2014-07-21 16:31:10 +00:00
parent 6a0c7e2c3d
commit bd41288788

View File

@ -184,6 +184,11 @@ class etemplate_widget_menupopup extends etemplate_widget
{
$form_name = $matches[2];
}
// happens in auto-repeat grids: $cname='', this->id='something[{$row}]'
elseif (preg_match('/([^[]+)\[({\$row})\]$/', $this->id, $matches))
{
$form_name = $matches[1];
}
else
{
$form_name = self::form_name($cname, $this->id);
@ -224,6 +229,10 @@ class etemplate_widget_menupopup extends etemplate_widget
{
self::setElementAttribute($form_name, "search", true);
}
if(!self::$request->sel_options[$options])
{
unset(self::$request->sel_options[$options]);
}
}
}
@ -495,30 +504,6 @@ class etemplate_widget_menupopup extends etemplate_widget
$no_lang = True;
break;
case 'select-account': // options: #rows,{accounts(default)|both|groups|owngroups},{0(=lid)|1(default=name)|2(=lid+name),expand-multiselect-rows,not-to-show-accounts,...)}
// Get preference for selection display
// Get important attributes in a non-legacy way
if($widget != null && $widget->attrs['account_type'])
{
$type = $widget->attrs['account_type'];
}
$select_pref = $GLOBALS['egw_info']['user']['preferences']['common']['account_selection'];
// in case of readonly, we read/create only the needed entries, as reading accounts is expensive
if (!is_array($value) && strpos($value,',') !== false) $value = explode(',',$value);
if ($readonly || $select_pref == 'popup')
{
$no_lang = True;
foreach(is_array($value) ? $value : array($value) as $id)
{
$options[$id] = !$id && !is_numeric($rows) ? lang($rows) :
self::accountInfo($id, null, $type2, $type=='both');
}
break;
}
break;
case 'select-year': // options: #rows,#before(default=3),#after(default=2)
$options[''] = '';
if ($type <= 0) $type = 3;