summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Keyword.pm
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@mozilla.com>2015-05-19 05:48:57 +0200
committerByron Jones <glob@mozilla.com>2015-05-19 05:48:57 +0200
commit64fd94e3c85af86131f34694a188aca380462f99 (patch)
treea97a8168b2bef327e9d0a005b0d5493d159d7ac5 /Bugzilla/Keyword.pm
parent1e23e69630c37096d05e9a3ef31e824e912987d3 (diff)
downloadbugzilla-64fd94e3c85af86131f34694a188aca380462f99.tar.gz
bugzilla-64fd94e3c85af86131f34694a188aca380462f99.tar.xz
Bug 1160430: Backport bug 69267 to BMO (Add the ability to deactivate keywords)
Diffstat (limited to 'Bugzilla/Keyword.pm')
-rw-r--r--Bugzilla/Keyword.pm26
1 files changed, 23 insertions, 3 deletions
diff --git a/Bugzilla/Keyword.pm b/Bugzilla/Keyword.pm
index cda401c59..0cdfaa090 100644
--- a/Bugzilla/Keyword.pm
+++ b/Bugzilla/Keyword.pm
@@ -33,6 +33,7 @@ use constant DB_COLUMNS => qw(
keyworddefs.id
keyworddefs.name
keyworddefs.description
+ keyworddefs.is_active
);
use constant DB_TABLE => 'keyworddefs';
@@ -40,11 +41,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
);
###############################
@@ -69,6 +72,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 ######
@@ -132,6 +136,10 @@ sub _check_description {
return $desc;
}
+sub _check_is_active { return $_[1] ? 1 : 0 }
+
+sub is_active { return $_[0]->{is_active} }
+
1;
__END__
@@ -155,10 +163,10 @@ Bugzilla::Keyword represents a keyword that can be added to a bug.
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
@@ -173,6 +181,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