From: Jesse Clark Date: Mon, 8 Feb 2010 00:04:54 +0000 (-0800) Subject: Bug 58731: Make the keywords regexp boolean charts work X-Git-Tag: bugzilla-3.6rc1~62 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c1b9d4ed25a175be1544b19cd798603ce63c498;p=thirdparty%2Fbugzilla.git Bug 58731: Make the keywords regexp boolean charts work r=mkanat, a=mkanat --- diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm index 43b95f2936..b460ee0d57 100644 --- a/Bugzilla/Search.pm +++ b/Bugzilla/Search.pm @@ -28,6 +28,7 @@ # Joel Peshkin # Lance Larsh # Jesse Clark +# Rémi Zara use strict; @@ -636,6 +637,7 @@ sub init { "^component,(?!changed)" => \&_component_nonchanged, "^product,(?!changed)" => \&_product_nonchanged, "^classification,(?!changed)" => \&_classification_nonchanged, + "^keywords,(?:equals|notequals|anyexact|anyword|allwords|nowords)" => \&_keywords_exact, "^keywords,(?!changed)" => \&_keywords_nonchanged, "^dependson,(?!changed)" => \&_dependson_nonchanged, "^blocked,(?!changed)" => \&_blocked_nonchanged, @@ -1865,7 +1867,7 @@ sub _classification_nonchanged { $$term); } -sub _keywords_nonchanged { +sub _keywords_exact { my $self = shift; my %func_args = @_; my ($chartid, $v, $ff, $f, $t, $term, $supptables) = @@ -1904,6 +1906,23 @@ sub _keywords_nonchanged { } } +sub _keywords_nonchanged { + my $self = shift; + my %func_args = @_; + my ($chartid, $v, $ff, $f, $t, $term, $supptables) = + @func_args{qw(chartid v ff f t term supptables)}; + + my $k_table = "keywords_$$chartid"; + my $kd_table = "keyworddefs_$$chartid"; + + push(@$supptables, "LEFT JOIN keywords AS $k_table " . + "ON $k_table.bug_id = bugs.bug_id"); + push(@$supptables, "LEFT JOIN keyworddefs AS $kd_table " . + "ON $kd_table.id = $k_table.keywordid"); + + $$f = "$kd_table.name"; +} + sub _dependson_nonchanged { my $self = shift; my %func_args = @_; diff --git a/template/en/default/search/form.html.tmpl b/template/en/default/search/form.html.tmpl index ec0d2a90b3..2e2ae73d66 100644 --- a/template/en/default/search/form.html.tmpl +++ b/template/en/default/search/form.html.tmpl @@ -301,7 +301,7 @@ function doOnSelectProduct(selectmode) { [% INCLUDE "search/type-select.html.tmpl" name = "keywords_type", - types = ['allwords', 'anywords', 'nowords'], + types = ['allwords', 'anywords', 'nowords', 'regexp', 'notregexp'], selected = default.keywords_type.0 %]