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
This commit is contained in:
ghendricks%novell.com 2008-09-17 21:06:04 +00:00
parent f2e12a01f9
commit eff3965cf7
5 changed files with 74 additions and 209 deletions

View File

@ -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'

View File

@ -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();

View File

@ -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
})]
});

View File

@ -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
*/
/*

File diff suppressed because one or more lines are too long