Bug 538350 - Bug description is not added in test case action field when creating test case from a bug

git-svn-id: svn://10.0.0.236/trunk@259429 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
ghendricks%novell.com
2010-01-18 23:09:21 +00:00
parent 2663d9c6aa
commit e944341012
6 changed files with 73 additions and 72 deletions

View File

@@ -1232,19 +1232,18 @@ Testopia.TestCase.NewCaseForm = function(plan_ids, product_id, run_id){
scrollable: true,
listeners: {
'initialize': function(h){
if (!h.getValue()) {
var httpRequest = new Ext.data.Connection();
httpRequest.request({
url: 'tr_quicksearch.cgi',
params: {
action: 'get_action'
},
success: function(d){
h.setValue(d.responseText);
},
failure: Testopia.Util.error
});
}
var httpRequest = new Ext.data.Connection();
httpRequest.request({
url: 'tr_quicksearch.cgi',
params: {
action: 'get_action',
bug_id: Ext.urlDecode(location.search.substring(1)).bug
},
success: function(d){
h.setValue(d.responseText);
},
failure: Testopia.Util.error
});
}
}
}]
@@ -1261,19 +1260,18 @@ Testopia.TestCase.NewCaseForm = function(plan_ids, product_id, run_id){
scrollable: true,
listeners: {
'initialize': function(h){
if (!h.getValue()) {
var httpRequest = new Ext.data.Connection();
httpRequest.request({
url: 'tr_quicksearch.cgi',
params: {
action: 'get_effect'
},
success: function(d){
h.setValue(d.responseText);
},
failure: Testopia.Util.error
});
}
var httpRequest = new Ext.data.Connection();
httpRequest.request({
url: 'tr_quicksearch.cgi',
params: {
action: 'get_effect',
bug_id: Ext.urlDecode(location.search.substring(1)).bug
},
success: function(d){
h.setValue(d.responseText);
},
failure: Testopia.Util.error
});
}
}
}]

View File

@@ -49,8 +49,6 @@ Ext.onReady(function(){
[% IF bugs %]
Ext.getCmp('ncf-bugs').setValue('[% bugs FILTER js %]');
[% END %]
Ext.getCmp('ncf-action').setValue('[% tc.text.action FILTER js %]');
Ext.getCmp('ncf-effect').setValue('[% tc.text.effect FILTER js %]');
});
</script>

View File

@@ -3816,19 +3816,18 @@ Testopia.TestCase.NewCaseForm = function(plan_ids, product_id, run_id){
scrollable: true,
listeners: {
'initialize': function(h){
if (!h.getValue()) {
var httpRequest = new Ext.data.Connection();
httpRequest.request({
url: 'tr_quicksearch.cgi',
params: {
action: 'get_action'
},
success: function(d){
h.setValue(d.responseText);
},
failure: Testopia.Util.error
});
}
var httpRequest = new Ext.data.Connection();
httpRequest.request({
url: 'tr_quicksearch.cgi',
params: {
action: 'get_action',
bug_id: Ext.urlDecode(location.search.substring(1)).bug
},
success: function(d){
h.setValue(d.responseText);
},
failure: Testopia.Util.error
});
}
}
}]
@@ -3845,19 +3844,18 @@ Testopia.TestCase.NewCaseForm = function(plan_ids, product_id, run_id){
scrollable: true,
listeners: {
'initialize': function(h){
if (!h.getValue()) {
var httpRequest = new Ext.data.Connection();
httpRequest.request({
url: 'tr_quicksearch.cgi',
params: {
action: 'get_effect'
},
success: function(d){
h.setValue(d.responseText);
},
failure: Testopia.Util.error
});
}
var httpRequest = new Ext.data.Connection();
httpRequest.request({
url: 'tr_quicksearch.cgi',
params: {
action: 'get_effect',
bug_id: Ext.urlDecode(location.search.substring(1)).bug
},
success: function(d){
h.setValue(d.responseText);
},
failure: Testopia.Util.error
});
}
}
}]

File diff suppressed because one or more lines are too long

View File

@@ -171,31 +171,17 @@ else {
my $short_desc = $bug->short_desc;
$summary = Bugzilla->params->{"bug-to-test-case-summary"};
my $action = Bugzilla->params->{"bug-to-test-case-action"};
my $effect = Bugzilla->params->{"bug-to-test-case-results"};
$summary =~ s/%id%/$bug_id/g;
$summary =~ s/%summary%/$short_desc/g;
$action =~ s/%id%/<a href="show_bug.cgi?id=$bug_id">$bug_id<\/a>/g;
$action =~ s/%description%/$description/g;
$effect =~ s/%id%/<a href="show_bug.cgi?id=$bug_id">$bug_id<\/a>/g;
$text = {'action' => $action, 'effect' => $effect};
$vars->{'bugs'} = $bug->bug_id;
}
else {
$text = {'action' => Bugzilla->params->{"new-case-action-template"},
'effect' => Bugzilla->params->{"new-case-results-template"}};
}
my $case = Testopia::TestCase->new(
{'plans' => join(',', @plan_ids),
'category' => {name => '--default--'},
'summary' => $summary,
'text' => $text,
});
$vars->{'tc'} = $case;

View File

@@ -456,11 +456,32 @@ else{
exit;
}
elsif ($action eq 'get_action'){
print Bugzilla->params->{'new-case-action-template'};
if( $cgi->param('bug_id')){
my $bug = Bugzilla::Bug->new($cgi->param('bug'),Bugzilla->user->id);
my $tcaction = Bugzilla->params->{"bug-to-test-case-action"};
my $bug_id = $bug->bug_id;
my $description = '<br><pre>' . wrap_comment(@{Bugzilla::Bug::GetComments($bug_id,'oldest_to_newest')}[0]->{'body'}) . '</pre>';
$tcaction =~ s/%id%/<a href="show_bug.cgi?id=$bug_id">$bug_id<\/a>/g;
$tcaction =~ s/%description%/$description/g;
print $tcaction;
}
else {
print Bugzilla->params->{'new-case-action-template'};
}
}
elsif ($action eq 'get_effect'){
print Bugzilla->params->{'new-case-results-template'};
if( $cgi->param('bug_id')){
my $effect = Bugzilla->params->{"bug-to-test-case-results"};
my $bug_id = $cgi->param('bug_id');
$effect =~ s/%id%/<a href="show_bug.cgi?id=$bug_id">$bug_id<\/a>/g;
print $effect;
}
else{
print Bugzilla->params->{'new-case-results-template'};
}
}
# If neither is true above, display the quicksearch form and explanation.