Index: trunk/core/kernel/db/db_tag_processor.php =================================================================== diff -u -N -r6703 -r6751 --- trunk/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 6703) +++ trunk/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 6751) @@ -137,6 +137,7 @@ $block_params['name'] = isset($options[$mode.'_block']) ? $options[$mode.'_block'] : $def_block; $block_params['field'] = $field; $block_params['sort_field'] = isset($options['sort_field']) ? $options['sort_field'] : $field; + $block_params['filter_field'] = isset($options['filter_field']) ? $options['filter_field'] : $field; $block_params = array_merge($std_params, $block_params, $options); $o.= $this->Application->ParseBlock($block_params, 1); } @@ -742,16 +743,10 @@ $object =& $this->getObject($params); $field = $params['field']; $saved_value = $object->GetDBField($field); - - $custom_filters = $this->Application->RecallVar( $this->getPrefixSpecial().'_custom_filters'); - if ($custom_filters) { - $custom_filters = unserialize($custom_filters); - $append = getArrayValue($params, 'type') ? '_'.$params['type'] : ''; - $object->SetDBField($field, $custom_filters[$field.$append]); - } - else { - $object->SetDBField($field, ''); - } + + $object->SetDBField($field, $this->SearchField($params)); + $custom_filter = $this->Application->RecallVar($this->getPrefixSpecial().'_custom_filter'); + $ret = $this->PredefinedOptions($params); $object->SetDBField($field, $saved_value); return $ret; @@ -1419,9 +1414,14 @@ function SearchInputName($params) { $field = $this->SelectParam($params, 'field,name'); - $append = getArrayValue($params, 'type') ? '_'.$params['type'] : ''; - return 'custom_filters['.$this->getPrefixSpecial().']['.$field.$append.']'; + $ret = 'custom_filters['.$this->getPrefixSpecial().']['.$params['grid'].']['.$field.']['.$params['filter_type'].']'; + + if (isset($params['type'])) { + $ret .= '['.$params['type'].']'; + } + + return $ret; } /** @@ -1434,12 +1434,18 @@ { $field = $this->SelectParam($params, 'field,name'); - $custom_filters = $this->Application->RecallVar($this->getPrefixSpecial().'_custom_filters'); - $custom_filters = $custom_filters ? unserialize($custom_filters) : Array(); + $custom_filter = $this->Application->RecallVar($this->getPrefixSpecial().'_custom_filter'); + $custom_filter = $custom_filter ? unserialize($custom_filter) : Array(); - $append = getArrayValue($params, 'type'); - - return getArrayValue($custom_filters, $field.( $append ? '_'.$append : '') ); + if (isset($custom_filter[ $params['grid'] ][$field])) { + $ret = $custom_filter[ $params['grid'] ][$field][ $params['filter_type'] ]['submit_value']; + if (isset($params['type'])) { + $ret = $ret[ $params['type'] ]; + } + return $ret; + } + + return ''; } function SearchFormat($params)