summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2013-09-13 00:10:38 +0200
committerDave Lawrence <dlawrence@mozilla.com>2013-09-13 00:10:38 +0200
commitce2dca7ce56ff9806fa72d781c21e47fa750ef98 (patch)
treeb9870e5c8f507c73fb4efe28d1ff1f5eb469cbbc
parent4c13bdb3aadba6bdde21ef6335f92a8e93c336af (diff)
downloadbugzilla-ce2dca7ce56ff9806fa72d781c21e47fa750ef98.tar.gz
bugzilla-ce2dca7ce56ff9806fa72d781c21e47fa750ef98.tar.xz
Bug 915830 - Tracking flags don't contain values
-rw-r--r--extensions/TrackingFlags/Extension.pm19
-rw-r--r--extensions/TrackingFlags/lib/Flag.pm2
2 files changed, 20 insertions, 1 deletions
diff --git a/extensions/TrackingFlags/Extension.pm b/extensions/TrackingFlags/Extension.pm
index b79faef61..0dc3248ac 100644
--- a/extensions/TrackingFlags/Extension.pm
+++ b/extensions/TrackingFlags/Extension.pm
@@ -546,4 +546,23 @@ sub mailer_before_send {
}
}
+sub bug_check_can_change_field {
+ my ($self, $args) = @_;
+ my $field = $args->{'field'};
+ my $old_value = $args->{'old_value'};
+ my $new_value = $args->{'new_value'};
+ my $priv_results = $args->{'priv_results'};
+
+ my $flag = Bugzilla::Extension::TrackingFlags::Flag->new(
+ { name => $field });
+ $flag || return;
+
+ # Used by show_bug to determine if field is visible so always allow
+ return if ($old_value == 0 && $new_value == 1);
+
+ if (defined $new_value && !$flag->can_set_value($new_value)) {
+ push (@$priv_results, PRIVILEGES_REQUIRED_EMPOWERED);
+ }
+}
+
__PACKAGE__->NAME;
diff --git a/extensions/TrackingFlags/lib/Flag.pm b/extensions/TrackingFlags/lib/Flag.pm
index f7eb674ee..aa3649643 100644
--- a/extensions/TrackingFlags/lib/Flag.pm
+++ b/extensions/TrackingFlags/lib/Flag.pm
@@ -429,7 +429,7 @@ sub type { return FIELD_TYPE_EXTENSION; }
sub legal_values { return $_[0]->values; }
sub custom { return 1; }
sub in_new_bugmail { return 1; }
-sub obsolete { return $_[0]->is_active ? 1 : 0; }
+sub obsolete { return $_[0]->is_active ? 0 : 1; }
sub buglist { return 1; }
sub is_select { return 1; }
sub is_abnormal { return 1; }