summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Keyword.pm
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@mozilla.com>2015-05-01 06:03:57 +0200
committerDylan William Hardison <dylan@hardison.net>2015-05-01 06:03:57 +0200
commitc3c2eccd987259a577108fd05f57dc809950b0e6 (patch)
tree44cbe5438ce68ae36d8f36c205e2e523dd3dd5db /Bugzilla/Keyword.pm
parent0e68998f22b847d90753daac3808bedc4500cde6 (diff)
downloadbugzilla-c3c2eccd987259a577108fd05f57dc809950b0e6.tar.gz
bugzilla-c3c2eccd987259a577108fd05f57dc809950b0e6.tar.xz
Bug 69267: Add the ability to deactivate keywords
r/a=glob
Diffstat (limited to 'Bugzilla/Keyword.pm')
-rw-r--r--Bugzilla/Keyword.pm28
1 files changed, 24 insertions, 4 deletions
diff --git a/Bugzilla/Keyword.pm b/Bugzilla/Keyword.pm
index afa93e1e9..ef044a0c5 100644
--- a/Bugzilla/Keyword.pm
+++ b/Bugzilla/Keyword.pm
@@ -26,6 +26,7 @@ use constant DB_COLUMNS => qw(
keyworddefs.id
keyworddefs.name
keyworddefs.description
+ keyworddefs.is_active
);
use constant DB_TABLE => 'keyworddefs';
@@ -33,11 +34,13 @@ use constant DB_TABLE => 'keyworddefs';
use constant VALIDATORS => {
name => \&_check_name,
description => \&_check_description,
+ is_active => \&_check_is_active,
};
use constant UPDATE_COLUMNS => qw(
name
description
+ is_active
);
###############################
@@ -62,6 +65,7 @@ sub bug_count {
sub set_name { $_[0]->set('name', $_[1]); }
sub set_description { $_[0]->set('description', $_[1]); }
+sub set_is_active { $_[0]->set('is_active', $_[1]); }
###############################
#### Subroutines ######
@@ -125,6 +129,10 @@ sub _check_description {
return $desc;
}
+sub _check_is_active { return $_[1] ? 1 : 0 }
+
+sub is_active { return $_[0]->{is_active} }
+
1;
__END__
@@ -145,13 +153,13 @@ Bugzilla::Keyword - A Keyword that can be added to a bug.
Bugzilla::Keyword represents a keyword that can be added to a bug.
-This implements all standard C<Bugzilla::Object> methods. See
+This implements all standard C<Bugzilla::Object> methods. See
L<Bugzilla::Object> for more details.
-=head1 SUBROUTINES
+=head1 METHODS
-This is only a list of subroutines specific to C<Bugzilla::Keyword>.
-See L<Bugzilla::Object> for more subroutines that this object
+This is only a list of methods specific to C<Bugzilla::Keyword>.
+See L<Bugzilla::Object> for more methods that this object
implements.
=over
@@ -166,6 +174,18 @@ implements.
Returns: A reference to an array of Keyword objects, or an empty
arrayref if there are no keywords.
+=item C<is_active>
+
+ Description: Indicates if the keyword may be used on a bug
+ Params: none
+ Returns: a boolean value that is true if the keyword can be applied to bugs.
+
+=item C<set_is_active($is_active)>
+
+ Description: Set the is_active property to a boolean value
+ Params: the new value of the is_active property.
+ Returns: nothing
+
=back
=cut