forked from extern/egroupware
handling the doubling of select/multiselect -cfs in advanced search,, adding empty entry for radio-cfs in advanced search, allowing to edit readonly cfs when in advanced search.
This commit is contained in:
parent
4710810a41
commit
1f6bba4aba
@ -217,11 +217,13 @@ class customfields_widget
|
||||
$select =& $input; unset($input);
|
||||
$input =& etemplate::empty_cell('hbox');
|
||||
etemplate::add_child($input, $select); unset($select);
|
||||
/* the following seem to double the select fields in advanced search.
|
||||
etemplate::add_child($input, etemplate::empty_cell('select',$this->prefix.$lname,array(
|
||||
'sel_options' => $field['values'],
|
||||
'size' => $field['rows'],
|
||||
'no_lang' => True
|
||||
)));
|
||||
*/
|
||||
}
|
||||
break;
|
||||
case 'label' :
|
||||
@ -232,6 +234,7 @@ class customfields_widget
|
||||
{
|
||||
$field['values'] = $this->_get_options_from_file($field['values']['@']);
|
||||
}
|
||||
if($this->advanced_search && $field['rows'] <= 1) $field['values'][''] = lang('doesn\'t matter');
|
||||
$input =& etemplate::empty_cell('groupbox');
|
||||
$m = 0;
|
||||
foreach ($field['values'] as $key => $val)
|
||||
@ -260,7 +263,7 @@ class customfields_widget
|
||||
{
|
||||
if (array_key_exists('readonly',$field['values']))
|
||||
{
|
||||
$tmparray['readonly']='readonly';
|
||||
if(!$this->advanced_search) $tmparray['readonly']='readonly';
|
||||
}
|
||||
}
|
||||
$input =& etemplate::empty_cell('text',$this->prefix.$lname,$tmparray);
|
||||
@ -272,7 +275,7 @@ class customfields_widget
|
||||
);
|
||||
if (is_array($field['values']) && array_key_exists('readonly',$field['values']))
|
||||
{
|
||||
$tmparray['readonly']='readonly';
|
||||
if(!$this->advanced_search) $tmparray['readonly']='readonly';
|
||||
}
|
||||
$input =& etemplate::empty_cell('textarea',$this->prefix.$lname,$tmparray);
|
||||
}
|
||||
@ -298,16 +301,19 @@ class customfields_widget
|
||||
));
|
||||
break;
|
||||
case 'button': // button(s) to execute javascript (label=onclick) or textinputs (empty label, readonly with neg. length)
|
||||
// a button does not seem to be helpful in advanced search ???,
|
||||
if($this->advanced_search) break;
|
||||
$input =& etemplate::empty_cell('hbox');
|
||||
foreach($field['values'] as $label => $js)
|
||||
{
|
||||
if (!$label) // display an readonly input
|
||||
{
|
||||
$widget =& etemplate::empty_cell('text',$this->prefix.$lname.$label,array(
|
||||
$tmparray = array(
|
||||
'size' => $field['len'] ? $field['len'] : 20,
|
||||
'readonly' => $field['len'] < 0,
|
||||
'onchange' => $js,
|
||||
));
|
||||
);
|
||||
$widget =& etemplate::empty_cell('text',$this->prefix.$lname.$label,$tmparray);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user