summaryrefslogtreecommitdiffstats
path: root/extensions/BMO/lib/FakeBug.pm
diff options
context:
space:
mode:
authorDavid Lawrence <dlawrence@mozilla.com>2011-08-11 00:26:03 +0200
committerDavid Lawrence <dlawrence@mozilla.com>2011-08-11 00:26:03 +0200
commit1f30fac936a3b0905e736dd86e559e33caf036ac (patch)
treeff2e0e3ab03e96dd177ef939304ec8a5b04865e5 /extensions/BMO/lib/FakeBug.pm
parent36e4d1fddb336e0ebfb61e0b7870e2b60c666ef5 (diff)
downloadbugzilla-1f30fac936a3b0905e736dd86e559e33caf036ac.tar.gz
bugzilla-1f30fac936a3b0905e736dd86e559e33caf036ac.tar.xz
Initial checkin of bmo/4.0 extensions. Still todo: port changes to core Bugzilla code
Diffstat (limited to 'extensions/BMO/lib/FakeBug.pm')
-rw-r--r--extensions/BMO/lib/FakeBug.pm42
1 files changed, 42 insertions, 0 deletions
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;
+