From f4915acec3dc0f746d068ba5c8019ed58df8bdfe Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Wed, 26 Oct 2005 23:15:48 +0000 Subject: Bug 303693: Eliminate deprecated Bugzilla::DB routines from describe*.cgi, duplicates.cgi, quips.cgi, report.cgi, request.cgi and showdependency*.cgi - Patch by Teemu Mannermaa r=LpSolit a=myk --- showdependencytree.cgi | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) (limited to 'showdependencytree.cgi') diff --git a/showdependencytree.cgi b/showdependencytree.cgi index dede3e1c7..e369b4d86 100755 --- a/showdependencytree.cgi +++ b/showdependencytree.cgi @@ -33,6 +33,7 @@ use Bugzilla::Bug; Bugzilla->login(); my $cgi = Bugzilla->cgi; +my $dbh = Bugzilla->dbh; my $template = Bugzilla->template; my $vars = {}; @@ -145,27 +146,26 @@ sub GetBug { # Retrieves the necessary information about a bug, stores it in the bug cache, # and returns it to the calling code. my ($id) = @_; - + my $dbh = Bugzilla->dbh; + my $bug = {}; if (Bugzilla->user->can_see_bug($id)) { - SendSQL("SELECT 1, + ($bug->{'exists'}, + $bug->{'status'}, + $bug->{'summary'}, + $bug->{'milestone'}, + $bug->{'assignee_id'}, + $bug->{'assignee_email'}) = $dbh->selectrow_array( + "SELECT 1, bug_status, short_desc, $milestone_column, assignee.userid, assignee.login_name - FROM bugs + FROM bugs INNER JOIN profiles AS assignee ON bugs.assigned_to = assignee.userid - WHERE bugs.bug_id = $id"); - - - ($bug->{'exists'}, - $bug->{'status'}, - $bug->{'summary'}, - $bug->{'milestone'}, - $bug->{'assignee_id'}, - $bug->{'assignee_email'}) = FetchSQLData(); + WHERE bugs.bug_id = ?", undef, $id); } $bug->{'open'} = $bug->{'exists'} && IsOpenedState($bug->{'status'}); @@ -176,19 +176,17 @@ sub GetBug { sub GetDependencies { # Returns a list of dependencies for a given bug. - my ($id, $relationship) = @_; - + my $dbh = Bugzilla->dbh; + my $bug_type = ($relationship eq "blocked") ? "dependson" : "blocked"; - SendSQL(" SELECT $relationship + my $dependencies = $dbh->selectcol_arrayref( + "SELECT $relationship FROM dependencies - WHERE $bug_type = $id - ORDER BY $relationship"); - - my @dependencies = (); - push(@dependencies, FetchOneColumn()) while MoreSQLData(); + WHERE $bug_type = ? + ORDER BY $relationship", undef, $id); - return @dependencies; + return @$dependencies; } -- cgit v1.2.1