summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Bugzilla/Search.pm10
-rwxr-xr-xquery.cgi2
-rw-r--r--template/en/default/search/boolean-charts.html.tmpl11
3 files changed, 20 insertions, 3 deletions
diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm
index 261e1ae0a..bf81451ae 100644
--- a/Bugzilla/Search.pm
+++ b/Bugzilla/Search.pm
@@ -1049,6 +1049,7 @@ sub init {
$chart < 0 || $params->param("field$chart-0-0") ;
$chart++) {
$chartid = $chart >= 0 ? $chart : "";
+ my @chartandlist = ();
for ($row = 0 ;
$params->param("field$chart-$row-0") ;
$row++) {
@@ -1111,7 +1112,14 @@ sub init {
}
if (@orlist) {
@orlist = map("($_)", @orlist) if (scalar(@orlist) > 1);
- push(@andlist, "(" . join(" OR ", @orlist) . ")");
+ push(@chartandlist, "(" . join(" OR ", @orlist) . ")");
+ }
+ }
+ if (@chartandlist) {
+ if ($params->param("negate$chart")) {
+ push(@andlist, "NOT(" . join(" AND ", @chartandlist) . ")");
+ } else {
+ push(@andlist, "(" . join(" AND ", @chartandlist) . ")");
}
}
}
diff --git a/query.cgi b/query.cgi
index bd60e5b67..e3c261d59 100755
--- a/query.cgi
+++ b/query.cgi
@@ -357,7 +357,7 @@ for (my $chart = 0; $::FORM{"field$chart-0-0"}; $chart++) {
}
push(@rows, \@cols);
}
- push(@charts, \@rows);
+ push(@charts, {'rows' => \@rows, 'negate' => $::FORM{"negate$chart"}});
}
$default{'charts'} = \@charts;
diff --git a/template/en/default/search/boolean-charts.html.tmpl b/template/en/default/search/boolean-charts.html.tmpl
index ba88b67b4..6887321f4 100644
--- a/template/en/default/search/boolean-charts.html.tmpl
+++ b/template/en/default/search/boolean-charts.html.tmpl
@@ -57,7 +57,16 @@
[% FOREACH chart = default.charts %]
[% chartnum = loop.count - 1 %]
<table>
- [% FOREACH row = chart %]
+ <tr>
+ <input type="checkbox" id="negate[% chartnum FILTER html %]"
+ name="negate[% chartnum FILTER html %]" value="1"
+ [% "checked" IF chart.negate %]
+ >
+ <label for="negate[% chartnum FILTER html %]">
+ Not (negate this whole chart)
+ </label>
+ </tr>
+ [% FOREACH row = chart.rows %]
[% rownum = loop.count - 1 %]
<tr>
[% FOREACH col = row %]