summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2011-03-01 16:19:05 +0100
committerMax Kanat-Alexander <mkanat@bugzilla.org>2011-03-01 16:19:05 +0100
commit86d6af6970a887fa12ee65aacdb9086836d773fd (patch)
tree1ccc6c4d17bb0920e6c6d5fd115f5e09e0c07eac /Bugzilla
parentfbeb99dbd2cf3fc492f0af382e7b0f4bed940678 (diff)
downloadbugzilla-86d6af6970a887fa12ee65aacdb9086836d773fd.tar.gz
bugzilla-86d6af6970a887fa12ee65aacdb9086836d773fd.tar.xz
Bug 616341: Make "tag" a valid search field in Search.pm, for the new
tagging system r=mkanat, a=mkanat (module owner)
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/Field.pm1
-rw-r--r--Bugzilla/Search.pm53
2 files changed, 25 insertions, 29 deletions
diff --git a/Bugzilla/Field.pm b/Bugzilla/Field.pm
index 052717f00..a41cd9357 100644
--- a/Bugzilla/Field.pm
+++ b/Bugzilla/Field.pm
@@ -257,6 +257,7 @@ use constant DEFAULT_FIELDS => (
{name => "owner_idle_time", desc => "Time Since Assignee Touched"},
{name => 'see_also', desc => "See Also",
type => FIELD_TYPE_BUG_URLS},
+ {name => 'tag', desc => 'Tags'},
);
################
diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm
index 34100b4ba..3af5b98cd 100644
--- a/Bugzilla/Search.pm
+++ b/Bugzilla/Search.pm
@@ -220,6 +220,22 @@ use constant NON_NUMERIC_OPERATORS => qw(
notregexp
);
+use constant MULTI_SELECT_OVERRIDE => {
+ notequals => \&_multiselect_negative,
+ notregexp => \&_multiselect_negative,
+ notsubstring => \&_multiselect_negative,
+ nowords => \&_multiselect_negative,
+ nowordssubstr => \&_multiselect_negative,
+
+ allwords => \&_multiselect_multiple,
+ allwordssubstr => \&_multiselect_multiple,
+ anyexact => \&_multiselect_multiple,
+ anywords => \&_multiselect_multiple,
+ anywordssubstr => \&_multiselect_multiple,
+
+ _non_changed => \&_multiselect_nonchanged,
+};
+
use constant OPERATOR_FIELD_OVERRIDE => {
# User fields
'attachments.submitter' => {
@@ -281,21 +297,7 @@ use constant OPERATOR_FIELD_OVERRIDE => {
dependson => {
_non_changed => \&_dependson_nonchanged,
},
- keywords => {
- notequals => \&_multiselect_negative,
- notregexp => \&_multiselect_negative,
- notsubstring => \&_multiselect_negative,
- nowords => \&_multiselect_negative,
- nowordssubstr => \&_multiselect_negative,
-
- allwords => \&_multiselect_multiple,
- allwordssubstr => \&_multiselect_multiple,
- anyexact => \&_multiselect_multiple,
- anywords => \&_multiselect_multiple,
- anywordssubstr => \&_multiselect_multiple,
-
- _non_changed => \&_multiselect_nonchanged,
- },
+ keywords => MULTI_SELECT_OVERRIDE,
'flagtypes.name' => {
_default => \&_flagtypes_name,
},
@@ -323,25 +325,13 @@ use constant OPERATOR_FIELD_OVERRIDE => {
lessthaneq => \&_owner_idle_time_greater_less,
_default => \&_invalid_combination,
},
-
product => {
_non_changed => \&_product_nonchanged,
},
+ tag => MULTI_SELECT_OVERRIDE,
# Custom multi-select fields
- _multi_select => {
- notequals => \&_multiselect_negative,
- notregexp => \&_multiselect_negative,
- notsubstring => \&_multiselect_negative,
- nowords => \&_multiselect_negative,
- nowordssubstr => \&_multiselect_negative,
-
- allwords => \&_multiselect_multiple,
- allwordssubstr => \&_multiselect_multiple,
- anyexact => \&_multiselect_multiple,
-
- _non_changed => \&_multiselect_nonchanged,
- },
+ _multi_select => MULTI_SELECT_OVERRIDE,
# Timetracking Fields
percentage_complete => {
@@ -2693,6 +2683,11 @@ sub _multiselect_table {
return "keywords INNER JOIN keyworddefs".
" ON keywords.keywordid = keyworddefs.id";
}
+ elsif ($field eq 'tag') {
+ $args->{full_field} = 'tags.name';
+ return "bug_tag INNER JOIN tags ON bug_tag.tag_id = tags.id"
+ . " AND user_id = " . $self->_user->id;
+ }
my $table = "bug_$field";
$args->{full_field} = "bug_$field.value";
return $table;