Index: admin_templates/incs/grid_blocks.tpl =================================================================== --- admin_templates/incs/grid_blocks.tpl (revision 14705) +++ admin_templates/incs/grid_blocks.tpl (working copy) @@ -394,34 +394,6 @@ - - - - - - - - - -
- " - value="" - style="width: " - onkeypress="search_keydown(event, '', '', '')"/> - - -
- " - value="" - style="width: " - onkeypress="search_keydown(event, '', '', '')"/> -
-
- Index: units/agents/agents_config.php =================================================================== --- units/agents/agents_config.php (revision 14705) +++ units/agents/agents_config.php (working copy) @@ -160,7 +160,7 @@ 'RunInterval' => Array ('filter_block' => 'grid_range_filter', 'width' => 100, ), 'RunMode' => Array ('filter_block' => 'grid_options_filter', 'width' => 85, ), 'LastRunOn' => Array ('filter_block' => 'grid_date_range_filter', 'width' => 145, ), - 'RunTime' => Array ('filter_block' => 'grid_float_range_filter', 'width' => 145, ), + 'RunTime' => Array ('filter_block' => 'grid_range_filter', 'width' => 145, ), 'LastRunStatus' => Array ('filter_block' => 'grid_options_filter', 'width' => 120, ), 'NextRunOn' => Array ('filter_block' => 'grid_date_range_filter', 'width' => 145, ), 'Status' => Array ('filter_block' => 'grid_options_filter', 'width' => 65, ), Index: units/helpers/search_helper.php =================================================================== --- units/helpers/search_helper.php (revision 14705) +++ units/helpers/search_helper.php (working copy) @@ -539,39 +539,33 @@ $from = $this->getRangeValue($field_options['submit_value']['from']); $to = $this->getRangeValue($field_options['submit_value']['to']); - if ($from !== false && $to !== false) { + if ( $from !== false && $to !== false ) { // add range filter - $filter_value = $table_name.'`'.$field_name.'` >= '.$from.' AND '.$table_name.'`'.$field_name.'` <= '.$to; + $filter_value = $table_name . '`' . $field_name . '` >= ' . $from . ' AND ' . $table_name . '`' . $field_name . '` <= ' . $to; } - elseif ($from !== false) { - // add equals filter on $from - $filter_value = $table_name.'`'.$field_name.'` = '.$from; + elseif ( $field_type == 'int' || $field_type == 'integer' ) { + if ( $from !== false ) { + // add equals filter on $from + $filter_value = $table_name . '`' . $field_name . '` = ' . $from; + } + elseif ( $to !== false ) { + // add equals filter on $to + $filter_value = $table_name . '`' . $field_name . '` = ' . $to; + } } - elseif ($to !== false) { - // add equals filter on $to - $filter_value = $table_name.'`'.$field_name.'` = '.$to; + else { + // MySQL can't compare values in "float" type columns using "=" operator + if ( $from !== false ) { + // add equals filter on $from + $filter_value = 'ABS(' . $table_name . '`' . $field_name . '` - ' . $from . ') <= 0.0001'; + } + elseif ( $to !== false ) { + // add equals filter on $to + $filter_value = 'ABS(' . $table_name . '`' . $field_name . '` - ' . $to . ') <= 0.0001'; + } } break; - case 'float_range': - // MySQL can't compare values in "float" type columns using "=" operator - $from = $this->getRangeValue($field_options['submit_value']['from']); - $to = $this->getRangeValue($field_options['submit_value']['to']); - - if ($from !== false && $to !== false) { - // add range filter - $filter_value = $table_name.'`'.$field_name.'` >= '.$from.' AND '.$table_name.'`'.$field_name.'` <= '.$to; - } - elseif ($from !== false) { - // add equals filter on $from - $filter_value = 'ABS('.$table_name.'`'.$field_name.'` - '.$from.') <= 0.0001'; - } - elseif ($to !== false) { - // add equals filter on $to - $filter_value = 'ABS('.$table_name.'`'.$field_name.'` - '.$to.') <= 0.0001'; - } - break; - case 'date_range': $from = $this->processRangeField($object, $field_name, $field_options['submit_value'], 'from'); $to = $this->processRangeField($object, $field_name, $field_options['submit_value'], 'to');