Link copied runs to copied cases when cloning a plan

git-svn-id: svn://10.0.0.236/trunk@258768 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
ghendricks%novell.com
2009-10-23 18:55:05 +00:00
parent d4139d19d9
commit 52676fde06
4 changed files with 18 additions and 12 deletions

View File

@@ -816,7 +816,7 @@ Testopia.TestPlan.ClonePanel = function(plan){
var vbox = new Testopia.Product.VersionCombo({
id: 'plan_clone_version_chooser',
hiddenName: 'prod_version',
fieldLabel: 'Product Version',
fieldLabel: '<b>Product Version</b>',
params: {
product_id: plan.product_id
},
@@ -977,12 +977,10 @@ Testopia.TestPlan.ClonePanel = function(plan){
if (checked === true) {
Ext.getCmp('copy_cases_keep_author').enable();
Ext.getCmp('copy_cases_keep_tester').enable();
Ext.getCmp('copy_run_cases_cbox').disable();
}
else {
Ext.getCmp('copy_cases_keep_author').disable();
Ext.getCmp('copy_cases_keep_tester').disable();
Ext.getCmp('copy_run_cases_cbox').enable();
}
}
}
@@ -1035,7 +1033,7 @@ Testopia.TestPlan.ClonePanel = function(plan){
name: 'copy_run_cases',
id: 'copy_run_cases_cbox',
checked: true,
boxLabel: 'Link cases in copied run to original test cases (unchecking will produce an empty test run)',
boxLabel: 'Include test cases (unchecking will produce an empty test run)',
hideLabel: true
}, bbox, ebox]
}]

View File

@@ -2295,7 +2295,7 @@ Testopia.TestPlan.ClonePanel = function(plan){
var vbox = new Testopia.Product.VersionCombo({
id: 'plan_clone_version_chooser',
hiddenName: 'prod_version',
fieldLabel: 'Product Version',
fieldLabel: '<b>Product Version</b>',
params: {
product_id: plan.product_id
},
@@ -2456,12 +2456,10 @@ Testopia.TestPlan.ClonePanel = function(plan){
if (checked === true) {
Ext.getCmp('copy_cases_keep_author').enable();
Ext.getCmp('copy_cases_keep_tester').enable();
Ext.getCmp('copy_run_cases_cbox').disable();
}
else {
Ext.getCmp('copy_cases_keep_author').disable();
Ext.getCmp('copy_cases_keep_tester').disable();
Ext.getCmp('copy_run_cases_cbox').enable();
}
}
}
@@ -2514,7 +2512,7 @@ Testopia.TestPlan.ClonePanel = function(plan){
name: 'copy_run_cases',
id: 'copy_run_cases_cbox',
checked: true,
boxLabel: 'Link cases in copied run to original test cases (unchecking will produce an empty test run)',
boxLabel: 'Include test cases (unchecking will produce an empty test run)',
hideLabel: true
}, bbox, ebox]
}]

File diff suppressed because one or more lines are too long

View File

@@ -69,6 +69,7 @@ elsif ($action eq 'clone'){
my $plan_name = $cgi->param('plan_name');
my $product_id = $cgi->param('product_id');
my $version = $cgi->param('prod_version');
my %case_lookup;
my $product = Testopia::Product->new($product_id);
$product ||= $plan->product;
@@ -153,7 +154,7 @@ elsif ($action eq 'clone'){
my $caseid = $case->copy($case_author, $case_tester, 1, $category->id);
my $newcase = Testopia::TestCase->new($caseid);
$case_lookup{$case->id} = $caseid;
$newcase->link_plan($newplan->id, $caseid);
foreach my $tag (@{$case->tags}){
@@ -190,8 +191,17 @@ elsif ($action eq 'clone'){
}
}
if($cgi->param('copy_run_cases')){
foreach my $cr (@{$run->current_caseruns}){
$newrun->add_case_run($cr->case_id, $cr->sortkey);
if ($cgi->param('make_copy')){
foreach my $cr (@{$run->current_caseruns}){
if ($case_lookup{$cr->case_id}){
$newrun->add_case_run($case_lookup{$cr->case_id}, $cr->sortkey);
}
}
}
else {
foreach my $cr (@{$run->current_caseruns}){
$newrun->add_case_run($cr->case_id, $cr->sortkey);
}
}
}
}