Allow user to add a new case to a list of runs or an existing case from within show_case
git-svn-id: svn://10.0.0.236/trunk@216316 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
b49bae56c0
commit
498e1254af
@ -97,7 +97,9 @@
|
||||
<td align="right"><b>Arguments:</b></td>
|
||||
<td><input name="arguments" id="arguments" value="[% case.arguments FILTER none %]"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th align="right">Add to Runs</th><td colspan="3"><input name="addruns" size="30"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
[% IF action == "Add" %]
|
||||
|
||||
@ -125,6 +125,11 @@ if ($action eq 'Add'){
|
||||
validate_selection($id, 'id', 'components');
|
||||
push @components, $id;
|
||||
}
|
||||
my @runs;
|
||||
foreach my $runid (split(/[\s,]+/, $cgi->param('addruns'))){
|
||||
validate_test_id($runid, 'run');
|
||||
push @runs, Bugzilla::Testopia::TestRun->new($runid);
|
||||
}
|
||||
|
||||
my $case = Bugzilla::Testopia::TestCase->new({
|
||||
'alias' => $alias || undef,
|
||||
@ -179,6 +184,9 @@ if ($action eq 'Add'){
|
||||
$case->add_tag($tag_id);
|
||||
}
|
||||
}
|
||||
foreach my $run (@runs){
|
||||
$run->add_case_run($case->id);
|
||||
}
|
||||
|
||||
$vars->{'action'} = "Commit";
|
||||
$vars->{'form_action'} = "tr_show_case.cgi";
|
||||
|
||||
@ -349,6 +349,11 @@ sub do_update{
|
||||
ValidateBugID($bug);
|
||||
push @buglist, $bug;
|
||||
}
|
||||
my @runs;
|
||||
foreach my $runid (split(/[\s,]+/, $cgi->param('addruns'))){
|
||||
validate_test_id($runid, 'run');
|
||||
push @runs, Bugzilla::Testopia::TestRun->new($runid);
|
||||
}
|
||||
|
||||
ThrowUserError('testiopia-alias-exists',
|
||||
{'alias' => $alias}) if $case->check_alias($alias);
|
||||
@ -385,6 +390,10 @@ sub do_update{
|
||||
foreach my $bug (@buglist){
|
||||
$case->attach_bug($bug);
|
||||
}
|
||||
# Add to runs
|
||||
foreach my $run (@runs){
|
||||
$run->add_case_run($case->id);
|
||||
}
|
||||
$cgi->delete_all;
|
||||
$cgi->param('case_id', $case->id);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user