From eff3965cf70aedb0cf7128fe7d0ea2cae35bd86b Mon Sep 17 00:00:00 2001
From: "ghendricks%novell.com"
Date: Wed, 17 Sep 2008 21:06:04 +0000
Subject: [PATCH] Bug 455359 - Environment editor fails for environments with
names containing apostrophes Fix error in linking and deleting saved
searches
git-svn-id: svn://10.0.0.236/trunk@254278 18797224-902f-48f8-a5cc-f745e15eee43
---
.../testopia/environment/show.html.tmpl | 2 +-
.../webtools/testopia/testopia/js/search.js | 48 ++--
mozilla/webtools/testopia/testopia/js/util.js | 2 +-
.../testopia/testopia/testopia.all.js | 229 ++++--------------
.../testopia/testopia/testopia.all.ycomp.js | 2 +-
5 files changed, 74 insertions(+), 209 deletions(-)
diff --git a/mozilla/webtools/testopia/template/en/default/testopia/environment/show.html.tmpl b/mozilla/webtools/testopia/template/en/default/testopia/environment/show.html.tmpl
index 95401be34b9..63e81c35edb 100644
--- a/mozilla/webtools/testopia/template/en/default/testopia/environment/show.html.tmpl
+++ b/mozilla/webtools/testopia/template/en/default/testopia/environment/show.html.tmpl
@@ -74,7 +74,7 @@ Ext.onReady(function(){
split: true,
id: 'environment_tree',
root: new Tree.AsyncTreeNode({
- text: '[% environment.name %]',
+ text: '[% environment.name FILTER js %]',
draggable:false,
id: '[% environment.id %]',
type: 'environment'
diff --git a/mozilla/webtools/testopia/testopia/js/search.js b/mozilla/webtools/testopia/testopia/js/search.js
index 0bcd1f2f6dd..71892cb6cbd 100644
--- a/mozilla/webtools/testopia/testopia/js/search.js
+++ b/mozilla/webtools/testopia/testopia/js/search.js
@@ -574,7 +574,29 @@ Ext.extend(ReportGrid, Ext.grid.GridPanel, {
text: 'Delete',
icon: 'testopia/img/delete.png',
iconCls: 'img_button_16x',
- handler: this.deleteSearch.createDelegate(this)
+ handler: function (){
+ var form = new Ext.form.BasicForm('testopia_helper_frm',{});
+ Ext.Msg.show({
+ msg: 'Are you sure you want to delete this search?',
+ buttons: Ext.MessageBox.YESNO,
+ icon: Ext.MessageBox.QUESTION,
+ fn: function(btn, text){
+ if (btn == 'yes'){
+ var r = grid.store.getAt(index);
+ form.submit({
+ url: 'tr_query.cgi',
+ params: {action: 'delete_query', query_name: r.get('name')},
+ success: function(){
+ if (grid){
+ grid.store.load();
+ }
+ },
+ failure: testopiaError
+ });
+ }
+ }
+ });
+ }
},{
text: 'Refresh List',
icon: 'testopia/img/refresh.png',
@@ -587,30 +609,6 @@ Ext.extend(ReportGrid, Ext.grid.GridPanel, {
e.stopEvent();
this.menu.showAt(e.getXY());
},
- deleteSearch: function(){
- var grid = this;
- var form = new Ext.form.BasicForm('testopia_helper_frm',{});
- Ext.Msg.show({
- msg: 'Are you sure you want to delete this search?',
- buttons: Ext.MessageBox.YESNO,
- icon: Ext.MessageBox.QUESTION,
- fn: function(btn, text){
- if (btn == 'yes'){
- var r = grid.getSelectionModel().getSelected();
- form.submit({
- url: 'tr_query.cgi',
- params: {action: 'delete_query', query_name: r.get('name')},
- success: function(){
- if (grid){
- grid.store.load();
- }
- },
- failure: testopiaError
- });
- }
- }
- });
- },
onActivate: function(event){
if (!this.store.getCount()){
this.store.load();
diff --git a/mozilla/webtools/testopia/testopia/js/util.js b/mozilla/webtools/testopia/testopia/js/util.js
index d403dfabcd7..9a08ce49aa7 100755
--- a/mozilla/webtools/testopia/testopia/js/util.js
+++ b/mozilla/webtools/testopia/testopia/js/util.js
@@ -1526,7 +1526,7 @@ linkPopup = function(params){
plain: true,
shadow: false,
items: [new Ext.form.TextField({
- value: unceodeURI(l.protocol + '//' + l.host + pathprefix + '/' + file + '?' + jsonToSearch(params,'',['ctype'])),
+ value: encodeURI(l.protocol + '//' + l.host + pathprefix + '/' + file + '?' + jsonToSearch(params,'',['ctype'])),
width: 287
})]
});
diff --git a/mozilla/webtools/testopia/testopia/testopia.all.js b/mozilla/webtools/testopia/testopia/testopia.all.js
index 051f8641500..d0d3cc7fd90 100644
--- a/mozilla/webtools/testopia/testopia/testopia.all.js
+++ b/mozilla/webtools/testopia/testopia/testopia.all.js
@@ -3,7 +3,7 @@
*/
/*
- * START OF FILE - /bnc-3.0/testopia/js/strings.js
+ * START OF FILE - /bnc-branch/testopia/js/strings.js
*/
/*
* The contents of this file are subject to the Mozilla Public
@@ -34,11 +34,11 @@ RUN_DELETE_WARNING = 'You are about to delete the selected test runs including a
CASERUN_DELETE_WARNING = 'You are about to remove the selected test cases from this run including all history. This action cannot be undone. Are you sure you want to continue?';
ENVIRONMENT_DELETE_WARNING = 'You are about to delete the selected test environment including associated test case data. This action cannot be undone. Are you sure you want to continue?';
/*
- * END OF FILE - /bnc-3.0/testopia/js/strings.js
+ * END OF FILE - /bnc-branch/testopia/js/strings.js
*/
/*
- * START OF FILE - /bnc-3.0/testopia/js/util.js
+ * START OF FILE - /bnc-branch/testopia/js/util.js
*/
/*
* The contents of this file are subject to the Mozilla Public
@@ -1568,7 +1568,7 @@ linkPopup = function(params){
plain: true,
shadow: false,
items: [new Ext.form.TextField({
- value: unceodeURI(l.protocol + '//' + l.host + pathprefix + '/' + file + '?' + jsonToSearch(params,'',['ctype'])),
+ value: encodeURI(l.protocol + '//' + l.host + pathprefix + '/' + file + '?' + jsonToSearch(params,'',['ctype'])),
width: 287
})]
});
@@ -1698,11 +1698,11 @@ Testopia.Util.PlanSelector = function(product_id, cfg){
Ext.extend(Testopia.Util.PlanSelector, Ext.Panel);
/*
- * END OF FILE - /bnc-3.0/testopia/js/util.js
+ * END OF FILE - /bnc-branch/testopia/js/util.js
*/
/*
- * START OF FILE - /bnc-3.0/testopia/js/attachments.js
+ * START OF FILE - /bnc-branch/testopia/js/attachments.js
*/
/*
* The contents of this file are subject to the Mozilla Public
@@ -2059,11 +2059,11 @@ NewAttachmentPopup = function(object){
};
/*
- * END OF FILE - /bnc-3.0/testopia/js/attachments.js
+ * END OF FILE - /bnc-branch/testopia/js/attachments.js
*/
/*
- * START OF FILE - /bnc-3.0/testopia/js/plan.js
+ * START OF FILE - /bnc-branch/testopia/js/plan.js
*/
/*
* The contents of this file are subject to the Mozilla Public
@@ -2943,11 +2943,11 @@ PlanClonePopup = function(plan){
};
/*
- * END OF FILE - /bnc-3.0/testopia/js/plan.js
+ * END OF FILE - /bnc-branch/testopia/js/plan.js
*/
/*
- * START OF FILE - /bnc-3.0/testopia/js/case.js
+ * START OF FILE - /bnc-branch/testopia/js/case.js
*/
/*
* The contents of this file are subject to the Mozilla Public
@@ -4262,11 +4262,11 @@ caseClonePopup = function(product_id, cases){
};
/*
- * END OF FILE - /bnc-3.0/testopia/js/case.js
+ * END OF FILE - /bnc-branch/testopia/js/case.js
*/
/*
- * START OF FILE - /bnc-3.0/testopia/js/caserun.js
+ * START OF FILE - /bnc-branch/testopia/js/caserun.js
*/
/*
* The contents of this file are subject to the Mozilla Public
@@ -6002,11 +6002,11 @@ BugsUpdate = function(grid){
win.show();
};
/*
- * END OF FILE - /bnc-3.0/testopia/js/caserun.js
+ * END OF FILE - /bnc-branch/testopia/js/caserun.js
*/
/*
- * START OF FILE - /bnc-3.0/testopia/js/run.js
+ * START OF FILE - /bnc-branch/testopia/js/run.js
*/
/*
* The contents of this file are subject to the Mozilla Public
@@ -7373,11 +7373,11 @@ Testopia.BugReport = function(params){
};
Ext.extend(Testopia.BugReport, Ext.grid.GridPanel);
/*
- * END OF FILE - /bnc-3.0/testopia/js/run.js
+ * END OF FILE - /bnc-branch/testopia/js/run.js
*/
/*
- * START OF FILE - /bnc-3.0/testopia/js/build.js
+ * START OF FILE - /bnc-branch/testopia/js/build.js
*/
/*
* The contents of this file are subject to the Mozilla Public
@@ -7609,11 +7609,11 @@ Ext.extend(BuildGrid, Ext.grid.EditorGridPanel, {
});
/*
- * END OF FILE - /bnc-3.0/testopia/js/build.js
+ * END OF FILE - /bnc-branch/testopia/js/build.js
*/
/*
- * START OF FILE - /bnc-3.0/testopia/js/category.js
+ * START OF FILE - /bnc-branch/testopia/js/category.js
*/
/*
* The contents of this file are subject to the Mozilla Public
@@ -7841,142 +7841,11 @@ confirmCaseCategoryDelete = function(){
/*
- * END OF FILE - /bnc-3.0/testopia/js/category.js
+ * END OF FILE - /bnc-branch/testopia/js/category.js
*/
/*
- * START OF FILE - /bnc-3.0/testopia/js/diff-tabs.js
- */
-Ext.ux.TabCloseMenu = function(){
- var tabs, menu, ctxItem;
- this.init = function(tp){
- tabs = tp;
- tabs.on('contextmenu', onContextMenu);
- }
-
- function onContextMenu(ts, item, e){
- if(!menu){ // create context menu on first right click
- menu = new Ext.menu.Menu([{
- id: tabs.id + '-close',
- text: 'Close Tab',
- handler : function(){
- tabs.remove(ctxItem);
- }
- },{
- id: tabs.id + '-close-others',
- text: 'Close Other Tabs',
- handler : function(){
- tabs.items.each(function(item){
- if(item.closable && item != ctxItem){
- tabs.remove(item);
- }
- });
- }
- }]);
- }
- ctxItem = item;
- var items = menu.items;
- items.get(tabs.id + '-close').setDisabled(!item.closable);
- var disableOthers = true;
- tabs.items.each(function(){
- if(this != item && this.closable){
- disableOthers = false;
- return false;
- }
- });
- items.get(tabs.id + '-close-others').setDisabled(disableOthers);
- menu.showAt(e.getPoint());
- }
-};
-
-diff_tab_panel = function(type, id, doctype){
- var self = this;
-
- var doc_store = new Ext.data.JsonStore({
- url: "tr_history.cgi",
- baseParams: {action: 'getversions',
- type: type,
- id: id},
- root: 'versions',
- fields: [
- {name: 'name', mapping: 'name',
- name: 'id', mapping: 'id'}
- ]
- })
-
-
- diff_tab_panel.superclass.constructor.call(this, {
- title: 'Test Panel',
- height: 500,
- resizeTabs:true, // turn on tab resizing
- minTabWidth: 115,
- tabWidth:135,
- enableTabScroll:true,
- defaults: {autoScroll:true},
- plugins: new Ext.ux.TabCloseMenu(),
- activeTab: 0,
- tbar: [
- new Ext.form.ComboBox({
- displayField: 'name',
- valueField: 'id',
- name: 'product',
- id: 'product_combo',
- fieldLabel: "Product",
- store: doc_store,
- emptyText: 'Select a version...',
- width: 200
- }),
- " Right: ",
- new Ext.Toolbar.Spacer(),
- new Ext.form.ComboBox({
- }),
- " HTML: ",
- new Ext.form.Radio({
- id: 'format',
- value: 'html',
- checked: true
- }),
- " Raw: ",
- new Ext.form.Radio({
- id: 'format',
- value: 'raw'
- }),
- new Ext.Button({
- text: 'Diff',
- handler: addTab
- }),
- new Ext.Toolbar.Separator(),
- "Show Version: ",
- new Ext.form.ComboBox({
- }),
- new Ext.Button({
- text: 'Show',
- handler: addTab
- })
- ]
- });
-
-
- function addTab() {
- self.add({
- title: 'New Tab ',
- iconCls: 'tabs',
- html: 'diff_text',
- closable:true
- }).show();
- }
-
-}
-
-Ext.extend(diff_tab_panel, Ext.TabPanel);
-
-
-/*
- * END OF FILE - /bnc-3.0/testopia/js/diff-tabs.js
- */
-
-/*
- * START OF FILE - /bnc-3.0/testopia/js/environment.js
+ * START OF FILE - /bnc-branch/testopia/js/environment.js
*/
/*
* The contents of this file are subject to the Mozilla Public
@@ -8299,11 +8168,11 @@ Ext.extend(EnvironmentGrid, Ext.grid.EditorGridPanel, {
});
/*
- * END OF FILE - /bnc-3.0/testopia/js/environment.js
+ * END OF FILE - /bnc-branch/testopia/js/environment.js
*/
/*
- * START OF FILE - /bnc-3.0/testopia/js/search.js
+ * START OF FILE - /bnc-branch/testopia/js/search.js
*/
/*
* The contents of this file are subject to the Mozilla Public
@@ -8881,7 +8750,29 @@ Ext.extend(ReportGrid, Ext.grid.GridPanel, {
text: 'Delete',
icon: 'testopia/img/delete.png',
iconCls: 'img_button_16x',
- handler: this.deleteSearch.createDelegate(this)
+ handler: function (){
+ var form = new Ext.form.BasicForm('testopia_helper_frm',{});
+ Ext.Msg.show({
+ msg: 'Are you sure you want to delete this search?',
+ buttons: Ext.MessageBox.YESNO,
+ icon: Ext.MessageBox.QUESTION,
+ fn: function(btn, text){
+ if (btn == 'yes'){
+ var r = grid.store.getAt(index);
+ form.submit({
+ url: 'tr_query.cgi',
+ params: {action: 'delete_query', query_name: r.get('name')},
+ success: function(){
+ if (grid){
+ grid.store.load();
+ }
+ },
+ failure: testopiaError
+ });
+ }
+ }
+ });
+ }
},{
text: 'Refresh List',
icon: 'testopia/img/refresh.png',
@@ -8894,30 +8785,6 @@ Ext.extend(ReportGrid, Ext.grid.GridPanel, {
e.stopEvent();
this.menu.showAt(e.getXY());
},
- deleteSearch: function(){
- var grid = this;
- var form = new Ext.form.BasicForm('testopia_helper_frm',{});
- Ext.Msg.show({
- msg: 'Are you sure you want to delete this search?',
- buttons: Ext.MessageBox.YESNO,
- icon: Ext.MessageBox.QUESTION,
- fn: function(btn, text){
- if (btn == 'yes'){
- var r = grid.getSelectionModel().getSelected();
- form.submit({
- url: 'tr_query.cgi',
- params: {action: 'delete_query', query_name: r.get('name')},
- success: function(){
- if (grid){
- grid.store.load();
- }
- },
- failure: testopiaError
- });
- }
- }
- });
- },
onActivate: function(event){
if (!this.store.getCount()){
this.store.load();
@@ -9104,11 +8971,11 @@ PortalTools = [{
}];
/*
- * END OF FILE - /bnc-3.0/testopia/js/search.js
+ * END OF FILE - /bnc-branch/testopia/js/search.js
*/
/*
- * START OF FILE - /bnc-3.0/testopia/js/tags.js
+ * START OF FILE - /bnc-branch/testopia/js/tags.js
*/
/*
* The contents of this file are subject to the Mozilla Public
@@ -9420,7 +9287,7 @@ TagsUpdate = function(type, grid){
};
/*
- * END OF FILE - /bnc-3.0/testopia/js/tags.js
+ * END OF FILE - /bnc-branch/testopia/js/tags.js
*/
/*
diff --git a/mozilla/webtools/testopia/testopia/testopia.all.ycomp.js b/mozilla/webtools/testopia/testopia/testopia.all.ycomp.js
index 23d2eb9a6df..6bd88d56311 100644
--- a/mozilla/webtools/testopia/testopia/testopia.all.ycomp.js
+++ b/mozilla/webtools/testopia/testopia/testopia.all.ycomp.js
@@ -1 +1 @@
-ATTACHMENT_DELETE_WARNING="You are about to remove the selected attachments. This cannot be undone. Continue?";CASE_CATEGORY_DELETE_WARNING="You are about to delete the selected test case category. Are you sure you want to continue?";CASE_DELETE_WARNING="You are about to delete the selected test cases including all children and history. This action cannot be undone. Are you sure you want to continue?";PLAN_DELETE_WARNING="You are about to delete the selected test plans including all children and history. This action cannot be undone. Are you sure you want to continue?";RUN_DELETE_WARNING="You are about to delete the selected test runs including all children and history. This action cannot be undone. Are you sure you want to continue?";CASERUN_DELETE_WARNING="You are about to remove the selected test cases from this run including all history. This action cannot be undone. Are you sure you want to continue?";ENVIRONMENT_DELETE_WARNING="You are about to delete the selected test environment including associated test case data. This action cannot be undone. Are you sure you want to continue?";Ext.state.Manager.setProvider(new Ext.state.CookieProvider({expires:new Date(new Date().getTime()+(1000*60*60*24*30))}));Ext.data.Connection.timeout=120000;Ext.Updater.defaults.timeout=120000;Ext.Ajax.timeout=120000;var Testopia={};Testopia.Util={};Testopia.Environment={};Ext.grid.CheckColumn=function(A){Ext.apply(this,A);if(!this.id){this.id=Ext.id()}this.renderer=this.renderer.createDelegate(this)};Ext.grid.CheckColumn.prototype={init:function(A){this.grid=A;this.grid.on("render",function(){var B=this.grid.getView();B.mainBody.on("mousedown",this.onMouseDown,this)},this)},onMouseDown:function(D,C){if(C.className&&C.className.indexOf("x-grid3-cc-"+this.id)!=-1){D.stopEvent();var B=this.grid.getView().findRowIndex(C);var A=this.grid.store.getAt(B);A.set(this.dataIndex,!A.data[this.dataIndex])}},renderer:function(B,C,A){C.css+=" x-grid3-check-col-td";return'
'}};TestopiaUtil=function(){this.statusIcon=function(B){return''};this.caseLink=function(G,B,F,C,D,E){if(E.isTreport===true){return''+G+""}return''+G+""};this.runLink=function(G,B,F,C,D,E){if(E.isTreport===true){return''+G+""}return''+G+""};this.planLink=function(G,B,F,C,D,E){if(E.isTreport===true){return''+G+""}return''+G+""};this.bugLink=function(G,B,F,C,D,E){if(E.isTreport===true){return''+G+""}return''+G+""};this.newRunPopup=function(C){var B=new Ext.Window({id:"newRun-win",closable:true,width:Ext.getBody().getViewSize().width-150,height:Ext.getBody().getViewSize().height-150,plain:true,shadow:false,layout:"fit",items:[new NewRunForm(C)]});B.show(this)};this.newCaseForm=function(E,C,B){var D=new Ext.Window({id:"newcase-win",closable:true,width:Ext.getBody().getViewSize().width-150,height:Ext.getBody().getViewSize().height-150,plain:true,shadow:false,layout:"fit",items:[new NewCaseForm(E,C,B)]});D.show(this)};this.addCaseToRunPopup=function(C){var B=new Ext.Window({id:"add_case_to_run_win",closable:true,width:Ext.getBody().getViewSize().width-150,height:Ext.getBody().getViewSize().height-150,plain:true,shadow:false,layout:"fit",items:[new AddCaseToRunForm(C)]});B.show(this)};this.newPlanPopup=function(B){var C=new Ext.Window({id:"newplan-win",closable:true,width:800,height:550,plain:true,shadow:false,layout:"fit",items:[new NewPlanForm()]});C.show(this)};addOption=function(B,C){try{B.add(C,null)}catch(D){B.add(C,B.length)}};lsearch=function(D,B){if(typeof B!="object"){if(B==D){return true}return false}for(var C in B){if(B[C]==D){return true}}return false};this.addOption=addOption;var A=function(H,C){var E=searchToJson(window.location.search);if(C){E.product=C}for(var D in H.selectTypes){if(typeof H.selectTypes[D]!="function"){try{document.getElementById(H.selectTypes[D]).options.length=0;for(var B in H[H.selectTypes[D]]){if(typeof H[H.selectTypes[D]][B]!="function"){var G=new Option(H[H.selectTypes[D]][B],H[H.selectTypes[D]][B],false,lsearch(H[H.selectTypes[D]][B],E[H.selectTypes[D]]));addOption(document.getElementById(H.selectTypes[D]),G)}}document.getElementById(H.selectTypes[D]).disabled=false;document.getElementById(H.selectTypes[D])}catch(F){}}}};this.fillSelects=A;this.onProductSelection=function(B){var E=[];for(var C=0;C
','
',"
");UserLookup=function(A){UserLookup.superclass.constructor.call(this,{id:A.id||"user_lookup",store:new Ext.data.JsonStore({url:"tr_quicksearch.cgi",baseParams:{action:"getuser"},root:"users",totalProperty:"total",id:"login",fields:[{name:"login",mapping:"id"},{name:"name",mapping:"name"}]}),listeners:{valid:function(B){B.value=B.getRawValue()}},queryParam:"search",loadingText:"Looking up users...",displayField:"login",valueField:"login",typeAhead:true,hideTrigger:true,minListWidth:300,forceSelection:false,emptyText:"Type a username...",pageSize:20,tpl:'
{name}
{login}
'});Ext.apply(this,A)};Ext.extend(UserLookup,Ext.form.ComboBox);TagLookup=function(A){TagLookup.superclass.constructor.call(this,{id:A.id||"tag_lookup",store:new Ext.data.JsonStore({url:"tr_quicksearch.cgi",baseParams:{action:"gettag"},root:"tags",totalProperty:"total",fields:[{name:"id",mapping:"tag_id"},{name:"name",mapping:"tag_name"}]}),queryParam:"search",loadingText:"Looking up tags...",displayField:"name",valueField:"id",typeAhead:false,hiddenName:"tag",hideTrigger:true,minListWidth:300,minChars:2,width:150,editable:true,forceSelection:false,emptyText:"Type a tagname...",listeners:{specialkey:function(B,C){if(C.getKey()==C.ENTER){Ext.getCmp("tag_add_btn").fireEvent("click")}}}});Ext.apply(this,A)};Ext.extend(TagLookup,Ext.form.ComboBox);BuildCombo=function(A){BuildCombo.superclass.constructor.call(this,{id:A.id||"build_combo",store:A.transform?false:new BuildStore(A.params,A.mode=="local"?true:false),loadingText:"Looking up builds...",displayField:"name",valueField:"id",typeAhead:true,triggerAction:"all",minListWidth:300,forceSelection:true,transform:A.transform,emptyText:"Builds..."});Ext.apply(this,A);this.store.on("load",function(){if(A.value){this.setValue(A.value)}},this)};Ext.extend(BuildCombo,Ext.form.ComboBox);CaseCategoryCombo=function(A){CaseCategoryCombo.superclass.constructor.call(this,{id:A.id||"case_category_combo",store:A.transform?false:new CaseCategoryStore(A.params,A.mode=="local"?true:false),loadingText:"Looking up categories...",displayField:"name",valueField:"category_id",typeAhead:true,triggerAction:"all",minListWidth:300,forceSelection:true,transform:A.transform,emptyText:"Please select..."});Ext.apply(this,A);this.store.on("load",function(){if(A.value){this.setValue(A.value)}},this)};Ext.extend(CaseCategoryCombo,Ext.form.ComboBox);EnvironmentCombo=function(A){if(A.params){A.params.viewall=1}EnvironmentCombo.superclass.constructor.call(this,{id:A.id||"environment_combo",store:A.transform?false:new EnvironmentStore(A.params,A.mode=="local"?true:false),loadingText:"Looking up environments...",displayField:"name",valueField:"environment_id",typeAhead:true,triggerAction:"all",minListWidth:300,forceSelection:true,transform:A.transform,emptyText:"Environments..."});Ext.apply(this,A);this.store.on("load",function(){if(A.value){this.setValue(A.value)}},this)};Ext.extend(EnvironmentCombo,Ext.form.ComboBox);ProductCombo=function(A){ProductCombo.superclass.constructor.call(this,{id:A.id||"product_combo",store:A.transform?false:new ProductStore(A.params,A.mode=="local"?true:false),loadingText:"Looking up products...",displayField:"name",valueField:"id",typeAhead:true,triggerAction:"all",minListWidth:300,forceSelection:true,transform:A.transform,emptyText:"Please select..."});Ext.apply(this,A);this.store.on("load",function(){if(A.value){this.setValue(A.value)}},this)};Ext.extend(ProductCombo,Ext.form.ComboBox);ProductVersionCombo=function(A){ProductVersionCombo.superclass.constructor.call(this,{id:A.id||"product_version_combo",store:A.transform?false:new ProductVersionStore(A.params,A.mode=="local"?true:false),loadingText:"Looking up versions...",displayField:"name",valueField:"id",typeAhead:true,triggerAction:"all",minListWidth:300,forceSelection:true,transform:A.transform,emptyText:"Please select..."});Ext.apply(this,A);this.store.on("load",function(){if(A.value){this.setValue(A.value)}},this)};Ext.extend(ProductVersionCombo,Ext.form.ComboBox);CaseRunStatusCombo=function(A){CaseRunStatusCombo.superclass.constructor.call(this,{id:A.id||"case_run_status_combo",store:A.transform?false:new CaseRunStatusStore(A.mode=="local"?true:false),loadingText:"Looking up statuses...",displayField:"name",valueField:"id",typeAhead:true,triggerAction:"all",minListWidth:300,forceSelection:true,transform:A.transform,emptyText:"Please select..."});Ext.apply(this,A);this.store.on("load",function(){if(A.value){this.setValue(A.value)}},this)};Ext.extend(CaseRunStatusCombo,Ext.form.ComboBox);CaseStatusCombo=function(A){CaseStatusCombo.superclass.constructor.call(this,{id:A.id||"case_status_combo",store:A.transform?false:new CaseStatusStore(A.mode=="local"?true:false),loadingText:"Looking up statuses...",displayField:"name",valueField:"id",typeAhead:true,triggerAction:"all",minListWidth:100,forceSelection:true,transform:A.transform,emptyText:"Please select..."});Ext.apply(this,A);this.store.on("load",function(){if(A.value){this.setValue(A.value)}},this)};Ext.extend(CaseStatusCombo,Ext.form.ComboBox);ComponentCombo=function(A){ComponentCombo.superclass.constructor.call(this,{id:A.id||"component_combo",store:A.transform?false:new ComponentStore(A.params,A.mode=="local"?true:false),loadingText:"Looking up Components...",displayField:"name",valueField:"id",editable:false,triggerAction:"all",minListWidth:300,forceSelection:true,transform:A.transform,emptyText:"Please select..."});Ext.apply(this,A);this.store.on("load",function(){if(A.value){this.setValue(A.value)}},this)};Ext.extend(ComponentCombo,Ext.form.ComboBox);MilestoneCombo=function(A){MilestoneCombo.superclass.constructor.call(this,{id:A.id||"milestone_combo",store:A.transform?false:new MilestoneStore(A.params,A.mode=="local"?true:false),loadingText:"Looking up milestones...",displayField:"name",valueField:"id",typeAhead:true,triggerAction:"all",minListWidth:300,forceSelection:true,transform:A.transform,emptyText:"Please select..."});Ext.apply(this,A);this.store.on("load",function(){if(A.value){this.setValue(A.value)}},this)};Ext.extend(MilestoneCombo,Ext.form.ComboBox);PlanTypesCombo=function(A){PlanTypesCombo.superclass.constructor.call(this,{id:A.id||"plan_type_combo",store:A.transform?false:new PlanTypesStore(A.mode=="local"?true:false),loadingText:"Looking up types...",displayField:"name",valueField:"id",typeAhead:true,triggerAction:"all",minListWidth:300,forceSelection:true,transform:A.transform,emptyText:"Please select..."});Ext.apply(this,A);this.store.on("load",function(){if(A.value){this.setValue(A.value)}},this)};Ext.extend(PlanTypesCombo,Ext.form.ComboBox);PriorityCombo=function(A){PriorityCombo.superclass.constructor.call(this,{id:A.id||"priority_combo",store:A.transform?false:new PriorityStore(A.mode=="local"?true:false),loadingText:"Looking up priorities...",displayField:"name",valueField:"id",typeAhead:true,triggerAction:"all",minListWidth:100,forceSelection:true,transform:A.transform,emptyText:"Please select..."});Ext.apply(this,A);this.store.on("load",function(){if(A.value){this.setValue(A.value)}},this)};Ext.extend(PriorityCombo,Ext.form.ComboBox);RunProgress=function(A){RunProgress.superclass.constructor.call(this,A)};Ext.extend(RunProgress,Ext.ProgressBar,{onRender:function(C,A){Ext.ProgressBar.superclass.onRender.call(this,C,A);var B=new Ext.Template('
"}),new Ext.Toolbar.Spacer(),new Ext.Toolbar.Separator(),new Ext.Toolbar.Spacer(),C,new Ext.Toolbar.Spacer(),H,new Ext.Toolbar.Spacer(),new Ext.Toolbar.Separator(),new Ext.Toolbar.Spacer(),new Ext.Toolbar.Fill(),{xtype:"button",id:"add_case_to_run_btn",tooltip:"Add cases to this run",icon:"testopia/img/add.png",iconCls:"img_button_16x",handler:function(){I.addCaseToRunPopup(D)}},{xtype:"button",id:"new_case_to_run_btn",tooltip:"Create a new case and add it to this run",icon:"testopia/img/new.png",iconCls:"img_button_16x",handler:function(){I.newCaseForm(D.plan_id,D.product_id,D.run_id)}},{xtype:"button",template:button_16x_tmpl,id:"caserun_grid_edit_btn",icon:"testopia/img/edit.png",iconCls:"img_button_16x",tooltip:"Edit Selected Test Case",handler:function(){editFirstSelection(Ext.getCmp("caserun_grid"))}},{xtype:"button",template:button_16x_tmpl,id:"caserun_grid_delete_btn",icon:"testopia/img/delete.png",iconCls:"img_button_16x",tooltip:"Remove Selected Test Cases from This Run",handler:this.deleteList.createDelegate(this)},new RunProgress({id:"run_progress",text:"0%",width:100})]});CaseRunGrid.superclass.constructor.call(this,{region:"center",id:"caserun_grid",border:false,bodyBorder:false,height:"400",stripeRows:true,split:true,enableDragDrop:true,loadMask:{msg:"Loading Test Cases..."},autoExpandColumn:"case_summary",autoScroll:true,sm:new Ext.grid.RowSelectionModel({singleSelect:false,listeners:{rowdeselect:function(N,M,L){if(N.getCount()<1){Ext.getCmp("case_details_panel").disable();Ext.getCmp("tb_build").disable();Ext.getCmp("tb_environment").disable();Ext.getCmp("update_bugs").disable();var J=this.grid.getTopToolbar().items.items;for(var K=0;K1){return }Ext.getCmp("case_bugs_panel").tcid=M.get("case_id");Ext.getCmp("case_comps_panel").tcid=M.get("case_id");Ext.getCmp("attachments_panel").object=M.data;Ext.getCmp("case_details_panel").caserun_id=M.get("caserun_id");Ext.getCmp("casetagsgrid").obj_id=M.get("case_id");var L=Ext.getCmp("caserun_center_region").getActiveTab();Ext.getCmp(L.id).fireEvent("activate");if(Ext.getCmp("case_bugs_panel")){Ext.getCmp("case_bugs_panel").case_id=M.get("case_id")}if(Ext.getCmp("case_bugs_panel")){Ext.getCmp("case_bugs_panel").case_id=M.get("case_id")}Ext.getCmp("case_details_panel").store.load({params:{caserun_id:M.get("caserun_id"),action:"gettext"}});F=O}}}),viewConfig:{forceFit:true,enableRowBody:true,getRowClass:function(J,M,L,K){L.body="
";return"x-grid3-row-expanded"}}});this.on("rowcontextmenu",this.onContextClick,this);this.on("afteredit",this.onGridEdit,this);this.on("activate",this.onActivate,this)};Ext.extend(CaseRunGrid,Ext.grid.EditorGridPanel,{onContextClick:function(B,A,C){B.selindex=A;if(!this.menu){this.menu=new Ext.menu.Menu({id:"caserun-ctx-menu",items:[{text:"Change",icon:"testopia/img/edit.png",iconCls:"img_button_16x",menu:{items:[{text:"Build",handler:function(){var D=new Ext.Window({title:"Edit Build",id:"status-win",plain:true,shadow:false,width:320,height:150,layout:"form",bodyStyle:"padding: 5px",items:[new BuildCombo({params:{product_id:B.run.plan.product_id,activeonly:1},fieldLabel:"Build",id:"multi_build"}),new Ext.form.Checkbox({fieldLabel:"Apply to all cases in this run",id:"build_applyall"})],buttons:[{text:"Submit",handler:function(){params={run_id:B.run.run_id,applyall:Ext.getCmp("build_applyall").getValue(),build_id:Ext.getCmp("multi_build").getValue(),ids:getSelectedObjects(B,"caserun_id")};TestopiaUpdateMultiple("caserun",params,B);D.close()}},{text:"Close",handler:function(){D.close()}}]});D.show(this)}},{text:"Environment",handler:function(){var D=new Ext.Window({title:"Edit Environment",id:"status-win",plain:true,shadow:false,width:320,height:150,layout:"form",bodyStyle:"padding: 5px",items:[new EnvironmentCombo({params:{product_id:B.run.plan.product_id,isactive:1},fieldLabel:"Environment",id:"multi_env"}),new Ext.form.Checkbox({fieldLabel:"Apply to all cases in this run",id:"env_applyall"})],buttons:[{text:"Submit",handler:function(){params={run_id:B.run.run_id,applyall:Ext.getCmp("env_applyall").getValue(),env_id:Ext.getCmp("multi_env").getValue(),ids:getSelectedObjects(B,"caserun_id")};TestopiaUpdateMultiple("caserun",params,B);D.close()}},{text:"Close",handler:function(){D.close()}}]});D.show(this)}},{text:"Priority",handler:function(){var D=new Ext.Window({title:"Edit Priority",id:"priority-win",plain:true,shadow:false,width:320,height:150,layout:"form",bodyStyle:"padding: 5px",items:[new PriorityCombo({fieldLabel:"Priority",id:"multi_priority"})],buttons:[{text:"Submit",handler:function(){params={run_id:B.run.run_id,priority:Ext.getCmp("multi_priority").getValue(),ids:getSelectedObjects(B,"case_id")};TestopiaUpdateMultiple("case",params,B);D.close()}},{text:"Close",handler:function(){D.close()}}]});D.show(this)}},{text:"Category",handler:function(){var D=new Ext.Window({title:"Edit Category",id:"status-win",plain:true,shadow:false,width:300,height:150,items:[new CaseCategoryCombo({fieldLabel:"Category",params:{product_id:run.product_id}})],buttons:[{text:"Submit",handler:function(){TestopiaUpdateMultiple("case",{category:Ext.getCmp("case_category_combo").getValue(),ids:getSelectedObjects(B,"case_id")},B);D.close()}},{text:"Close",handler:function(){D.close()}}]});D.show(this)}},{text:"Assignee",handler:function(){var D=new Ext.Window({title:"Edit Assignee",id:"status-win",plain:true,shadow:false,width:320,height:150,layout:"form",bodyStyle:"padding: 5px",items:[new UserLookup({fieldLabel:"Assignee",id:"multi_assignee"}),new Ext.form.Checkbox({fieldLabel:"Apply to all cases in this run",id:"assignee_applyall"})],buttons:[{text:"Submit",handler:function(){params={run_id:B.run.run_id,applyall:Ext.getCmp("assignee_applyall").getValue(),assignee:Ext.getCmp("multi_assignee").getValue(),ids:getSelectedObjects(B,"caserun_id")};TestopiaUpdateMultiple("caserun",params,B);D.close()}},{text:"Close",handler:function(){D.close()}}]});D.show(this)}}]}},{text:"Remove Selected Cases",icon:"testopia/img/delete.png",iconCls:"img_button_16x",handler:this.deleteList.createDelegate(this)},{text:"Add or Remove Tags",handler:function(){TagsUpdate("case",B)}},{text:"New Test Run",id:"addRun",handler:function(){window.location="tr_new_run.cgi?plan_id="+run.plan_id}},{text:"Clone Run with Selected Cases",handler:function(){RunClonePopup(B.run.product_id,B.run.run_id,getSelectedObjects(B,"case_id"))}},{text:"Copy or Link Selected Test Cases to Plan(s)... ",handler:function(){var D=B.getSelectionModel().getSelected();caseClonePopup(B.run.product_id,getSelectedObjects(B,"case_id"))}},{text:"Add Selected Test Cases to Run... ",handler:function(){Ext.Msg.prompt("Add to runs","",function(D,E){if(D=="ok"){TestopiaUpdateMultiple("case",{addruns:E,ids:getSelectedObjects(B,"case_id")},B)}})}},{text:"Refresh List",icon:"testopia/img/refresh.png",iconCls:"img_button_16x",handler:function(){B.store.reload()}},{text:"View Test Case in a New Window",handler:function(){window.open("tr_show_case.cgi?case_id="+B.store.getAt(B.selindex).get("case_id"))}},{text:"List These Test Cases in a New Window",handler:function(){var D=Ext.getCmp("caserun_search").form.getValues();if(D){window.open("tr_list_cases.cgi?"+jsonToSearch(D,"",["current_tab"])+"&isactive=1")}else{window.open("tr_list_cases.cgi?run_id="+B.store.getAt(B.selindex).get("run_id"))}}}]})}C.stopEvent();if(B.getSelectionModel().getCount()<1){B.getSelectionModel().selectRow(A)}this.menu.showAt(C.getXY())},onGridEdit:function(B){var A={caserun_id:B.record.get("caserun_id")};var C=this.store;switch(B.field){case"sortkey":A.action="update_sortkey";A.sortkey=B.value;break;case"build":A.action="update_build";A.build_id=B.value;break;case"environment":A.action="update_environment";A.caserun_env=B.value;break;case"assignee":A.action="update_assignee";A.assignee=B.value;break;case"priority":A.action="update_priority";A.priority=B.value;break;case"category":A.action="update_scategory";A.category=B.value;break}this.form.submit({url:"tr_caserun.cgi",params:A,success:function(E,D){if(D.result.caserun){var F=B.grid.store.reader.readRecords({Result:[D.result.caserun]}).records[0];B.grid.store.insert(B.row,F);C.commitChanges();B.grid.store.remove(B.record);B.grid.getSelectionModel().selectRow(B.row)}else{C.commitChanges()}},failure:function(E,D){testopiaError(E,D);C.rejectChanges()}})},deleteList:function(){var A=this;if(A.getSelectionModel().getCount()<1){return }Ext.Msg.show({title:"Confirm Delete?",msg:CASERUN_DELETE_WARNING,buttons:Ext.Msg.YESNO,animEl:"caserun-delete-btn",icon:Ext.MessageBox.QUESTION,fn:function(C){if(C=="yes"){var B=new Ext.form.BasicForm("testopia_helper_frm");B.submit({url:"tr_list_caseruns.cgi",params:{caserun_ids:getSelectedObjects(A,"caserun_id"),action:"delete",ctype:"json"},success:function(D){Ext.Msg.show({msg:"Test cases removed",buttons:Ext.Msg.OK,icon:Ext.MessageBox.INFO});A.store.reload()},failure:function(E,D){testopiaError(E,D);A.store.reload()}})}}})},onActivate:function(A){if(!this.store.getCount()){this.store.load()}}});CaseRun=function(){var B=new TestopiaUtil();this.caserun_id;this.store=new Ext.data.Store({url:"tr_caserun.cgi",baseParams:{action:"gettext"},reader:new Ext.data.XmlReader({record:"casetext",id:"case_id"},[{name:"action",mapping:"action"},{name:"results",mapping:"effect"},{name:"setup",mapping:"setup"},{name:"breakdown",mapping:"breakdown"},{name:"case_id",mapping:"case_id"},{name:"summary",mapping:"summary"},{name:"notes",mapping:"notes"}])});var A=this.store;A.on("load",function(D,E){Ext.getCmp("action_editor").setValue(E[0].get("action"));Ext.getCmp("effect_editor").setValue(E[0].get("results"));Ext.getCmp("setup_editor").setValue(E[0].get("setup"));Ext.getCmp("breakdown_editor").setValue(E[0].get("breakdown"));Ext.getCmp("summary_tb").items.items[0].destroy();Ext.getCmp("summary_tb").add(new Ext.Toolbar.TextItem("Case "+E[0].get("case_id")+" - "+E[0].get("summary")))});appendNote=function(){var D=new Ext.form.BasicForm("testopia_helper_frm",{});D.submit({url:"tr_list_caseruns.cgi",params:{action:"update",note:Ext.getCmp("caserun_append_note_fld").getValue(),ids:getSelectedObjects(Ext.getCmp("caserun_grid"),"caserun_id")},success:function(){Ext.getCmp("caserun_append_note_fld").reset();A.reload()},failure:testopiaError})};processText=function(){var D=new Ext.form.BasicForm("testopia_helper_frm",{});var E={};E.tcsetup=Ext.getCmp("setup_editor").getValue();E.tcbreakdown=Ext.getCmp("breakdown_editor").getValue();E.tcaction=Ext.getCmp("action_editor").getValue();E.tceffect=Ext.getCmp("effect_editor").getValue();E.case_id=Ext.getCmp("caserun_grid").getSelectionModel().getSelected().get("case_id");E.action="update_doc";D.submit({url:"tr_process_case.cgi",params:E,success:function(){TestopiaUtil.notify.msg("Test case updated","Test Case {0} was updated successfully","Document")},failure:testopiaError})};var C=new Ext.Toolbar({id:"summary_tb",items:[new Ext.Toolbar.TextItem("")]});CaseRun.superclass.constructor.call(this,{id:"case_details_panel",layout:"fit",region:"south",split:true,border:false,style:"padding-bottom: 10px",bodyBorder:false,collapsible:true,height:330,items:[{xtype:"tabpanel",bodyBorder:false,activeTab:0,id:"caserun_center_region",title:"Details",tbar:C,items:[{layout:"column",title:"Action / Expected Results",id:"action_panel",items:[{columnWidth:0.5,layout:"fit",items:{title:"Action",height:Ext.state.Manager.get("bigtext_height",230),id:"cr_action_panel",bodyBorder:false,border:false,layout:"fit",autoScroll:true,items:[{id:"action_editor",xtype:"htmleditor"}]}},{columnWidth:0.5,layout:"fit",items:{title:"Expected Results",height:Ext.state.Manager.get("bigtext_height",230),id:"cr_results_panel",bodyBorder:false,border:false,autoScroll:true,layout:"fit",items:[{id:"effect_editor",xtype:"htmleditor"}]}}],buttons:[{text:"Update Action/Results",handler:processText.createDelegate(this)}]},{layout:"column",title:"Set Up / Break Down",items:[{columnWidth:0.5,layout:"fit",items:{title:"Setup",height:Ext.state.Manager.get("bigtext_height",230),id:"cr_setup_panel",bodyBorder:false,autoScroll:true,border:false,layout:"fit",items:[{id:"setup_editor",xtype:"htmleditor"}]}},{columnWidth:0.5,layout:"fit",items:{title:"Breakdown",height:Ext.state.Manager.get("bigtext_height",230),id:"cr_breakdown_panel",bodyBorder:false,autoScroll:true,border:false,layout:"fit",items:[{id:"breakdown_editor",xtype:"htmleditor"}]}}],buttons:[{text:"Update Setup/Breakdown",handler:processText.createDelegate(this)}]},{title:"Notes",id:"caserun_notes_panel",border:false,bodyBorder:false,autoScroll:true,layout:"fit",items:[{xtype:"dataview",bodyBorder:false,store:A,itemSelector:"div.breakdowndiv",loadingText:"Loading...",tpl:new Ext.XTemplate('','
";K=K+"";return K}}];this.form=new Ext.form.BasicForm("testopia_helper_frm",{});this.bbar=new TestopiaPager("run",this.store);RunGrid.superclass.constructor.call(this,{title:"Test Runs",id:B.id||"run_grid",loadMask:{msg:"Loading Test Runs..."},autoExpandColumn:"run_summary",autoScroll:true,sm:new Ext.grid.RowSelectionModel({singleSelect:false,listeners:{rowselect:function(J,H,I){Ext.getCmp("new_case_to_run_button").enable();Ext.getCmp("delete_run_list_btn").enable();Ext.getCmp("edit_run_list_btn").enable()},rowdeselect:function(J,H,I){if(J.getCount()<1){Ext.getCmp("new_case_to_run_button").disable();Ext.getCmp("delete_run_list_btn").disable();Ext.getCmp("edit_run_list_btn").disable()}}}}),viewConfig:{forceFit:true},tbar:[{xtype:"button",text:"Add Test Cases to Selected Runs",id:"new_case_to_run_button",disabled:true,handler:function(){var H=Ext.getCmp(B.id||"run_grid").getSelectionModel().getSelected();D.addCaseToRunPopup(H)}},new Ext.Toolbar.Fill(),{xtype:"button",id:"save_run_list_btn",icon:"testopia/img/save.png",iconCls:"img_button_16x",tooltip:"Save this search",handler:function(H,I){saveSearch("run",Ext.getCmp(B.id||"run_grid").store.baseParams)}},{xtype:"button",id:"link_run_list_btn",icon:"testopia/img/link.png",iconCls:"img_button_16x",tooltip:"Create a link to this list",handler:function(H,I){linkPopup(Ext.getCmp(B.id||"run_grid").store.baseParams)}},{xtype:"button",id:"edit_run_list_btn",icon:"testopia/img/edit.png",iconCls:"img_button_16x",disabled:true,tooltip:"Edit Selected Test Run",handler:function(){editFirstSelection(Ext.getCmp(B.id||"run_grid"))}},{xtype:"button",id:"add_run_list_btn",icon:"testopia/img/new.png",iconCls:"img_button_16x",tooltip:"Create a New Test Run",handler:function(){try{if(plan){D.newRunPopup(plan)}}catch(H){window.location="tr_new_run.cgi"}}},{xtype:"button",id:"delete_run_list_btn",icon:"testopia/img/delete.png",iconCls:"img_button_16x",disabled:true,tooltip:"Delete Selected Test Runs",handler:this.deleteList.createDelegate(this)}]});Ext.apply(this,B);this.on("rowcontextmenu",this.onContextClick,this);this.on("afteredit",this.onGridEdit,this);this.on("activate",this.onActivate,this)};Ext.extend(RunGrid,Ext.grid.EditorGridPanel,{onContextClick:function(B,A,C){B.selindex=A;if(!this.menu){this.menu=new Ext.menu.Menu({id:"run-ctx-menu",items:[{text:"Reports",menu:{items:[{text:"New Run Status Report",handler:function(){Ext.getCmp("object_panel").setActiveTab("dashboardpanel");var D=new Ext.ux.Portlet({title:"Status Report",closable:true,autoScroll:true,tools:PortalTools});D.url="tr_run_reports.cgi?type=status&run_ids="+getSelectedObjects(B,"run_id");Testopia.Search.dashboard_urls.push(D.url);Ext.getCmp("dashboard_leftcol").add(D);Ext.getCmp("dashboard_leftcol").doLayout();D.load({url:D.url})}},{text:"New Run Completion Report",handler:function(){Ext.getCmp("object_panel").setActiveTab("dashboardpanel");var D=new Ext.ux.Portlet({title:"Completion Report",closable:true,autoScroll:true,tools:PortalTools});D.url="tr_run_reports.cgi?type=completion&run_ids="+getSelectedObjects(B,"run_id");Testopia.Search.dashboard_urls.push(D.url);Ext.getCmp("dashboard_leftcol").add(D);Ext.getCmp("dashboard_leftcol").doLayout();D.load({url:D.url})}},{text:"New Run Execution Report",handler:function(){var D=new Ext.Window({title:"Select a date range",id:"run_execution_win",layout:"fit",split:true,plain:true,shadow:false,width:350,height:150,items:[new Ext.FormPanel({labelWidth:"40",bodyStyle:"padding: 5px",items:[{xtype:"datefield",id:"execution_start_date",fieldLabel:"Start Date",name:"chfieldfrom"},{xtype:"datefield",fieldLabel:"Stop Date",id:"execution_stop_date",emptyText:"Now",name:"chfieldto"},new UserLookup({id:"exec_tester",fieldLabel:"Tester (optional)"})]})],buttons:[{text:"Submit",handler:function(){Ext.getCmp("object_panel").setActiveTab("dashboardpanel");var E=new Ext.ux.Portlet({title:"Execution Report",closable:true,autoScroll:true,tools:PortalTools});E.url="tr_run_reports.cgi?type=execution&run_ids="+getSelectedObjects(B,"run_id")+"&chfieldfrom="+Ext.getCmp("execution_start_date").getValue()+"&chfieldto="+Ext.getCmp("execution_stop_date").getValue()+"&tester="+Ext.getCmp("exec_tester").getValue();Testopia.Search.dashboard_urls.push(E.url);Ext.getCmp("dashboard_leftcol").add(E);Ext.getCmp("dashboard_leftcol").doLayout();E.load({url:E.url});D.close()}},{text:"Cancel",handler:function(){D.close()}}]});D.show()}},{text:"New Priority Breakdown Report",handler:function(){Ext.getCmp("object_panel").setActiveTab("dashboardpanel");var D=new Ext.ux.Portlet({title:"Status Report",closable:true,autoScroll:true,tools:PortalTools});D.url="tr_run_reports.cgi?type=priority&run_ids="+getSelectedObjects(B,"run_id");Testopia.Search.dashboard_urls.push(D.url);Ext.getCmp("dashboard_leftcol").add(D);Ext.getCmp("dashboard_leftcol").doLayout();D.load({url:D.url})}},{text:"New Run Bug Report",handler:function(){Ext.getCmp("object_panel").setActiveTab("dashboardpanel");var D=new Ext.ux.Portlet({title:"Bug Report",closable:true,autoScroll:true,tools:PortalTools});D.url="tr_run_reports.cgi?type=bug_grid&run_ids="+getSelectedObjects(B,"run_id")+"&noheader=1";Testopia.Search.dashboard_urls.push(D.url);Ext.getCmp("dashboard_leftcol").add(D);Ext.getCmp("dashboard_leftcol").doLayout();D.load({scripts:true,url:D.url})}}]}},{text:"Edit",menu:{items:[{text:"Manager",handler:function(){var D=new Ext.Window({title:"Change Run Manager",id:"run_manager_win",layout:"fit",split:true,plain:true,shadow:false,width:350,height:150,items:[new Ext.FormPanel({labelWidth:"40",bodyStyle:"padding: 5px",items:[new UserLookup({id:"manager_update",fieldLabel:"Run Manager"})]})],buttons:[{text:"Update Manager",handler:function(){TestopiaUpdateMultiple("run",{manager:Ext.getCmp("manager_update").getValue(),ids:getSelectedObjects(B,"run_id")},B);D.close()}},{text:"Cancel",handler:function(){D.close()}}]});D.show()}},{text:"Tags",handler:function(){TagsUpdate("run",B)}},{text:"Targets",handler:function(){var D=new Ext.Window({title:"Change Run Targets",id:"run_target_win",layout:"fit",split:true,plain:true,shadow:false,width:350,height:150,items:[new Ext.FormPanel({bodyStyle:"padding: 5px",items:[new Ext.form.NumberField({maxValue:100,minValue:0,id:"target_completion",allowBlank:true,fieldLabel:"Target Completion Rate",hiddenName:"target_completion",listeners:{valid:function(E){Ext.getCmp("target_pass").maxValue=E.getValue()}}}),new Ext.form.NumberField({maxValue:100,minValue:0,allowBlank:true,id:"target_pass",fieldLabel:"Target Pass Rate",hiddenName:"target_pass"})]})],buttons:[{text:"Update Targets",handler:function(){TestopiaUpdateMultiple("run",{target_pass:Ext.getCmp("target_pass").getValue(),target_completion:Ext.getCmp("target_completion").getValue(),ids:getSelectedObjects(B,"run_id")},B);D.close()}},{text:"Cancel",handler:function(){D.close()}}]});D.show()}}]}},{text:"Clone Selected Test Runs",icon:"testopia/img/copy.png",iconCls:"img_button_16x",handler:function(){RunClonePopup(B.getSelectionModel().getSelected().get("product_id"),getSelectedObjects(B,"run_id"))}},{text:"Delete Selected Test Runs",icon:"testopia/img/delete.png",iconCls:"img_button_16x",handler:this.deleteList.createDelegate(this)},{text:"Refresh List",icon:"testopia/img/refresh.png",iconCls:"img_button_16x",handler:function(){B.store.reload()}},{text:"View Test Run in a New Window",handler:function(){window.open("tr_show_run.cgi?run_id="+B.store.getAt(B.selindex).get("run_id"))}},{text:"View Run's Test Cases in a New Window",handler:function(){window.open("tr_list_cases.cgi?run_id="+B.store.getAt(B.selindex).get("run_id"))}}]})}C.stopEvent();if(B.getSelectionModel().getCount()<1){B.getSelectionModel().selectRow(A)}this.menu.showAt(C.getXY())},onGridEdit:function(B){var A={action:"edit",run_id:B.record.get("run_id")};var C=this.store;switch(B.field){case"product_version":A.run_product_version=B.value;break;case"manager":A.manager=B.value;break;case"build":A.build=B.value;break;case"environment":A.environment=B.value;break;case"summary":A.summary=B.value;break}this.form.submit({url:"tr_process_run.cgi",params:A,success:function(E,D){C.commitChanges()},failure:function(E,D){testopiaError(E,D);C.rejectChanges()}})},deleteList:function(){var A=this;Ext.Msg.show({title:"Confirm Delete?",msg:RUN_DELETE_WARNING,buttons:Ext.Msg.YESNO,animEl:"run-delete-btn",icon:Ext.MessageBox.QUESTION,fn:function(C){if(C=="yes"){var B=new Ext.form.BasicForm("testopia_helper_frm");B.submit({url:"tr_list_runs.cgi",params:{run_ids:getSelectedObjects(A,"run_id"),action:"delete"},success:function(D){Ext.Msg.show({msg:"Test runs deleted",buttons:Ext.Msg.OK,icon:Ext.MessageBox.INFO});A.store.reload()},failure:function(E,D){testopiaError(E,D);A.store.reload()}})}}})},onActivate:function(A){if(!this.store.getCount()){this.store.load()}}});var NewRunForm=function(A){if(A.data){A=A.data}var B=new CaseGrid({plan_id:A.plan_id,case_status:"CONFIRMED"},{title:"Select From Existing Cases",region:"center",id:"newrun_casegrid",height:500});this.casegrid=B;B.on("render",function(D){for(var C=0;CProduct Version",hiddenName:"prod_version",mode:"local",forceSelection:true,allowBlank:false,typeAhead:true,params:{product_id:A.product_id}}),new UserLookup({id:"new_run_manager",hiddenName:"manager",fieldLabel:"Run Manager",allowBlank:false}),new Ext.form.NumberField({maxValue:100,minValue:0,allowBlank:true,id:"target_completion",fieldLabel:"Target Completion Rate",hiddenName:"target_completion",listeners:{valid:function(C){Ext.getCmp("target_pass").maxValue=C.getValue()}}})]},{columnWidth:0.5,layout:"form",items:[new BuildCombo({fieldLabel:"Build",hiddenName:"build",mode:"local",forceSelection:false,allowBlank:false,typeAhead:true,params:{product_id:A.product_id},emptyText:"Select or type a new name"}),new EnvironmentCombo({fieldLabel:"Environment",hiddenName:"environment",mode:"local",forceSelection:false,allowBlank:false,typeAhead:true,params:{product_id:A.product_id},emptyText:"Select or type a new name"}),new Ext.form.NumberField({maxValue:100,minValue:0,allowBlank:true,id:"target_pass",fieldLabel:"Target Pass Rate",hiddenName:"target_pass"})]}]},{xtype:"textfield",fieldLabel:"Summary",layout:"fit",id:"run_summary",name:"summary",anchor:"100%",width:600,allowBlank:false},{xtype:"hidden",name:"plan_id",value:A.plan_id},{layout:"fit",fieldLabel:"Notes",id:"notes",xtype:"textarea",width:600,height:80}]}],buttons:[{text:"Create New Case",handler:function(){var C=new TestopiaUtil();C.newCaseForm(A.plan_id,A.product_id)}},{text:"Submit",handler:function(){if(!Ext.getCmp("newrunsouth").getForm().isValid()){return }var C={action:"add"};if(Ext.getCmp("selectall").getValue()){C.getall=Ext.getCmp("selectall").getValue()?1:0}else{C.case_ids=getSelectedObjects(B,"case_id")}if(!Ext.getCmp("build_combo").getValue()){C.new_build=Ext.getCmp("build_combo").getRawValue()}if(!Ext.getCmp("environment_combo").getValue()){C.new_env=Ext.getCmp("environment_combo").getRawValue()}Ext.getCmp("newrunsouth").getForm().submit({params:C,success:function(D,E){Ext.Msg.show({title:"Test Run Created",msg:"Test run "+E.result.run_id+" Created. Would you like to go there now?",buttons:Ext.Msg.YESNO,icon:Ext.MessageBox.QUESTION,fn:function(F){if(F=="yes"){window.location="tr_show_run.cgi?run_id="+E.result.run_id}}});if(Ext.getCmp("plan_run_grid")){Ext.getCmp("plan_run_grid").store.reload()}},failure:testopiaError})}},{text:"Cancel",type:"reset",id:"nrf_cancel_btn",handler:function(){Ext.getCmp("newrunsouth").getForm().reset();try{Ext.getCmp("newRun-win").close()}catch(C){window.location="tr_show_product.cgi"}}}]});this.on("render",function(){B.store.load()})};Ext.extend(NewRunForm,Ext.Panel);RunClonePanel=function(D,H,B){var E=new PlanGrid({product_id:D},{id:"run_clone_plan_grid"});var C=new ProductVersionCombo({id:"run_clone_version_chooser",mode:"local",hiddenName:"new_run_prod_version",fieldLabel:"Product Version",params:{product_id:D},allowBlank:false});var G=new BuildCombo({fieldLabel:"Select a Build",id:"run_clone_build_chooser",mode:"local",hiddenName:"new_run_build",params:{product_id:D},allowBlank:false});var A=new EnvironmentCombo({fieldLabel:"Select an Environment",id:"run_clone_environment_chooser",mode:"local",hiddenName:"new_run_env",params:{product_id:D},allowBlank:false});function F(){var I=Ext.getCmp("run_clone_frm").getForm();I.baseParams={};if(Ext.getCmp("copy_cases_radio_group").getGroupValue()=="copy_filtered_cases"){I.baseParams=Ext.getCmp("caserun_search").form.getValues()}else{if(Ext.getCmp("copy_cases_radio_group").getGroupValue()=="copy_selected_cases"){I.baseParams.case_list=getSelectedObjects(Ext.getCmp("caserun_grid"),"caserun_id")}}I.baseParams.action="clone";I.baseParams.ids=H;I.baseParams.new_run_build=G.getValue();I.baseParams.new_run_environment=A.getValue();I.baseParams.plan_ids=getSelectedObjects(E,"plan_id");var J=I.getValues();if(I.isValid()){I.submit({success:function(L,K){var M;if(K.result.runlist.length==1){M=K.result.failures.length>0?"Test cases "+K.result.failures.join(",")+" were not included. They are either DISABLED or PROPOSED. ":"";Ext.Msg.show({title:"Run Copied",msg:M+"Run "+K.result.runlist[0]+" Created. Would you like to go there now?",buttons:Ext.Msg.YESNO,icon:Ext.MessageBox.QUESTION,fn:function(N){if(N=="yes"){window.location="tr_show_run.cgi?run_id="+K.result.runlist[0]}}})}else{M=K.result.failures.length>0?"Test cases "+K.result.failures.join(",")+" were not included. They are either DISABLED or PROPOSED. ":"";Ext.Msg.show({title:"Test Run Copied",msg:M+"Test runs "+K.result.runlist.join(",")+' Copied successfully. View as List',buttons:Ext.Msg.OK,icon:Ext.MessageBox.INFO})}},failure:testopiaError})}}RunClonePanel.superclass.constructor.call(this,{id:"run_clone_form",border:false,width:600,layout:"border",items:[{region:"north",layout:"fit",border:false,height:300,items:[E]},{region:"center",xtype:"form",url:"tr_list_runs.cgi",title:"Clone Options",autoScroll:true,id:"run_clone_frm",border:false,frame:true,bodyStyle:"padding: 10px",labelWidth:160,height:350,items:[{layout:"table",border:false,autoScroll:true,layoutConfig:{columns:2,width:"100%"},items:[{colspan:2,layout:"form",border:false,items:[{id:"run_clone_name",xtype:"textfield",fieldLabel:"New Run Summary",name:"new_run_summary",allowBlank:false,width:500}]},{layout:"form",border:false,items:[C,G,A]},{layout:"form",border:false,items:[{xtype:"checkbox",name:"copy_tags",checked:true,boxLabel:"Copy Run Tags",hideLabel:true},{xtype:"hidden",id:"run_clone_product_id",name:"product_id",value:D}]},{colspan:2,layout:"form",border:false,items:[{xtype:"checkbox",name:"keep_run_manager",checked:false,boxLabel:"Maintain original manager (unchecking will make me the manager of the new run)",hideLabel:true},{xtype:"fieldset",autoHeight:true,checkboxToggle:true,checkboxName:"copy_cases",id:"run_copy_cases",title:"Copy Test Cases",collapsed:B?false:true,items:[{xtype:"radio",name:"copy_cases_options",id:"copy_cases_radio_group",inputValue:"copy_all_cases",checked:true,boxLabel:"Include all CONFIRMED cases in selected run(s)",hideLabel:true},{xtype:"radio",name:"copy_cases_options",inputValue:"copy_filtered_cases",boxLabel:"Only include cases that match the selected filter",hideLabel:true},{xtype:"radio",name:"copy_cases_options",inputValue:"copy_selected_cases",boxLabel:"Only include cases that are currently selected",checked:B?true:false,hideLabel:true},{xtype:"checkbox",name:"keep_indexes",checked:true,boxLabel:"Copy Case Indexes",hideLabel:true},{xtype:"checkbox",name:"keep_statuses",boxLabel:"Maintain status of copied cases (unchecking will set case copies to IDLE (Not Run))",hideLabel:true}]}]}]}]}],buttons:[{text:"Submit",handler:F.createDelegate(this)},{text:"Cancel",handler:function(){Ext.getCmp("run-clone-win").close()}}]})};Ext.extend(RunClonePanel,Ext.Panel);RunClonePopup=function(D,G,A){var F=new Ext.Window({id:"run-clone-win",closable:true,width:800,height:600,plain:true,shadow:false,layout:"fit",items:[new RunClonePanel(D,G,A)]});var H=Ext.getCmp("run_clone_plan_grid");Ext.apply(H,{title:"Select plans to clone runs to"});F.show(this);var B=H.getTopToolbar().items.items;for(var C=0;C 1 ? "Items" : "Item"]})'});this.columns=[{header:"Run",dataIndex:"run_id",sortable:true,hideable:true,groupRenderer:function(C){return C},renderer:A.runLink},{header:"Case",dataIndex:"case_id",sortable:true,hideable:true,groupRenderer:function(C){return C},renderer:A.caseLink},{header:"Bug",dataIndex:"bug_id",sortable:true,hideable:true,groupRenderer:function(C){return C},renderer:A.bugLink},{header:"Bug Status",dataIndex:"bug_status",sortable:true,hideable:true},{header:"Case Status",dataIndex:"case_status",sortable:true,hideable:true},{header:"Severity",dataIndex:"severity",sortable:true,hideable:true}];Testopia.BugReport.superclass.constructor.call(this,{sm:new Ext.grid.RowSelectionModel(),layout:"fit",height:250,autoScroll:true})};Ext.extend(Testopia.BugReport,Ext.grid.GridPanel);BuildGrid=function(A){this.product_id=A;this.store=new BuildStore({},false);var B=new MilestoneCombo({hiddenField:"milestone",mode:"remote",params:{product_id:A}});this.columns=[{header:"Name",width:80,sortable:true,dataIndex:"name",editor:new Ext.grid.GridEditor(new Ext.form.TextField({value:"name",allowBlank:false}),{completeOnEnter:true,listeners:{beforecomplete:function(D,C){if(!D.getValue()){return false}}}})},{header:"Milestone",width:120,sortable:true,dataIndex:"milestone",editor:new Ext.grid.GridEditor(B,{listeners:{startedit:function(){var C=Ext.getCmp("products_pane").getSelectionModel().getSelectedNode().id;if(B.store.baseParams.product_id!=C){B.store.baseParams.product_id=C;B.store.load()}}}})},{header:"Description",width:120,editor:new Ext.grid.GridEditor(new Ext.form.TextField()),sortable:true,dataIndex:"description"},new Ext.grid.CheckColumn({header:"Active",dataIndex:"isactive",editor:new Ext.grid.GridEditor(new Ext.form.Checkbox({value:"isactive"})),width:25})];this.form=new Ext.form.BasicForm("testopia_helper_frm");BuildGrid.superclass.constructor.call(this,{title:"Builds",id:"build_grid",loadMask:{msg:"Loading Builds..."},autoExpandColumn:"build_name",autoScroll:true,sm:new Ext.grid.RowSelectionModel({singleSelect:true}),viewConfig:{forceFit:true},tbar:[new Ext.Toolbar.Fill(),{xtype:"button",id:"edit_build_btn",icon:"testopia/img/edit.png",iconCls:"img_button_16x",tooltip:"Edit Selected Build",handler:function(){editFirstSelection(Ext.getCmp("build_grid"))}},{xtype:"button",template:button_16x_tmpl,id:"add_build_btn",icon:"testopia/img/add.png",iconCls:"img_button_16x",tooltip:"Add a new Build",handler:this.newRecord}]});this.on("rowcontextmenu",this.onContextClick,this);this.on("activate",this.onActivate,this);this.on("afteredit",this.onGridEdit,this)};Ext.extend(BuildGrid,Ext.grid.EditorGridPanel,{newRecord:function(){NewBuild=Ext.data.Record.create([{name:"name",type:"string"},{name:"milestone"},{name:"description",type:"string"},{name:"isactive",type:"bool"}]);var A=new NewBuild({name:"",milestone:Ext.getCmp("products_pane").getSelectionModel().getSelectedNode().attributes.attributes.defaultmilestone,description:"",isactive:true});var B=Ext.getCmp("build_grid");B.store.insert(0,A);B.startEditing(0,0)},onContextClick:function(B,A,C){B.getSelectionModel().selectRow(A);if(!this.menu){this.menu=new Ext.menu.Menu({id:"build-ctx-menu",items:[{text:"Reports",menu:{items:[{text:"New Completion Report",handler:function(){Ext.getCmp("object_panel").setActiveTab("dashboardpanel");var D=new Ext.ux.Portlet({title:"Build Completion Report",closable:true,autoScroll:true,tools:PortalTools});D.url="tr_builds.cgi?action=report&product_id="+B.product_id+"&build_ids="+getSelectedObjects(B,"id");Testopia.Search.dashboard_urls.push(D.url);Ext.getCmp("dashboard_leftcol").add(D);Ext.getCmp("dashboard_leftcol").doLayout();D.load({url:D.url})}}]}},{text:"Add a Build",icon:"testopia/img/add.png",iconCls:"img_button_16x",handler:this.newRecord},{text:"Edit This Build",icon:"testopia/img/edit.png",iconCls:"img_button_16x",handler:function(){editFirstSelection(B)}},{text:"Refresh",icon:"testopia/img/refresh.png",iconCls:"img_button_16x",handler:function(){B.store.reload()}}]})}C.stopEvent();this.menu.showAt(C.getXY())},onGridEdit:function(D){var B=D.record.get("id");var A={product_id:this.product_id,build_id:B};var C=this.store;if(B){A.action="edit";switch(D.field){case"name":A.name=D.value;break;case"description":A.description=D.value;break;case"isactive":A.isactive=D.value;break;case"milestone":A.milestone=D.value;break}}else{A.action="add";A.name=D.value;A.milestone=Ext.getCmp("products_pane").getSelectionModel().getSelectedNode().attributes.attributes.defaultmilestone;A.isactive=1}this.form.submit({url:"tr_builds.cgi",params:A,success:function(F,E){if(E.result.build_id){D.record.set("build_id",E.result.build_id)}C.commitChanges()},failure:function(F,E){testopiaError(F,E);C.rejectChanges()}})},onActivate:function(A){if(!this.product_id){Ext.Msg.alert("Error","Please select a product.");Ext.getCmp("edit_build_btn").disable();Ext.getCmp("add_build_btn").disable();return }else{if(!this.store.getCount()){this.store.load({params:{product_id:this.product_id}})}}}});CaseCategoryGrid=function(A){this.product_id=A;this.store=new CaseCategoryStore({},false);var B=this.store;this.columns=[{header:"Name",width:120,sortable:true,dataIndex:"name",editor:new Ext.grid.GridEditor(new Ext.form.TextField({value:"name",allowBlank:false}),{completeOnEnter:true,listeners:{beforecomplete:function(D,C){if(!D.getValue()){return false}}}})},{header:"Description",width:120,id:"category_desc_column",editor:new Ext.grid.GridEditor(new Ext.form.TextField({value:"description"})),sortable:true,dataIndex:"description"}];this.form=new Ext.form.BasicForm("testopia_helper_frm",{});CaseCategoryGrid.superclass.constructor.call(this,{title:"Categories",id:"category_grid",loadMask:{msg:"Loading Categories..."},autoExpandColumn:"category_desc_column",autoScroll:true,enableColumnHide:true,sm:new Ext.grid.RowSelectionModel({singleSelect:true}),viewConfig:{forceFit:true},tbar:[new Ext.Toolbar.Fill(),{xtype:"button",id:"edit_category_btn",icon:"testopia/img/edit.png",iconCls:"img_button_16x",tooltip:"Edit Selected Category",handler:function(){editFirstSelection(Ext.getCmp("category_grid"))}},{xtype:"button",template:button_16x_tmpl,id:"add_category_btn",icon:"testopia/img/add.png",iconCls:"img_button_16x",tooltip:"Add a new Category",handler:this.newRecord},{xtype:"button",template:button_16x_tmpl,icon:"testopia/img/delete.png",iconCls:"img_button_16x",tooltip:"Delete this Category",handler:function(){var C=Ext.getCmp("category_grid").getSelectionModel().getSelected();if(!C){Ext.MessageBox.alert("Message","Please select at least one Category to delete")}else{confirmCaseCategoryDelete(A)}}}]});this.on("rowcontextmenu",this.onContextClick,this);this.on("activate",this.onActivate,this);this.on("afteredit",this.onGridEdit,this)};Ext.extend(CaseCategoryGrid,Ext.grid.EditorGridPanel,{newRecord:function(){NewCategory=Ext.data.Record.create([{name:"name",type:"string"},{name:"description",type:"string"}]);var A=new NewCategory({name:"",description:""});var B=Ext.getCmp("category_grid");B.store.insert(0,A);B.startEditing(0,0)},onContextClick:function(B,A,C){B.getSelectionModel().selectRow(A);if(!this.menu){this.menu=new Ext.menu.Menu({id:"category-ctx-menu",items:[{text:"Add a Category",icon:"testopia/img/add.png",iconCls:"img_button_16x",handler:this.newRecord},{text:"Edit This Category",icon:"testopia/img/edit.png",iconCls:"img_button_16x",handler:function(){editFirstSelection(B)}},{text:"Refresh",icon:"testopia/img/refresh.png",iconCls:"img_button_16x",handler:function(){B.store.reload()}}]})}C.stopEvent();this.menu.showAt(C.getXY())},onGridEdit:function(D){var B=D.record.get("category_id");var A={product_id:this.product_id,category_id:B};var C=this.store;if(B){A.action="edit";switch(D.field){case"name":A.name=D.value;break;case"description":A.description=D.value;break}}else{A.action="add";A.name=D.value}this.form.submit({url:"tr_categories.cgi",params:A,success:function(F,E){if(E.result.category_id){D.record.set("category_id",E.result.category_id)}C.commitChanges()},failure:function(F,E){testopiaError(F,E);C.rejectChanges()}})},onActivate:function(A){if(!this.product_id){Ext.Msg.alert("Error","Please select a product.");Ext.getCmp("edit_category_btn").disable();Ext.getCmp("add_category_btn").disable();return }else{if(!this.store.getCount()){this.store.load({params:{product_id:this.product_id}})}}}});confirmCaseCategoryDelete=function(){if(!Ext.getCmp("category_grid").getSelectionModel().getSelected().get("category_id")){Ext.getCmp("category_grid").store.reload();return }Ext.Msg.show({title:"Confirm Delete?",msg:CASE_CATEGORY_DELETE_WARNING,buttons:Ext.Msg.YESNO,animEl:"casecategory-delete-btn",icon:Ext.MessageBox.QUESTION,fn:function(B){if(B=="yes"){var A=new Ext.form.BasicForm("testopia_helper_frm");A.submit({url:"tr_categories.cgi",params:{category_id:Ext.getCmp("category_grid").getSelectionModel().getSelected().get("category_id"),action:"delete",product_id:Ext.getCmp("category_grid").product_id},success:function(C){Ext.Msg.show({msg:"Test case category deleted",buttons:Ext.Msg.OK,icon:Ext.MessageBox.INFO});Ext.getCmp("category_grid").store.reload()},failure:testopiaError})}}})};Ext.ux.TabCloseMenu=function(){var A,C,B;this.init=function(E){A=E;A.on("contextmenu",D)};function D(G,F,H){if(!C){C=new Ext.menu.Menu([{id:A.id+"-close",text:"Close Tab",handler:function(){A.remove(B)}},{id:A.id+"-close-others",text:"Close Other Tabs",handler:function(){A.items.each(function(J){if(J.closable&&J!=B){A.remove(J)}})}}])}B=F;var E=C.items;E.get(A.id+"-close").setDisabled(!F.closable);var I=true;A.items.each(function(){if(this!=F&&this.closable){I=false;return false}});E.get(A.id+"-close-others").setDisabled(I);C.showAt(H.getPoint())}};diff_tab_panel=function(D,F,C){var B=this;var A=new Ext.data.JsonStore({url:"tr_history.cgi",baseParams:{action:"getversions",type:D,id:F},root:"versions",fields:[{name:"name",mapping:"name",name:"id",mapping:"id"}]});diff_tab_panel.superclass.constructor.call(this,{title:"Test Panel",height:500,resizeTabs:true,minTabWidth:115,tabWidth:135,enableTabScroll:true,defaults:{autoScroll:true},plugins:new Ext.ux.TabCloseMenu(),activeTab:0,tbar:[new Ext.form.ComboBox({displayField:"name",valueField:"id",name:"product",id:"product_combo",fieldLabel:"Product",store:A,emptyText:"Select a version...",width:200})," Right: ",new Ext.Toolbar.Spacer(),new Ext.form.ComboBox({})," HTML: ",new Ext.form.Radio({id:"format",value:"html",checked:true})," Raw: ",new Ext.form.Radio({id:"format",value:"raw"}),new Ext.Button({text:"Diff",handler:E}),new Ext.Toolbar.Separator(),"Show Version: ",new Ext.form.ComboBox({}),new Ext.Button({text:"Show",handler:E})]});function E(){B.add({title:"New Tab ",iconCls:"tabs",html:"diff_text",closable:true}).show()}};Ext.extend(diff_tab_panel,Ext.TabPanel);EnvironmentGrid=function(E,A){this.params=E;this.product_id=E.product_id;function B(F){return''+F+""}function D(F){return''+F+""}this.store=new EnvironmentStore(E,false);var C=this.store;this.columns=[{header:"ID",width:30,dataIndex:"environment_id",sortable:true,renderer:B,hideable:false},{header:"Environment Name",width:110,dataIndex:"name",id:"env_name_col",sortable:true,editor:new Ext.grid.GridEditor(new Ext.form.TextField({allowBlank:false}),{id:"env_name_edt"})},{header:"Product Name",width:150,dataIndex:"product",sortable:true,hidden:true},{header:"Run Count",width:30,dataIndex:"run_count",sortable:false},new Ext.grid.CheckColumn({sortable:true,header:"Active",dataIndex:"isactive",editor:new Ext.grid.GridEditor(new Ext.form.Checkbox({value:"isactive"})),width:25})];this.form=new Ext.form.BasicForm("testopia_helper_frm",{});this.bbar=new TestopiaPager("environment",this.store);EnvironmentGrid.superclass.constructor.call(this,{title:"Environments",id:"environment-grid",loadMask:{msg:"Loading Environments..."},autoExpandColumn:"env_name_col",autoScroll:true,sm:new Ext.grid.RowSelectionModel({singleSelect:true,listeners:{rowselect:function(H,F,G){Ext.getCmp("delete_env_list_btn").enable();Ext.getCmp("clone_env_list_btn").enable()},rowdeselect:function(H,F,G){if(H.getCount()<1){Ext.getCmp("delete_env_list_btn").disable();Ext.getCmp("clone_env_list_btn").disable()}}}}),viewConfig:{forceFit:true},tbar:[{xtype:"button",text:"Import",handler:this.importEnv.createDelegate(this)},new Ext.Toolbar.Fill(),{xtype:"button",id:"add_env_list_btn",template:button_16x_tmpl,icon:"testopia/img/add.png",iconCls:"img_button_16x",tooltip:"Add an Environment",handler:this.createEnv.createDelegate(this,["","add"])},{xtype:"button",id:"clone_env_list_btn",template:button_16x_tmpl,disabled:true,icon:"testopia/img/copy.png",iconCls:"img_button_16x",tooltip:"Clone this Environment",handler:this.cloneEnv.createDelegate(this)},{xtype:"button",id:"delete_env_list_btn",template:button_16x_tmpl,disabled:true,icon:"testopia/img/delete.png",iconCls:"img_button_16x",tooltip:"Delete this Environment",handler:this.deleteEnv.createDelegate(this)}]});Ext.apply(this,A);this.on("rowcontextmenu",this.onContextClick,this);this.on("afteredit",this.onGridEdit,this);this.on("activate",this.onActivate,this)};Ext.extend(EnvironmentGrid,Ext.grid.EditorGridPanel,{onContextClick:function(B,A,C){if(!this.menu){this.menu=new Ext.menu.Menu({id:"run-ctx-menu",items:[{text:"Create a new environment",handler:function(){window.location="tr_new_environment.cgi"}},{text:"Delete Environments",handler:this.deleteEnv.createDelegate(this)},{text:"Refresh List",icon:"testopia/img/refresh.png",iconCls:"img_button_16x",handler:function(){B.store.reload()}}]})}C.stopEvent();if(B.getSelectionModel().getCount()<1){B.getSelectionModel().selectRow(A)}this.menu.showAt(C.getXY())},onGridEdit:function(C){var A={env_id:C.record.get("environment_id")};var B=this.store;switch(C.field){case"name":A.action="rename";A.name=C.value;break;case"isactive":A.action="toggle";break}this.form.submit({url:"tr_environments.cgi",params:A,success:function(E,D){B.commitChanges()},failure:function(E,D){testopiaError(E,D);B.rejectChanges()}})},deleteEnv:function(){var A=this;Ext.Msg.show({title:"Confirm Delete?",msg:ENVIRONMENT_DELETE_WARNING,buttons:Ext.Msg.YESNO,animEl:"case-delete-btn",icon:Ext.MessageBox.QUESTION,fn:function(B){if(B=="yes"){form=new Ext.form.BasicForm("testopia_helper_frm",{});form.submit({url:"tr_environments.cgi",params:{env_id:A.getSelectionModel().getSelected().get("environment_id"),action:"delete"},success:function(){Ext.Msg.show({msg:"Test environment deleted",buttons:Ext.Msg.OK,icon:Ext.MessageBox.INFO});A.store.reload()},failure:function(D,C){testopiaError(D,C);A.store.reload()}})}}})},createEnv:function(A,C,E){var B=this;C=C||"add";var D=new Ext.Window({id:"create-env-win",title:"Environment XML Import",closable:true,width:400,height:230,plain:true,shadow:false,layout:"fit",items:[{xtype:"form",url:"tr_environments.cgi",bodyStyle:"padding: 10px",id:"env_create_frm",items:[{xtype:"field",fieldLabel:"Name",inputType:"text",name:"name",value:A!=""?"Copy of "+A:"",allowBlank:false},new ProductCombo({mode:"local",fieldLabel:"Product",value:B.product_id,hiddenName:"product_id"}),{xtype:"hidden",name:"action",value:C},{xtype:"hidden",name:"env_id",value:E}],buttons:[{text:"Create",handler:function(){Ext.getCmp("env_create_frm").getForm().submit({success:function(F,G){Ext.Msg.show({title:"Test Environment Created",msg:"Test environment "+G.result.id+" Created. Would you like to go there now?",buttons:Ext.Msg.YESNO,icon:Ext.MessageBox.QUESTION,fn:function(H){if(H=="yes"){window.location="tr_environments.cgi?env_id="+G.result.id}else{B.store.reload()}}});Ext.getCmp("create-env-win").close()},failure:testopiaError})}},{text:"Cancel",handler:function(){Ext.getCmp("create-env-win").close()}}]}]});D.show(this)},cloneEnv:function(){this.createEnv(this.getSelectionModel().getSelected().get("name"),"clone",this.getSelectionModel().getSelected().get("environment_id"))},importEnv:function(){grid=this;var A=new Ext.Window({id:"import-env-win",title:"Environment XML Import",closable:true,width:400,height:130,plain:true,shadow:false,layout:"fit",items:[{xtype:"form",url:"tr_import_environment.cgi",bodyStyle:"padding: 10px",id:"env_xml_import_frm",fileUpload:true,items:[{xtype:"field",fieldLabel:"XML",inputType:"file",name:"xml",allowBlank:false}],buttons:[{text:"Import",handler:function(){Ext.getCmp("env_xml_import_frm").getForm().submit();Ext.getCmp("import-env-win").close();grid.store.reload()}},{text:"Cancel",handler:function(){Ext.getCmp("import-env-win").close()}}]}]});A.show(this)},onActivate:function(A){if(!this.store.getCount()){this.store.load()}}});Testopia.Search={};Testopia.Search.dashboard_urls=[];Testopia.Search.fillInForm=function(C,F,A){var E=document.getElementById(C+"_search_form");for(var B=0;B");var D;for(var F in H){if(typeof H[F]!="string"){continue}var B=searchToJson(H[F]);var J;typeof B.qname=="object"?J=B.qname[0]:J=B.qname;D=new Ext.ux.Portlet({title:J||" ",id:"search"+A.get("name")+F,closable:true,autoScroll:true,tools:PortalTools});Ext.getCmp(I).add(D);Ext.getCmp(I).doLayout();I=I=="lc_"+A.get("name")?"rc_"+A.get("name"):"lc_"+A.get("name");D.load({scripts:true,url:H[F]})}}else{var E=searchToJson(A.get("query"));var C=E.current_tab;switch(C){case"plan":Ext.getCmp("object_panel").add(new PlanGrid(E,G));break;case"run":Ext.getCmp("object_panel").add(new RunGrid(E,G));break;case"case":Ext.getCmp("object_panel").add(new CaseGrid(E,G));break;default:Ext.Msg.show({title:"No Type Found",msg:"There must have been a problem saving this search. I can't find a type",buttons:Ext.Msg.OK,icon:Ext.MessageBox.ERROR});return }Ext.getCmp("object_panel").activate("search"+A.get("name"))}}});PortalTools=[{id:"gear",handler:function(D,C,A){var B=new Ext.form.BasicForm("testopia_helper_frm",{});this.menu=new Ext.menu.Menu({id:"portal_tools_menu",items:[{text:"Save",handler:function(){Ext.Msg.prompt("Save Report As","",function(E,F){if(E=="ok"){B.submit({url:"tr_query.cgi",params:{action:"save_query",query_name:F,query_part:A.url,type:1},success:function(){Ext.getCmp("reports_grid").store.load();A.title=F},failure:testopiaError})}})}},{text:"Refresh",icon:"testopia/img/refresh.png",iconCls:"img_button_16x",handler:function(){A.load({url:A.url})}},{text:"Link to this report",handler:function(){var H;if(A.url.match(/^http/)){H=A.url;H=H.replace(/\&noheader=1/gi,"")}else{var E=window.location;var F=E.pathname.match(/(.*)[\/\\]([^\/\\]+\.\w+)$/);F=F[1];H=E.protocol+"//"+E.host+F+"/"+A.url;H=H.replace(/\&noheader=1/gi,"")}var G=new Ext.Window({width:300,plain:true,shadow:false,items:[new Ext.form.TextField({value:H,width:287})]});G.show()}},{text:"Delete",handler:function(){Ext.Msg.show({title:"Confirm Delete?",icon:Ext.MessageBox.QUESTION,msg:"Are you sure you want to delete this report?",buttons:Ext.Msg.YESNO,fn:function(E,F){if(E=="yes"){B.submit({url:"tr_query.cgi",params:{action:"delete_query",query_name:A.title},success:function(){Ext.getCmp("reports_grid").store.load();A.ownerCt.remove(A,true)},failure:testopiaError})}}})}}]});D.stopEvent();this.menu.showAt(D.getXY())}},{id:"close",handler:function(C,B,A){A.ownerCt.remove(A,true)}}];Testopia.Tags={};Testopia.Tags.renderer=function(C,H,G,A,D,F,E,B){return'
'+C+"
"};Testopia.Tags.list=function(D,E,A){var B={title:"Tag Results: "+A,closable:true,id:A+"search"+E,autoScroll:true};var C={product_id:E,tags:A};var F;if(D=="case"){F=new CaseGrid(C,B)}else{if(D=="plan"){F=new PlanGrid(C,B)}else{if(D=="run"){F=new RunGrid(C,B)}}}Ext.getCmp("object_panel").add(F);Ext.getCmp("object_panel").activate(A+"search"+E)};TestopiaObjectTags=function(D,A){this.orig_id=A;this.obj_id=A;this.store=new Ext.data.JsonStore({url:"tr_tags.cgi",baseParams:{action:"gettags",type:D},root:"tags",id:"tag_id",fields:[{name:"tag_id",mapping:"tag_id"},{name:"tag_name",mapping:"tag_name"},{name:"run_count",mapping:"run_count"},{name:"case_count",mapping:"case_count"},{name:"plan_count",mapping:"plan_count"}]});var C=this.store;this.remove=function(){var F=new Ext.form.BasicForm("testopia_helper_frm",{});F.submit({url:"tr_tags.cgi",params:{action:"removetag",type:D,id:this.obj_id,tag:getSelectedObjects(Ext.getCmp(D+"tagsgrid"),"tag_name")},success:function(){C.reload()},failure:testopiaError})};this.add=function(){var F=new Ext.form.BasicForm("testopia_helper_frm",{});F.submit({url:"tr_tags.cgi",params:{action:"addtag",type:D,id:this.obj_id,tag:Ext.getCmp(D+"tag_lookup").getRawValue()},success:function(){C.reload()},failure:testopiaError})};this.columns=[{dataIndex:"tag_id",hidden:true,hideable:false},{header:"Name",width:150,dataIndex:"tag_name",id:"tag_name",sortable:true,hideable:false},{header:"Cases",width:35,dataIndex:"case_count",sortable:true,hidden:true,renderer:Testopia.Tags.renderer.createDelegate(this,["case"],true)},{header:"Runs",width:35,dataIndex:"run_count",sortable:true,hidden:true,renderer:Testopia.Tags.renderer.createDelegate(this,["run"],true)},{header:"Plans",width:35,dataIndex:"plan_count",sortable:true,hidden:true,renderer:Testopia.Tags.renderer.createDelegate(this,["plan"],true)}];var B=new Ext.Button({id:"tag_add_btn",icon:"testopia/img/add.png",iconCls:"img_button_16x",handler:this.add.createDelegate(this)});var E=new Ext.Button({icon:"testopia/img/delete.png",iconCls:"img_button_16x",handler:this.remove.createDelegate(this)});TestopiaObjectTags.superclass.constructor.call(this,{title:"Tags",split:true,region:"east",layout:"fit",width:200,autoExpandColumn:"tag_name",collapsible:true,id:D+"tagsgrid",loadMask:{msg:"Loading "+D+" tags..."},autoScroll:true,sm:new Ext.grid.RowSelectionModel({singleSelect:false}),viewConfig:{forceFit:true},tbar:[new TagLookup({id:D+"tag_lookup"}),B,E]});this.on("rowcontextmenu",this.onContextClick,this);this.on("activate",this.onActivate,this)};Ext.extend(TestopiaObjectTags,Ext.grid.GridPanel,{onContextClick:function(B,A,C){if(!this.menu){this.menu=new Ext.menu.Menu({id:"tags-ctx-menu",items:[{text:"Remove Selected Tags",icon:"testopia/img/delete.png",iconCls:"img_button_16x",handler:this.remove},{text:"Refresh List",icon:"testopia/img/refresh.png",iconCls:"img_button_16x",handler:function(){B.store.reload()}}]})}C.stopEvent();if(B.getSelectionModel().getCount()<1){B.getSelectionModel().selectRow(A)}this.menu.showAt(C.getXY())},onActivate:function(A){if(!this.store.getCount()||this.orig_id!=this.obj_id){this.store.load({params:{id:this.obj_id}})}}});TestopiaProductTags=function(F,C,A){var E;this.product_id=A;this.store=new Ext.data.JsonStore({url:"tr_tags.cgi",baseParams:{action:"gettags",type:C},root:"tags",id:"tag_id",fields:[{name:"tag_id",mapping:"tag_id"},{name:"tag_name",mapping:"tag_name"},{name:"run_count",mapping:"run_count"},{name:"case_count",mapping:"case_count"},{name:"plan_count",mapping:"plan_count"}]});var D=this.store;this.columns=[{header:"ID",dataIndex:"tag_id",hidden:true},{header:"Name",width:150,dataIndex:"tag_name",id:"tag_name",sortable:true},{header:"Cases",width:35,dataIndex:"case_count",sortable:true,renderer:Testopia.Tags.renderer.createDelegate(this,["case",A],true)},{header:"Runs",width:35,dataIndex:"run_count",sortable:true,renderer:Testopia.Tags.renderer.createDelegate(this,["run",A],true)},{header:"Plans",width:35,dataIndex:"plan_count",sortable:true,renderer:Testopia.Tags.renderer.createDelegate(this,["plan",A],true)}];var B=new Ext.form.TextField({allowBlank:true,id:"rungrid-filter",selectOnFocus:true});TestopiaProductTags.superclass.constructor.call(this,{title:F,id:C+"tags",loadMask:{msg:"Loading "+F+" ..."},autoExpandColumn:"tag_name",autoScroll:true,sm:new Ext.grid.RowSelectionModel({singleSelect:false}),viewConfig:{forceFit:true}});this.on("rowcontextmenu",this.onContextClick,this);this.on("activate",this.onActivate,this)};Ext.extend(TestopiaProductTags,Ext.grid.GridPanel,{onContextClick:function(B,A,C){if(!this.menu){this.menu=new Ext.menu.Menu({id:"tags-ctx-menu",items:[{text:"Refresh",icon:"testopia/img/refresh.png",iconCls:"img_button_16x",handler:function(){ds.reload()}}]})}C.stopEvent();this.menu.showAt(C.getXY())},onActivate:function(A){if(!this.store.getCount()){this.store.load({params:{product_id:this.product_id}})}}});TagsUpdate=function(B,A){function C(H,G,E){var F=new Ext.form.BasicForm("testopia_helper_frm",{});F.submit({url:"tr_tags.cgi",params:{action:H,tag:G,type:B,id:getSelectedObjects(E,B+"_id")},success:function(){},failure:testopiaError})}var D=new Ext.Window({title:"Add or Remove Tags",id:"tags_edit_win",layout:"fit",split:true,plain:true,shadow:false,width:350,height:150,items:[new Ext.FormPanel({labelWidth:"40",bodyStyle:"padding: 5px",items:[new TagLookup({fieldLabel:"Tags"})]})],buttons:[{text:"Add Tag",handler:function(){C("addtag",Ext.getCmp("tag_lookup").getRawValue(),A);D.close()}},{text:"Remove Tag",handler:function(){C("removetag",Ext.getCmp("tag_lookup").getRawValue(),A);D.close()}},{text:"Close",handler:function(){D.close()}}]});D.show()};
\ No newline at end of file
+ATTACHMENT_DELETE_WARNING="You are about to remove the selected attachments. This cannot be undone. Continue?";CASE_CATEGORY_DELETE_WARNING="You are about to delete the selected test case category. Are you sure you want to continue?";CASE_DELETE_WARNING="You are about to delete the selected test cases including all children and history. This action cannot be undone. Are you sure you want to continue?";PLAN_DELETE_WARNING="You are about to delete the selected test plans including all children and history. This action cannot be undone. Are you sure you want to continue?";RUN_DELETE_WARNING="You are about to delete the selected test runs including all children and history. This action cannot be undone. Are you sure you want to continue?";CASERUN_DELETE_WARNING="You are about to remove the selected test cases from this run including all history. This action cannot be undone. Are you sure you want to continue?";ENVIRONMENT_DELETE_WARNING="You are about to delete the selected test environment including associated test case data. This action cannot be undone. Are you sure you want to continue?";Ext.state.Manager.setProvider(new Ext.state.CookieProvider({expires:new Date(new Date().getTime()+(1000*60*60*24*30))}));Ext.data.Connection.timeout=120000;Ext.Updater.defaults.timeout=120000;Ext.Ajax.timeout=120000;var Testopia={};Testopia.Util={};Testopia.Environment={};Ext.grid.CheckColumn=function(A){Ext.apply(this,A);if(!this.id){this.id=Ext.id()}this.renderer=this.renderer.createDelegate(this)};Ext.grid.CheckColumn.prototype={init:function(A){this.grid=A;this.grid.on("render",function(){var B=this.grid.getView();B.mainBody.on("mousedown",this.onMouseDown,this)},this)},onMouseDown:function(D,C){if(C.className&&C.className.indexOf("x-grid3-cc-"+this.id)!=-1){D.stopEvent();var B=this.grid.getView().findRowIndex(C);var A=this.grid.store.getAt(B);A.set(this.dataIndex,!A.data[this.dataIndex])}},renderer:function(B,C,A){C.css+=" x-grid3-check-col-td";return'
'}};TestopiaUtil=function(){this.statusIcon=function(B){return''};this.caseLink=function(G,B,F,C,D,E){if(E.isTreport===true){return''+G+""}return''+G+""};this.runLink=function(G,B,F,C,D,E){if(E.isTreport===true){return''+G+""}return''+G+""};this.planLink=function(G,B,F,C,D,E){if(E.isTreport===true){return''+G+""}return''+G+""};this.bugLink=function(G,B,F,C,D,E){if(E.isTreport===true){return''+G+""}return''+G+""};this.newRunPopup=function(C){var B=new Ext.Window({id:"newRun-win",closable:true,width:Ext.getBody().getViewSize().width-150,height:Ext.getBody().getViewSize().height-150,plain:true,shadow:false,layout:"fit",items:[new NewRunForm(C)]});B.show(this)};this.newCaseForm=function(E,C,B){var D=new Ext.Window({id:"newcase-win",closable:true,width:Ext.getBody().getViewSize().width-150,height:Ext.getBody().getViewSize().height-150,plain:true,shadow:false,layout:"fit",items:[new NewCaseForm(E,C,B)]});D.show(this)};this.addCaseToRunPopup=function(C){var B=new Ext.Window({id:"add_case_to_run_win",closable:true,width:Ext.getBody().getViewSize().width-150,height:Ext.getBody().getViewSize().height-150,plain:true,shadow:false,layout:"fit",items:[new AddCaseToRunForm(C)]});B.show(this)};this.newPlanPopup=function(B){var C=new Ext.Window({id:"newplan-win",closable:true,width:800,height:550,plain:true,shadow:false,layout:"fit",items:[new NewPlanForm()]});C.show(this)};addOption=function(B,C){try{B.add(C,null)}catch(D){B.add(C,B.length)}};lsearch=function(D,B){if(typeof B!="object"){if(B==D){return true}return false}for(var C in B){if(B[C]==D){return true}}return false};this.addOption=addOption;var A=function(H,C){var E=searchToJson(window.location.search);if(C){E.product=C}for(var D in H.selectTypes){if(typeof H.selectTypes[D]!="function"){try{document.getElementById(H.selectTypes[D]).options.length=0;for(var B in H[H.selectTypes[D]]){if(typeof H[H.selectTypes[D]][B]!="function"){var G=new Option(H[H.selectTypes[D]][B],H[H.selectTypes[D]][B],false,lsearch(H[H.selectTypes[D]][B],E[H.selectTypes[D]]));addOption(document.getElementById(H.selectTypes[D]),G)}}document.getElementById(H.selectTypes[D]).disabled=false;document.getElementById(H.selectTypes[D])}catch(F){}}}};this.fillSelects=A;this.onProductSelection=function(B){var E=[];for(var C=0;C
','
',"
");UserLookup=function(A){UserLookup.superclass.constructor.call(this,{id:A.id||"user_lookup",store:new Ext.data.JsonStore({url:"tr_quicksearch.cgi",baseParams:{action:"getuser"},root:"users",totalProperty:"total",id:"login",fields:[{name:"login",mapping:"id"},{name:"name",mapping:"name"}]}),listeners:{valid:function(B){B.value=B.getRawValue()}},queryParam:"search",loadingText:"Looking up users...",displayField:"login",valueField:"login",typeAhead:true,hideTrigger:true,minListWidth:300,forceSelection:false,emptyText:"Type a username...",pageSize:20,tpl:'
{name}
{login}
'});Ext.apply(this,A)};Ext.extend(UserLookup,Ext.form.ComboBox);TagLookup=function(A){TagLookup.superclass.constructor.call(this,{id:A.id||"tag_lookup",store:new Ext.data.JsonStore({url:"tr_quicksearch.cgi",baseParams:{action:"gettag"},root:"tags",totalProperty:"total",fields:[{name:"id",mapping:"tag_id"},{name:"name",mapping:"tag_name"}]}),queryParam:"search",loadingText:"Looking up tags...",displayField:"name",valueField:"id",typeAhead:false,hiddenName:"tag",hideTrigger:true,minListWidth:300,minChars:2,width:150,editable:true,forceSelection:false,emptyText:"Type a tagname...",listeners:{specialkey:function(B,C){if(C.getKey()==C.ENTER){Ext.getCmp("tag_add_btn").fireEvent("click")}}}});Ext.apply(this,A)};Ext.extend(TagLookup,Ext.form.ComboBox);BuildCombo=function(A){BuildCombo.superclass.constructor.call(this,{id:A.id||"build_combo",store:A.transform?false:new BuildStore(A.params,A.mode=="local"?true:false),loadingText:"Looking up builds...",displayField:"name",valueField:"id",typeAhead:true,triggerAction:"all",minListWidth:300,forceSelection:true,transform:A.transform,emptyText:"Builds..."});Ext.apply(this,A);this.store.on("load",function(){if(A.value){this.setValue(A.value)}},this)};Ext.extend(BuildCombo,Ext.form.ComboBox);CaseCategoryCombo=function(A){CaseCategoryCombo.superclass.constructor.call(this,{id:A.id||"case_category_combo",store:A.transform?false:new CaseCategoryStore(A.params,A.mode=="local"?true:false),loadingText:"Looking up categories...",displayField:"name",valueField:"category_id",typeAhead:true,triggerAction:"all",minListWidth:300,forceSelection:true,transform:A.transform,emptyText:"Please select..."});Ext.apply(this,A);this.store.on("load",function(){if(A.value){this.setValue(A.value)}},this)};Ext.extend(CaseCategoryCombo,Ext.form.ComboBox);EnvironmentCombo=function(A){if(A.params){A.params.viewall=1}EnvironmentCombo.superclass.constructor.call(this,{id:A.id||"environment_combo",store:A.transform?false:new EnvironmentStore(A.params,A.mode=="local"?true:false),loadingText:"Looking up environments...",displayField:"name",valueField:"environment_id",typeAhead:true,triggerAction:"all",minListWidth:300,forceSelection:true,transform:A.transform,emptyText:"Environments..."});Ext.apply(this,A);this.store.on("load",function(){if(A.value){this.setValue(A.value)}},this)};Ext.extend(EnvironmentCombo,Ext.form.ComboBox);ProductCombo=function(A){ProductCombo.superclass.constructor.call(this,{id:A.id||"product_combo",store:A.transform?false:new ProductStore(A.params,A.mode=="local"?true:false),loadingText:"Looking up products...",displayField:"name",valueField:"id",typeAhead:true,triggerAction:"all",minListWidth:300,forceSelection:true,transform:A.transform,emptyText:"Please select..."});Ext.apply(this,A);this.store.on("load",function(){if(A.value){this.setValue(A.value)}},this)};Ext.extend(ProductCombo,Ext.form.ComboBox);ProductVersionCombo=function(A){ProductVersionCombo.superclass.constructor.call(this,{id:A.id||"product_version_combo",store:A.transform?false:new ProductVersionStore(A.params,A.mode=="local"?true:false),loadingText:"Looking up versions...",displayField:"name",valueField:"id",typeAhead:true,triggerAction:"all",minListWidth:300,forceSelection:true,transform:A.transform,emptyText:"Please select..."});Ext.apply(this,A);this.store.on("load",function(){if(A.value){this.setValue(A.value)}},this)};Ext.extend(ProductVersionCombo,Ext.form.ComboBox);CaseRunStatusCombo=function(A){CaseRunStatusCombo.superclass.constructor.call(this,{id:A.id||"case_run_status_combo",store:A.transform?false:new CaseRunStatusStore(A.mode=="local"?true:false),loadingText:"Looking up statuses...",displayField:"name",valueField:"id",typeAhead:true,triggerAction:"all",minListWidth:300,forceSelection:true,transform:A.transform,emptyText:"Please select..."});Ext.apply(this,A);this.store.on("load",function(){if(A.value){this.setValue(A.value)}},this)};Ext.extend(CaseRunStatusCombo,Ext.form.ComboBox);CaseStatusCombo=function(A){CaseStatusCombo.superclass.constructor.call(this,{id:A.id||"case_status_combo",store:A.transform?false:new CaseStatusStore(A.mode=="local"?true:false),loadingText:"Looking up statuses...",displayField:"name",valueField:"id",typeAhead:true,triggerAction:"all",minListWidth:100,forceSelection:true,transform:A.transform,emptyText:"Please select..."});Ext.apply(this,A);this.store.on("load",function(){if(A.value){this.setValue(A.value)}},this)};Ext.extend(CaseStatusCombo,Ext.form.ComboBox);ComponentCombo=function(A){ComponentCombo.superclass.constructor.call(this,{id:A.id||"component_combo",store:A.transform?false:new ComponentStore(A.params,A.mode=="local"?true:false),loadingText:"Looking up Components...",displayField:"name",valueField:"id",editable:false,triggerAction:"all",minListWidth:300,forceSelection:true,transform:A.transform,emptyText:"Please select..."});Ext.apply(this,A);this.store.on("load",function(){if(A.value){this.setValue(A.value)}},this)};Ext.extend(ComponentCombo,Ext.form.ComboBox);MilestoneCombo=function(A){MilestoneCombo.superclass.constructor.call(this,{id:A.id||"milestone_combo",store:A.transform?false:new MilestoneStore(A.params,A.mode=="local"?true:false),loadingText:"Looking up milestones...",displayField:"name",valueField:"id",typeAhead:true,triggerAction:"all",minListWidth:300,forceSelection:true,transform:A.transform,emptyText:"Please select..."});Ext.apply(this,A);this.store.on("load",function(){if(A.value){this.setValue(A.value)}},this)};Ext.extend(MilestoneCombo,Ext.form.ComboBox);PlanTypesCombo=function(A){PlanTypesCombo.superclass.constructor.call(this,{id:A.id||"plan_type_combo",store:A.transform?false:new PlanTypesStore(A.mode=="local"?true:false),loadingText:"Looking up types...",displayField:"name",valueField:"id",typeAhead:true,triggerAction:"all",minListWidth:300,forceSelection:true,transform:A.transform,emptyText:"Please select..."});Ext.apply(this,A);this.store.on("load",function(){if(A.value){this.setValue(A.value)}},this)};Ext.extend(PlanTypesCombo,Ext.form.ComboBox);PriorityCombo=function(A){PriorityCombo.superclass.constructor.call(this,{id:A.id||"priority_combo",store:A.transform?false:new PriorityStore(A.mode=="local"?true:false),loadingText:"Looking up priorities...",displayField:"name",valueField:"id",typeAhead:true,triggerAction:"all",minListWidth:100,forceSelection:true,transform:A.transform,emptyText:"Please select..."});Ext.apply(this,A);this.store.on("load",function(){if(A.value){this.setValue(A.value)}},this)};Ext.extend(PriorityCombo,Ext.form.ComboBox);RunProgress=function(A){RunProgress.superclass.constructor.call(this,A)};Ext.extend(RunProgress,Ext.ProgressBar,{onRender:function(C,A){Ext.ProgressBar.superclass.onRender.call(this,C,A);var B=new Ext.Template('