Added reports of bugs associated with runs and plans.

This commit is contained in:
ghendricks%novell.com 2006-10-31 18:49:02 +00:00
Родитель 8e05212f0c
Коммит 4fe0f64ddf
5 изменённых файлов: 41 добавлений и 6 удалений

Просмотреть файл

@ -1007,6 +1007,33 @@ sub builds {
} }
=head2 bugs
Returns a reference to a list of Bugzilla::Bug objects associated
with this plan
=cut
sub bugs {
my $self = shift;
my $dbh = Bugzilla->dbh;
return $self->{'bugs'} if exists $self->{'bugs'};
my $ref = $dbh->selectcol_arrayref(
"SELECT DISTINCT bug_id
FROM test_case_bugs
JOIN test_cases ON test_case_bugs.case_id = test_cases.case_id
JOIN test_case_plans ON test_case_plans.case_id = test_cases.case_id
WHERE test_case_plans.plan_id = ?",
undef, $self->id);
my @bugs;
foreach my $id (@{$ref}){
push @bugs, Bugzilla::Bug->new($id, Bugzilla->user->id);
}
$self->{'bugs'} = \@bugs;
$self->{'bug_list'} = join(',', @$ref);
return $self->{'bugs'};
}
=head2 product_name =head2 product_name
Returns the name of the product this plan is associated with Returns the name of the product this plan is associated with

Просмотреть файл

@ -912,7 +912,7 @@ sub bugs {
my $dbh = Bugzilla->dbh; my $dbh = Bugzilla->dbh;
return $self->{'bugs'} if exists $self->{'bugs'}; return $self->{'bugs'} if exists $self->{'bugs'};
my $ref = $dbh->selectcol_arrayref( my $ref = $dbh->selectcol_arrayref(
"SELECT bug_id "SELECT DISTINCT bug_id
FROM test_case_bugs b FROM test_case_bugs b
JOIN test_case_runs r ON r.case_run_id = b.case_run_id JOIN test_case_runs r ON r.case_run_id = b.case_run_id
WHERE r.run_id = ?", WHERE r.run_id = ?",
@ -922,6 +922,7 @@ sub bugs {
push @bugs, Bugzilla::Bug->new($id, Bugzilla->user->id); push @bugs, Bugzilla::Bug->new($id, Bugzilla->user->id);
} }
$self->{'bugs'} = \@bugs; $self->{'bugs'} = \@bugs;
$self->{'bug_list'} = join(',', @$ref);
return $self->{'bugs'}; return $self->{'bugs'};
} }

Просмотреть файл

@ -254,10 +254,13 @@
[%### Reports ###%] [%### Reports ###%]
<br><br> <br><br>
<h3>Reports</h3> <h3>Reports</h3>
<a href="tr_plan_reports.cgi?plan_id=[% plan.id FILTER none %]&type=build_coverage">Build Coverage</a> <a href="tr_plan_reports.cgi?plan_id=[% plan.id FILTER none %]&type=build_coverage">Build Coverage</a><br/>
<a href="tr_query.cgi?current_tab=plan&report=1">General Reports</a> <a href="tr_query.cgi?current_tab=plan&report=1">General Reports</a><br/>
[% IF plan.bugs %]
<a href="buglist.cgi?bug_id=[% plan.bug_list FILTER none %]">Bugs Found in this Plan</a><br>
[% END %]
[%##### Edit Plan #####%] [%##### Edit Plan #####%]
<br><br> <br>
[% IF plan.canedit %] [% IF plan.canedit %]
<h3>Attributes</h3> <h3>Attributes</h3>
<div id="edit_plan"> <div id="edit_plan">

Просмотреть файл

@ -188,8 +188,11 @@
[%##### Reports #####%] [%##### Reports #####%]
<br><br> <br><br>
<h3>Reports</h3> <h3>Reports</h3>
<a href="tr_query.cgi?current_tab=run&report=1">General Reports</a> <a href="tr_query.cgi?current_tab=run&report=1">General Reports</a><br>
<br><br> [% IF run.bugs %]
<a href="buglist.cgi?bug_id=[% run.bug_list FILTER none %]">Bugs Found in this Run</a><br>
[% END %]
<br>
[%##### Categories and Tags #####%] [%##### Categories and Tags #####%]
<h3>CC, Coverage, Tags</h3> <h3>CC, Coverage, Tags</h3>

Просмотреть файл

@ -150,6 +150,7 @@ if ($action eq 'Commit'){
$vars->{'run'} = $run; $vars->{'run'} = $run;
$vars->{'table'} = $table; $vars->{'table'} = $table;
$vars->{'action'} = 'Commit'; $vars->{'action'} = 'Commit';
$vars->{'backlink'} = $run;
$vars->{'form_action'} = "tr_show_run.cgi"; $vars->{'form_action'} = "tr_show_run.cgi";
$template->process("testopia/run/show.html.tmpl", $vars) || $template->process("testopia/run/show.html.tmpl", $vars) ||
ThrowTemplateError($template->error()); ThrowTemplateError($template->error());