summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Bug.pm
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2010-07-07 23:34:25 +0200
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-07-07 23:34:25 +0200
commit87ea46f7fa2b269f065181f7765352184bb59717 (patch)
tree20e37379d319535c954480e86765a580342118bd /Bugzilla/Bug.pm
parent814b24fdc9407a741967322041ff817665f8e00b (diff)
downloadbugzilla-87ea46f7fa2b269f065181f7765352184bb59717.tar.gz
bugzilla-87ea46f7fa2b269f065181f7765352184bb59717.tar.xz
Bug 574879: Create a test that assures the correctness of Search.pm's
boolean charts r=glob, a=mkanat
Diffstat (limited to 'Bugzilla/Bug.pm')
-rw-r--r--Bugzilla/Bug.pm11
1 files changed, 11 insertions, 0 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index ed302a053..e32add2e1 100644
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -3203,6 +3203,17 @@ sub comments {
return \@comments;
}
+# This is needed by xt/search.t.
+sub percentage_complete {
+ my $self = shift;
+ return undef if $self->{'error'} || !Bugzilla->user->is_timetracker;
+ my $remaining = $self->remaining_time;
+ my $actual = $self->actual_time;
+ my $total = $remaining + $actual;
+ return undef if $total == 0;
+ return 100 * ($actual / $total);
+}
+
sub product {
my ($self) = @_;
return $self->{product} if exists $self->{product};