diff --git a/mozilla/webtools/testopia/testopia/js/run.js b/mozilla/webtools/testopia/testopia/js/run.js index 6848bcf3584..a501cc2d410 100644 --- a/mozilla/webtools/testopia/testopia/js/run.js +++ b/mozilla/webtools/testopia/testopia/js/run.js @@ -853,13 +853,20 @@ Ext.extend(RunFilterGrid, Ext.grid.GridPanel, { if(!this.menu){ // create context menu on first right click this.menu = new Ext.menu.Menu({ id:'run_filter_ctx', - items: [ - { - text: 'Open search in new tab', - handler: function(){} - },{ - text: 'Delete Saved Search', - handler: function(){} + items: [{ + text: 'Delete Saved Filter', + handler: function(){ + var form = new Ext.form.BasicForm('testopia_helper_frm', {}); + form.submit({ + url: 'tr_process_run.cgi', + params: {action: 'delete_filter', query_name: grid.store.getAt(index).get('name'), run_id: grid.store.baseParams.run_id}, + success: function(){ + TestopiaUtil.notify.msg('Filter removed', 'filter removed successfully'); + grid.store.reload(); + }, + failure: testopiaError + }); + } }] }); } diff --git a/mozilla/webtools/testopia/tr_history.cgi b/mozilla/webtools/testopia/tr_history.cgi index 705c48a703d..a51c88924c2 100755 --- a/mozilla/webtools/testopia/tr_history.cgi +++ b/mozilla/webtools/testopia/tr_history.cgi @@ -33,6 +33,9 @@ if ($cgi->param('object') eq 'plan'){ elsif ($cgi->param('object') eq 'case'){ $obj = Bugzilla::Testopia::TestCase->new($cgi->param('object_id')); } +elsif ($cgi->param('object') eq 'run'){ + $obj = Bugzilla::Testopia::TestRun->new($cgi->param('object_id')); +} else{ ThrowUserError("testopia-unknown-type", {'object' => $obj}); } diff --git a/mozilla/webtools/testopia/tr_process_run.cgi b/mozilla/webtools/testopia/tr_process_run.cgi index 8c9b11c9479..9a73708e72b 100755 --- a/mozilla/webtools/testopia/tr_process_run.cgi +++ b/mozilla/webtools/testopia/tr_process_run.cgi @@ -186,8 +186,9 @@ elsif ($action eq 'delete_filter'){ my $dbh = Bugzilla->dbh; ThrowUserError('query_name_missing') unless $cgi->param('query_name'); ThrowUserError("testopia-read-only", {'object' => $run}) unless $run->canedit; - - my $qname = '__run_id_' . $run->id . '_' . $cgi->param('query_name'); + my $qname = $cgi->param('query_name'); + trick_taint($qname); + $qname = '__run_id_' . $run->id . '_' . $qname; $dbh->do( "DELETE FROM test_named_queries