allow NOT in customfield search of type select

This commit is contained in:
Cornelius Weiß 2005-11-10 12:10:17 +00:00
parent 04f215beee
commit b57aaf28af
2 changed files with 16 additions and 4 deletions

View File

@ -211,6 +211,7 @@
foreach($value as $haystack => $needle) foreach($value as $haystack => $needle)
{ {
if($needle == '') unset($value[$haystack]); if($needle == '') unset($value[$haystack]);
elseif($haystack{0} != '!' && $needle{0} != '!' && $value['!'.$haystack] == 1 ) $value[$haystack] = '!'.$value[$haystack];
} }
$extension_data['result_nm']['search_values'] = $value; $extension_data['result_nm']['search_values'] = $value;
} }

View File

@ -98,12 +98,23 @@
$field['values'][$key] = $val; $field['values'][$key] = $val;
} }
} }
$input = &$tpl->new_cell($n,'hbox');
$input = &$tpl->new_cell($n,'select','',$this->prefix.$name,array( if($this->advanced_search)
{
$not = &$tpl->add_child($input, $check = &$tpl->empty_cell('checkbox','!'.$this->prefix.$name,array(
'label' => 'NOT',
'no_lang' => True
)));
unset($not);
unset($check);
}
$select = &$tpl->add_child($input, $item = &$tpl->empty_cell('select',$this->prefix.$name,array(
'sel_options' => $field['values'], 'sel_options' => $field['values'],
'size' => $field['rows'], 'size' => $field['rows'],
'no_lang' => True 'no_lang' => True
)); )));
unset($select);
unset($item);
break; break;
case 'label' : case 'label' :
$label['span'] = 'all'; $label['span'] = 'all';