summaryrefslogtreecommitdiffstats
path: root/extensions/TrackingFlags/lib/Flag
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2014-07-22 09:23:21 +0200
committerByron Jones <glob@mozilla.com>2014-07-22 09:23:21 +0200
commitbff9f8e135cdf6e72228d7502cf160b3bdd9bde4 (patch)
treeda82f0b3b2b4e3d44b4c4bf00be9f07854f15717 /extensions/TrackingFlags/lib/Flag
parent235190a76c418d89f808f48d174bdcde5add4073 (diff)
downloadbugzilla-bff9f8e135cdf6e72228d7502cf160b3bdd9bde4.tar.gz
bugzilla-bff9f8e135cdf6e72228d7502cf160b3bdd9bde4.tar.xz
Bug 713307: Please add FlagTypeComments for tracking/approval flags
Diffstat (limited to 'extensions/TrackingFlags/lib/Flag')
-rw-r--r--extensions/TrackingFlags/lib/Flag/Value.pm14
1 files changed, 13 insertions, 1 deletions
diff --git a/extensions/TrackingFlags/lib/Flag/Value.pm b/extensions/TrackingFlags/lib/Flag/Value.pm
index 4023e191d..964d76810 100644
--- a/extensions/TrackingFlags/lib/Flag/Value.pm
+++ b/extensions/TrackingFlags/lib/Flag/Value.pm
@@ -14,7 +14,7 @@ use warnings;
use Bugzilla::Error;
use Bugzilla::Group;
-use Bugzilla::Util qw(detaint_natural);
+use Bugzilla::Util qw(detaint_natural trim);
use Scalar::Util qw(blessed);
###############################
@@ -30,6 +30,7 @@ use constant DB_COLUMNS => qw(
value
sortkey
is_active
+ comment
);
use constant LIST_ORDER => 'sortkey';
@@ -39,6 +40,7 @@ use constant UPDATE_COLUMNS => qw(
value
sortkey
is_active
+ comment
);
use constant VALIDATORS => {
@@ -47,6 +49,7 @@ use constant VALIDATORS => {
value => \&_check_value,
sortkey => \&_check_sortkey,
is_active => \&Bugzilla::Object::check_boolean,
+ comment => \&_check_comment,
};
###############################
@@ -86,6 +89,13 @@ sub _check_sortkey {
return $sortkey;
}
+sub _check_comment {
+ my ($invocant, $value) = @_;
+ return undef unless defined $value;
+ $value = trim($value);
+ return $value eq '' ? undef : $value;
+}
+
###############################
#### Setters ####
###############################
@@ -94,6 +104,7 @@ sub set_setter_group_id { $_[0]->set('setter_group_id', $_[1]); }
sub set_value { $_[0]->set('value', $_[1]); }
sub set_sortkey { $_[0]->set('sortkey', $_[1]); }
sub set_is_active { $_[0]->set('is_active', $_[1]); }
+sub set_comment { $_[0]->set('comment', $_[1]); }
###############################
#### Accessors ####
@@ -104,6 +115,7 @@ sub setter_group_id { return $_[0]->{'setter_group_id'}; }
sub value { return $_[0]->{'value'}; }
sub sortkey { return $_[0]->{'sortkey'}; }
sub is_active { return $_[0]->{'is_active'}; }
+sub comment { return $_[0]->{'comment'}; }
sub tracking_flag {
return $_[0]->{'tracking_flag'} ||= Bugzilla::Extension::TrackingFlags::Flag->new({