aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2005-10-26 23:15:48 +0000
committerlpsolit%gmail.com <>2005-10-26 23:15:48 +0000
commitf4915acec3dc0f746d068ba5c8019ed58df8bdfe (patch)
tree8914f41d7e2040beb5c962d2b9cfcff6bf7fdb55 /showdependencytree.cgi
parentBug 313732: fix typo in name of error message variable. Patch by bugzilla.moz... (diff)
downloadbugzilla-f4915acec3dc0f746d068ba5c8019ed58df8bdfe.tar.gz
bugzilla-f4915acec3dc0f746d068ba5c8019ed58df8bdfe.tar.bz2
bugzilla-f4915acec3dc0f746d068ba5c8019ed58df8bdfe.zip
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 <wicked@etlicon.fi> r=LpSolit a=myk
Diffstat (limited to 'showdependencytree.cgi')
-rwxr-xr-xshowdependencytree.cgi40
1 files changed, 19 insertions, 21 deletions
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;
}