diff --git a/etemplate/inc/class.advancedsearch_widget.inc.php b/etemplate/inc/class.advancedsearch_widget.inc.php index 7cd65b8726..f4b77c21df 100644 --- a/etemplate/inc/class.advancedsearch_widget.inc.php +++ b/etemplate/inc/class.advancedsearch_widget.inc.php @@ -211,6 +211,7 @@ foreach($value as $haystack => $needle) { if($needle == '') unset($value[$haystack]); + elseif($haystack{0} != '!' && $needle{0} != '!' && $value['!'.$haystack] == 1 ) $value[$haystack] = '!'.$value[$haystack]; } $extension_data['result_nm']['search_values'] = $value; } @@ -266,4 +267,4 @@ return count($result); } - } \ No newline at end of file + } diff --git a/etemplate/inc/class.customfields_widget.inc.php b/etemplate/inc/class.customfields_widget.inc.php index 8bc6acabe7..1046464566 100644 --- a/etemplate/inc/class.customfields_widget.inc.php +++ b/etemplate/inc/class.customfields_widget.inc.php @@ -98,12 +98,23 @@ $field['values'][$key] = $val; } } - - $input = &$tpl->new_cell($n,'select','',$this->prefix.$name,array( + $input = &$tpl->new_cell($n,'hbox'); + 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'], 'size' => $field['rows'], 'no_lang' => True - )); + ))); + unset($select); + unset($item); break; case 'label' : $label['span'] = 'all';