Save bug reports

git-svn-id: svn://10.0.0.236/trunk@253732 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
ghendricks%novell.com 2008-08-20 23:18:11 +00:00
parent 4519be4916
commit 57afa22c40
5 changed files with 117 additions and 116 deletions

View File

@ -22,27 +22,25 @@
# ...
#%]
[% title = "Bug Impact Report for Plan $plan.id - $plan.name" %]
[% PROCESS global/header.html.tmpl
%]
<p>This report details the bugs detected in this test plan and the number of test cases that each bug is attached to.
Those bugs impacting the most test cases appear at the top.
Click the link under Test Cases to be taken to a list of those cases.
</p>
<table>
<tr class="bz_row_header">
<th># of Test Cases</th>
<th>Bug</th>
</tr>
[% FOREACH row = bug_table %]
<tr class="[% loop.count % 2 == 1 ? "bz_row_odd" : "bz_row_even" %]">
<td align="center"><a href="tr_list_cases.cgi?bug_id=[% row.bug_id %]&plan_id=[% plan.id FILTER none %]">[% row.casecount FILTER html %]</a></td>
<td align="center">[% row.bug_id FILTER bug_link(row.bug_id) %]</td>
</tr>
[% PROCESS testopia/style.none.tmpl %]
[% UNLESS stripheader %]
[% PROCESS global/header.html.tmpl %]
[% END %]
<script type="text/javascript">
Ext.onReady(function(){
var bug_list = new Testopia.BugReport({
run_ids: '[% runs || 0 FILTER js %]',
plan_ids: '[% plans || 0 FILTER js %]'
});
bug_list.render('bug_count_report');
bug_list.store.load();
});
</script>
<div id="bug_count_report"></div>
[% UNLESS stripheader %]
[% PROCESS global/footer.html.tmpl %]
[% END %]
</table>
<p>
<a href="tr_show_plan.cgi?plan_id=[% plan.id FILTER none %]">Back</a> to plan.
</p>
[% PROCESS global/footer.html.tmpl %]

View File

@ -404,24 +404,20 @@ Ext.extend(PlanGrid, Ext.grid.EditorGridPanel, {
text: 'New Bug Report',
handler: function(){
Ext.getCmp('object_panel').setActiveTab('dashboardpanel');
var bug_list = new Testopia.BugReport({
plan_ids: getSelectedObjects(grid, 'plan_id')
});
var newPortlet = new Ext.ux.Portlet({
title: 'Bug Report',
closable: true,
autoScroll: true,
tools: [{
id:'close',
handler: function(e, target, panel){
panel.ownerCt.remove(panel, true);
}
}],
items: bug_list
tools: PortalTools
});
newPortlet.url = 'tr_run_reports.cgi?type=bug_grid&plan_ids=' + getSelectedObjects(grid, 'plan_id') + '&noheader=1';
Testopia.Search.dashboard_urls.push(newPortlet.url);
Ext.getCmp('dashboard_leftcol').add(newPortlet);
Ext.getCmp('dashboard_leftcol').doLayout();
bug_list.store.load();
newPortlet.load({
scripts: true,
url: newPortlet.url
});
}
},{
text: 'Missing Cases Report',

View File

@ -371,24 +371,20 @@ Ext.extend(RunGrid, Ext.grid.EditorGridPanel, {
text: 'New Run Bug Report',
handler: function(){
Ext.getCmp('object_panel').setActiveTab('dashboardpanel');
var bug_list = new Testopia.BugReport({
run_ids: getSelectedObjects(grid, 'run_id')
});
var newPortlet = new Ext.ux.Portlet({
title: 'Bug Report',
closable: true,
autoScroll: true,
tools: [{
id:'close',
handler: function(e, target, panel){
panel.ownerCt.remove(panel, true);
}
}],
items: bug_list
tools: PortalTools
});
newPortlet.url = 'tr_run_reports.cgi?type=bug_grid&run_ids=' + getSelectedObjects(grid, 'run_id') + '&noheader=1';
Testopia.Search.dashboard_urls.push(newPortlet.url);
Ext.getCmp('dashboard_leftcol').add(newPortlet);
Ext.getCmp('dashboard_leftcol').doLayout();
bug_list.store.load();
newPortlet.load({
scripts: true,
url: newPortlet.url
});
}
}]
}
@ -1317,7 +1313,7 @@ Testopia.BugReport = function(params){
{name: "severity", mapping:"bug_severity"}
]}),
remoteSort: true,
remoteSort: false,
sortInfo: {field: 'run_id', direction: "ASC"},
groupField: 'bug_id'
});

