summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkiko%async.com.br <>2004-08-05 22:43:48 +0200
committerkiko%async.com.br <>2004-08-05 22:43:48 +0200
commit2774974964c541c312fb98e507a597964473e355 (patch)
tree2fcade8a60206eaaaccd7a5e9306d38fafdfd871
parent1e04722ba31ed01dc11deb94416145ebafdf9d25 (diff)
downloadbugzilla-2774974964c541c312fb98e507a597964473e355.tar.gz
bugzilla-2774974964c541c312fb98e507a597964473e355.tar.xz
Fix for bug 253562: Hours Worked (actual_time) is being listed as 1.
Cleans up Bugzilla::Bug::actual_time to do things the right way (dbi, Bugzilla->user) and apparently fixes a problem limited to some platforms. r=joel, a=justdave.
-rwxr-xr-xBugzilla/Bug.pm11
1 files changed, 6 insertions, 5 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index 01d2321c4..31b48649b 100755
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -289,12 +289,13 @@ sub actual_time {
return $self->{'actual_time'} if exists $self->{'actual_time'};
- if (&::UserInGroup(Param("timetrackinggroup"))) {
- &::SendSQL("SELECT SUM(work_time)
- FROM longdescs WHERE longdescs.bug_id=$self->{bug_id}");
- $self->{'actual_time'} = &::FetchSQLData();
- }
+ return undef unless Bugzilla->user->in_group(Param("timetrackinggroup"));
+ my $sth = Bugzilla->dbh->prepare("SELECT SUM(work_time)
+ FROM longdescs
+ WHERE longdescs.bug_id=?");
+ $sth->execute($self->{bug_id});
+ $self->{'actual_time'} = $sth->fetchrow_array();
return $self->{'actual_time'};
}