summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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; }