View File

@ -492,6 +492,7 @@ ReportGrid = function(cfg){
Ext.getCmp(current_col).doLayout();
Testopia.Search.dashboard_urls.push(r.get('query'));
newPortlet.load({
scripts: true,
url: r.get('query')
});
current_col = current_col == 'dashboard_leftcol' ? 'dashboard_rightcol' : 'dashboard_leftcol';
@ -702,85 +703,84 @@ PortalTools = [{
id:'gear',
handler: function(e,target,panel){
var form = new Ext.form.BasicForm('testopia_helper_frm',{});
if(!this.menu){ // create context menu on first right click
this.menu = new Ext.menu.Menu({
id: 'portal_tools_menu',
items: [
{
text: 'Save',
handler: function(){
Ext.Msg.prompt('Save Report As', '', function(btn, text){
if (btn == 'ok'){
this.menu = new Ext.menu.Menu({
id: 'portal_tools_menu',
items: [
{
text: 'Save',
handler: function(){
Ext.Msg.prompt('Save Report As', '', function(btn, text){
if (btn == 'ok'){
form.submit({
url: 'tr_query.cgi',
params: {action: 'save_query', query_name: text, query_part: panel.url, type: 1},
success: function(){
Ext.getCmp('reports_grid').store.load();
panel.title = text;
},
failure: testopiaError
});
}
});
}
},{
text: 'Refresh',
icon: 'testopia/img/refresh.png',
iconCls: 'img_button_16x',
handler: function(){
panel.load({url: panel.url});
}
},{
text: 'Link to this report',
handler: function(){
var path;
if (panel.url.match(/^http/)){
path = panel.url;
path = path.replace(/\&noheader=1/gi, '');
}
else{
var l = window.location;
var pathprefix = l.pathname.match(/(.*)[\/\\]([^\/\\]+\.\w+)$/);
pathprefix = pathprefix[1];
path = l.protocol + '//' + l.host + pathprefix + '/' + panel.url;
path = path.replace(/\&noheader=1/gi, '');
}
var win = new Ext.Window({
width: 300,
plain: true,
shadow: false,
items: [new Ext.form.TextField({
value: path,
width: 287
})]
});
win.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(btn, text){
if (btn == 'yes'){
form.submit({
url: 'tr_query.cgi',
params: {action: 'save_query', query_name: text, query_part: panel.url, type: 1},
params: {action: 'delete_query', query_name: panel.title},
success: function(){
Ext.getCmp('reports_grid').store.load();
panel.title = text;
panel.ownerCt.remove(panel, true);
},
failure: testopiaError
});
}
});
}
},{
text: 'Refresh',
icon: 'testopia/img/refresh.png',
iconCls: 'img_button_16x',
handler: function(){
panel.load({url: panel.url});
}
},{
text: 'Link to this report',
handler: function(){
var path;
if (panel.url.match(/^http/)){
path = panel.url;
path = path.replace(/\&noheader=1/gi, '');
}
else{
var l = window.location;
var pathprefix = l.pathname.match(/(.*)[\/\\]([^\/\\]+\.\w+)$/);
pathprefix = pathprefix[1];
path = l.protocol + '//' + l.host + pathprefix + '/' + panel.url;
}
var win = new Ext.Window({
width: 300,
plain: true,
shadow: false,
items: [new Ext.form.TextField({
value: path,
width: 287
})]
});
win.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(btn, text){
if (btn == 'yes'){
form.submit({
url: 'tr_query.cgi',
params: {action: 'delete_query', query_name: panel.title},
success: function(){
Ext.getCmp('reports_grid').store.load();
panel.ownerCt.remove(panel, true);
},
failure: testopiaError
});
}
}
});
}
}]
});
}
});
}
}]
});
e.stopEvent();
this.menu.showAt(e.getXY());
}

View File

@ -275,6 +275,17 @@ elsif ($type eq 'bug'){
exit;
}
elsif ($type eq 'bug_grid'){
$vars->{'runs'} = $cgi->param('run_ids');
$vars->{'plans'} = $cgi->param('plan_ids');
$vars->{'stripheader'} = 1 if $cgi->param('noheader');
print $cgi->header;
$template->process("testopia/reports/bug-count.html.tmpl", $vars)
|| ThrowTemplateError($template->error());
exit;
}
$cgi->param('current_tab', 'run');
$cgi->param('viewall', 1);
my $report = Bugzilla::Testopia::Report->new('run', 'tr_list_runs.cgi', $cgi);