]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 58731: Make the keywords regexp boolean charts work
authorJesse Clark <jjclark1982@gmail.com>
Mon, 8 Feb 2010 00:04:54 +0000 (16:04 -0800)
committerMax Kanat-Alexander <mkanat@bugzilla.org>
Mon, 8 Feb 2010 00:04:54 +0000 (16:04 -0800)
r=mkanat, a=mkanat

Bugzilla/Search.pm
template/en/default/search/form.html.tmpl

index 43b95f2936d3681bfc5ae3d13c157959ea21ef71..b460ee0d57bf9932e89266fc10c808b05532dfeb 100644 (file)
@@ -28,6 +28,7 @@
 #                 Joel Peshkin <bugreport@peshkin.net>
 #                 Lance Larsh <lance.larsh@oracle.com>
 #                 Jesse Clark <jjclark1982@gmail.com>
+#                 RĂ©mi Zara <remi_zara@mac.com>
 
 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 = @_;
index ec0d2a90b39e44e3e5a669bedb1a0be0dbf995de..2e2ae73d6651f85a9692628a20fe5cc795c73866 100644 (file)
@@ -301,7 +301,7 @@ function doOnSelectProduct(selectmode) {
       <td>
         [% INCLUDE "search/type-select.html.tmpl"
            name = "keywords_type",
-           types = ['allwords', 'anywords', 'nowords'], 
+           types = ['allwords', 'anywords', 'nowords', 'regexp', 'notregexp'],
            selected = default.keywords_type.0 %]
       </td>
       <td>