Copy compoenets field when you copy test cases.

This commit is contained in:
ghendricks%novell.com 2007-01-09 21:42:41 +00:00
Родитель 23c0b80055
Коммит a19af15e62
2 изменённых файлов: 14 добавлений и 0 удалений

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

@ -783,11 +783,23 @@ sub copy {
my $key = $dbh->bz_last_key( 'test_cases', 'case_id' ); my $key = $dbh->bz_last_key( 'test_cases', 'case_id' );
my $components_ref = $dbh->selectcol_arrayref(
"SELECT component_id
FROM test_case_components
WHERE case_id = ?",
undef, $self->id);
foreach my $comp_id (@{$components_ref}){
$dbh->do("INSERT INTO test_case_components
VALUES(?,?)", undef, $key, $comp_id);
}
if ($copydoc){ if ($copydoc){
$self->store_text($key, Bugzilla->user->id, $self->text->{'action'}, $self->store_text($key, Bugzilla->user->id, $self->text->{'action'},
$self->text->{'effect'}, $self->text->{'setup'}, $self->text->{'effect'}, $self->text->{'setup'},
$self->text->{'breakdown'},'VRESET' , $timestamp); $self->text->{'breakdown'},'VRESET' , $timestamp);
} }
return $key; return $key;
} }

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

@ -165,10 +165,12 @@ elsif ($action eq 'do_clone'){
} }
my $case = Bugzilla::Testopia::TestCase->new($id); my $case = Bugzilla::Testopia::TestCase->new($id);
# Copy test cases creating new ones
if ($cgi->param('copy_cases') == 2 ){ if ($cgi->param('copy_cases') == 2 ){
my $caseid = $case->copy($newplan->id, $author, 1); my $caseid = $case->copy($newplan->id, $author, 1);
$case->link_plan($newplan->id, $caseid); $case->link_plan($newplan->id, $caseid);
} }
# Just create a link
else { else {
$case->link_plan($newplan->id); $case->link_plan($newplan->id);
} }