From: terry%mozilla.org <> Date: Thu, 27 Jan 2000 05:48:35 +0000 (+0000) Subject: Allow searches for "all keywords" or "no keywords"; fixed some other X-Git-Tag: bugzilla-2.12~415 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c6c81144fc9c5976e3a747a27b469f7d9d991e67;p=thirdparty%2Fbugzilla.git Allow searches for "all keywords" or "no keywords"; fixed some other bugs around keyword queries. --- diff --git a/buglist.cgi b/buglist.cgi index 6427180e91..5cae83b872 100755 --- a/buglist.cgi +++ b/buglist.cgi @@ -395,8 +395,24 @@ if ($::FORM{'keywords'}) { } if (@list) { $query =~ s/where/, keywords where/; - $query .= "and keywords.bug_id = bugs.bug_id and (" . - join(" $::FORM{'keywords_type'} ", @list) . ")\n"; + my $type = $::FORM{'keywords_type'}; + my $notopt = ""; + if ($type eq "nowords") { + # Ought to take advantage of keyword table somehow! ### + my $extra = GetByWordList("bugs.keywords", $::FORM{'keywords'}, + "or"); + $extra =~ s/AND/AND NOT/i; + $query .= $extra; + } else { + $query .= "and keywords.bug_id = bugs.bug_id and $notopt (" . + join(" or ", @list) . ")\n"; + if ($type eq "allwords") { + # This needs to be tuned to take better advantage of the + # keyword table! + $query .= GetByWordList("bugs.keywords", $::FORM{'keywords'}, + "and"); + } + } } } diff --git a/query.cgi b/query.cgi index 0b6211bfbe..5ed72da9b5 100755 --- a/query.cgi +++ b/query.cgi @@ -136,8 +136,8 @@ sub ProcessFormStuff { "changedin", "votes", "short_desc", "short_desc_type", "long_desc", "long_desc_type", "bug_file_loc", "bug_file_loc_type", "status_whiteboard", - "status_whiteboard_type", "keywords", "bug_id", - "bugidtype") { + "status_whiteboard_type", "bug_id", + "bugidtype", "keywords", "keywords_type") { $default{$name} = ""; $type{$name} = 0; } @@ -643,18 +643,19 @@ if (@::legal_keywords) { print qq{ Keywords: - - + }; - foreach my $i (["or", "Any of the listed keywords set"]) { - my ($n, $d) = (@$i); - my $sel = ""; - if ($default{"keywords"} eq $n) { - $sel = " SELECTED"; - } - print qq{