From 1f30fac936a3b0905e736dd86e559e33caf036ac Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Wed, 10 Aug 2011 18:26:03 -0400 Subject: Initial checkin of bmo/4.0 extensions. Still todo: port changes to core Bugzilla code --- extensions/BMO/lib/FakeBug.pm | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 extensions/BMO/lib/FakeBug.pm (limited to 'extensions/BMO/lib/FakeBug.pm') diff --git a/extensions/BMO/lib/FakeBug.pm b/extensions/BMO/lib/FakeBug.pm new file mode 100644 index 000000000..d8cebe379 --- /dev/null +++ b/extensions/BMO/lib/FakeBug.pm @@ -0,0 +1,42 @@ +package Bugzilla::Extension::BMO::FakeBug; + +use strict; + +# hack to allow the bug entry templates to use check_can_change_field to see if +# various field values should be available to the current user + +use Bugzilla::Bug; + +our $AUTOLOAD; + +sub new { + my $class = shift; + my $self = shift; + bless $self, $class; + return $self; +} + +sub AUTOLOAD { + my $self = shift; + my $name = $AUTOLOAD; + $name =~ s/.*://; + return exists $self->{$name} ? $self->{$name} : undef; +} + +sub check_can_change_field { + my $self = shift; + return Bugzilla::Bug::check_can_change_field($self, @_) +} + +sub _changes_everconfirmed { + my $self = shift; + return Bugzilla::Bug::_changes_everconfirmed($self, @_) +} + +sub everconfirmed { + my $self = shift; + return ($self->{'status'} == 'UNCONFIRMED') ? 0 : 1; +} + +1; + -- cgit v1.2.3-24-g4f1b