diff options
author | lpsolit%gmail.com <> | 2005-10-27 01:15:48 +0200 |
---|---|---|
committer | lpsolit%gmail.com <> | 2005-10-27 01:15:48 +0200 |
commit | f4915acec3dc0f746d068ba5c8019ed58df8bdfe (patch) | |
tree | 8914f41d7e2040beb5c962d2b9cfcff6bf7fdb55 /showdependencygraph.cgi | |
parent | ba7c33a6c05815453f8ca694f8aec3a6907720c9 (diff) | |
download | bugzilla-f4915acec3dc0f746d068ba5c8019ed58df8bdfe.tar.gz bugzilla-f4915acec3dc0f746d068ba5c8019ed58df8bdfe.tar.xz |
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 'showdependencygraph.cgi')
-rwxr-xr-x | showdependencygraph.cgi | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/showdependencygraph.cgi b/showdependencygraph.cgi index fee477f3a..4fe63df2a 100755 --- a/showdependencygraph.cgi +++ b/showdependencygraph.cgi @@ -36,6 +36,7 @@ require "globals.pl"; Bugzilla->login(); my $cgi = Bugzilla->cgi; +my $dbh = Bugzilla->dbh; my $template = Bugzilla->template; my $vars = {}; @@ -122,10 +123,11 @@ node [URL="${urlbase}show_bug.cgi?id=\\N", style=filled, color=lightgrey] my %baselist; if ($cgi->param('doall')) { - SendSQL("SELECT blocked, dependson FROM dependencies"); + my $dependencies = $dbh->selectall_arrayref( + "SELECT blocked, dependson FROM dependencies"); - while (MoreSQLData()) { - my ($blocked, $dependson) = FetchSQLData(); + foreach my $dependency (@$dependencies) { + my ($blocked, $dependson) = @$dependency; AddLink($blocked, $dependson, $fh); } } else { @@ -136,12 +138,14 @@ if ($cgi->param('doall')) { } my @stack = keys(%baselist); + my $sth = $dbh->prepare( + q{SELECT blocked, dependson + FROM dependencies + WHERE blocked = ? or dependson = ?}); foreach my $id (@stack) { - SendSQL("SELECT blocked, dependson - FROM dependencies - WHERE blocked = $id or dependson = $id"); - while (MoreSQLData()) { - my ($blocked, $dependson) = FetchSQLData(); + my $dependencies = $dbh->selectall_arrayref($sth, undef, ($id, $id)); + foreach my $dependency (@$dependencies) { + my ($blocked, $dependson) = @$dependency; if ($blocked != $id && !exists $seen{$blocked}) { push @stack, $blocked; } @@ -159,16 +163,13 @@ if ($cgi->param('doall')) { } } +my $sth = $dbh->prepare( + q{SELECT bug_status, resolution, short_desc + FROM bugs + WHERE bugs.bug_id = ?}); foreach my $k (keys(%seen)) { - my $summary = ""; - my $stat; - my $resolution; - # Retrieve bug information from the database - - SendSQL("SELECT bug_status, resolution, short_desc FROM bugs " . - "WHERE bugs.bug_id = $k"); - ($stat, $resolution, $summary) = FetchSQLData(); + my ($stat, $resolution, $summary) = $dbh->selectrow_array($sth, undef, $k); $stat ||= 'NEW'; $resolution ||= ''; $summary ||= ''; |