diff --git a/mozilla/webtools/testopia/template/en/default/testopia/case/show.html.tmpl b/mozilla/webtools/testopia/template/en/default/testopia/case/show.html.tmpl
index b48b3a8bf64..dad83572d1f 100644
--- a/mozilla/webtools/testopia/template/en/default/testopia/case/show.html.tmpl
+++ b/mozilla/webtools/testopia/template/en/default/testopia/case/show.html.tmpl
@@ -253,7 +253,7 @@ Ext.onReady(function(){
}
}],
buttons: [{
- text: 'Submit',
+ text: 'Update Action/Results',
handler: processText
}]
},{
@@ -291,7 +291,7 @@ Ext.onReady(function(){
}
}],
buttons: [{
- text: 'Submit',
+ text: 'Update Setup/Breakdown',
handler: processText
}]
},
diff --git a/mozilla/webtools/testopia/testopia/js/caserun.js b/mozilla/webtools/testopia/testopia/js/caserun.js
index d27f7b31a31..b10ef571429 100755
--- a/mozilla/webtools/testopia/testopia/js/caserun.js
+++ b/mozilla/webtools/testopia/testopia/js/caserun.js
@@ -907,6 +907,13 @@ CaseRun = function(){
])
});
var store = this.store;
+ store.on('load', function(s,r){
+ Ext.getCmp('action_editor').setValue(r[0].get('action'));
+ Ext.getCmp('effect_editor').setValue(r[0].get('results'));
+ Ext.getCmp('setup_editor').setValue(r[0].get('setup'));
+ Ext.getCmp('breakdown_editor').setValue(r[0].get('breakdown'));
+ });
+
appendNote = function(){
var form = new Ext.form.BasicForm('testopia_helper_frm',{});
form.submit({
@@ -918,6 +925,24 @@ CaseRun = function(){
failure: testopiaError
});
};
+ processText = function(){
+ var testopia_form = new Ext.form.BasicForm('testopia_helper_frm',{});
+ var params = {};
+ params.tcsetup = Ext.getCmp('setup_editor').getValue();
+ params.tcbreakdown = Ext.getCmp('breakdown_editor').getValue();
+ params.tcaction = Ext.getCmp('action_editor').getValue();
+ params.tceffect = Ext.getCmp('effect_editor').getValue();
+ params.case_id = Ext.getCmp('caserun_grid').getSelectionModel().getSelected().get('case_id');
+ params.action = 'update_doc';
+ testopia_form.submit({
+ url: 'tr_process_case.cgi',
+ params: params,
+ success: function(){
+ TestopiaUtil.notify.msg('Test case updated', 'Test Case {0} was updated successfully', 'Document');
+ },
+ failure: testopiaError
+ });
+ }
CaseRun.superclass.constructor.call(this,{
id: 'case_details_panel',
layout: 'fit',
@@ -935,66 +960,81 @@ CaseRun = function(){
title:'Details',
width: 200,
items: [{
- title:'Action & Expected Results',
- id: 'caserun_action_panel',
- border:false,
- bodyBorder: false,
- layout: 'fit',
- autoScroll: true,
- items:[{
- xtype: 'dataview',
- bodyBorder: false,
- store: store,
- itemSelector: 'div.actiondiv',
- loadingText: 'Loading...',
- tpl: new Ext.XTemplate(
- '
',
- '',
- ' ',
- ' ',
- '
{action}',
- '',
- ' ',
- '
{results}',
- '
| ',
- ' ',
- 'Setup: ',
- '{setup}', - ' | ',
- '',
- ' ',
- 'Breakdown: ',
- '{breakdown}', - ' | ',
- '