From e1c91cd842cc2193309a284b3bd49488342ca8a1 Mon Sep 17 00:00:00 2001 From: Max Kanat-Alexander Date: Sat, 2 Apr 2011 11:57:14 -0700 Subject: Bug 647466: Allow Search.pm to take the new URL syntax for custom search r=mkanat, a=mkanat (module owner) --- Bugzilla/Search/Condition.pm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'Bugzilla/Search/Condition.pm') diff --git a/Bugzilla/Search/Condition.pm b/Bugzilla/Search/Condition.pm index db20e7f3b..8fe05f065 100644 --- a/Bugzilla/Search/Condition.pm +++ b/Bugzilla/Search/Condition.pm @@ -50,7 +50,17 @@ sub translated { sub as_string { my ($self) = @_; - return $self->translated->{term}; + my $term = $self->translated->{term}; + $term = "NOT( $term )" if $term && $self->negate; + return $term; +} + +sub negate { + my ($self, $value) = @_; + if (@_ == 2) { + $self->{negate} = $value ? 1 : 0; + } + return $self->{negate}; } ########################### -- cgit v1.2.3-24-g4f1b