]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Branch fix for bug 253562: Hours Worked (actual_time) is being listed as
authorkiko%async.com.br <>
Thu, 5 Aug 2004 20:48:53 +0000 (20:48 +0000)
committerkiko%async.com.br <>
Thu, 5 Aug 2004 20:48:53 +0000 (20:48 +0000)
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, a218=justdave.

Bugzilla/Bug.pm

index f1a1cf34175bb150ce0784cda1ec05a13c91476b..20c131e2271aa41416b74fb07e1b186810db141d 100755 (executable)
@@ -288,12 +288,14 @@ 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 && 
+                         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'};
 }