Changeset 1886

Show
Ignore:
Timestamp:
04/14/08 09:36:18 (22 months ago)
Author:
fumiakiy
Message:

NOT and "+/-" query now works as it should. BugId:79274, BugId:79260

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/release-34/lib/MT/App/Search.pm

    r1884 r1886  
    642642    my $rvalue = sub { 
    643643        my %rvalues = ( 
     644            REQUIREDlike => { like => '%' . $_[1] . '%' }, 
     645            REQUIRED1    => $_[1], 
    644646            NORMALlike => { like => '%' . $_[1] . '%' }, 
    645647            NORMAL1    => $_[1], 
     
    688690                        $term->{term} 
    689691                    ); 
    690                     push @tmp, { $cols[$i] => $test }; 
    691                     unless ( $i == $number - 1 ) { 
    692                         push @tmp, '-or'; 
     692                    if ( 'PROHIBITED' eq $term->{type} ) { 
     693                        my @this_term;  
     694                        push @this_term, { $cols[$i] => $test }; 
     695                        push @this_term, '-or'; 
     696                        push @this_term, { $cols[$i] => \' IS NULL' }; 
     697                        push @tmp, \@this_term; 
     698                        unless ( $i == $number - 1 ) { 
     699                            push @tmp, '-and'; 
     700                        } 
     701                    } 
     702                    else { 
     703                        push @tmp, { $cols[$i] => $test }; 
     704                        unless ( $i == $number - 1 ) { 
     705                            push @tmp, '-or'; 
     706                        } 
    693707                    } 
    694708                }