From bd18b33e2b97a2cabbe2d7c3db35a4b3036aebf6 Mon Sep 17 00:00:00 2001 From: "ghendricks%novell.com" Date: Fri, 28 Mar 2008 20:48:15 +0000 Subject: [PATCH] Finalize bug report git-svn-id: svn://10.0.0.236/trunk@248795 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/testopia/testopia/js/run.js | 17 +++++++++++++---- mozilla/webtools/testopia/testopia/js/util.js | 17 ++++++++++++++--- mozilla/webtools/testopia/tr_run_reports.cgi | 6 ++++-- 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/mozilla/webtools/testopia/testopia/js/run.js b/mozilla/webtools/testopia/testopia/js/run.js index d0a3c5e23a8..5950b6f1aff 100644 --- a/mozilla/webtools/testopia/testopia/js/run.js +++ b/mozilla/webtools/testopia/testopia/js/run.js @@ -941,6 +941,7 @@ Ext.extend(RunFilterGrid, Ext.grid.GridPanel, { Testopia.BugReport = function(params){ params.type = 'bug'; + var tutil = new TestopiaUtil(); this.store = new Ext.data.GroupingStore({ url: 'tr_run_reports.cgi', baseParams: params, @@ -949,21 +950,29 @@ Testopia.BugReport = function(params){ fields: [ {name: "case_id", mapping:"case_id"}, {name: "run_id", mapping:"run_id"}, - {name: "bug_id", mapping:"bug_id"} + {name: "bug_id", mapping:"bug_id"}, + {name: "case_status", mapping:"case_status"}, + {name: "bug_status", mapping:"bug_status"}, + {name: "severity", mapping:"bug_severity"} ]}), remoteSort: true, sortInfo: {field: 'run_id', direction: "ASC"}, groupField: 'bug_id' }); + this.store.isTreport = true; this.view = new Ext.grid.GroupingView({ forceFit:true, groupTextTpl: '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Items" : "Item"]})' }); this.columns = [ - {header: 'Case', dataIndex: 'case_id', sortable: true, hideable: true}, - {header: 'Bug', dataIndex: 'bug_id', sortable: true, hideable: true}, - {header: 'Run', dataIndex: 'run_id', sortable: true, hideable: true} + {header: 'Run', dataIndex: 'run_id', sortable: true, hideable: true, groupRenderer: function(v){return v;}, renderer: tutil.runLink}, + {header: 'Case', dataIndex: 'case_id', sortable: true, hideable: true, groupRenderer: function(v){return v;}, renderer: tutil.caseLink}, + {header: 'Bug', dataIndex: 'bug_id', sortable: true, hideable: true, groupRenderer: function(v){return v;}, renderer: tutil.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(), diff --git a/mozilla/webtools/testopia/testopia/js/util.js b/mozilla/webtools/testopia/testopia/js/util.js index f9ea6e2ae6e..163f2cd2631 100755 --- a/mozilla/webtools/testopia/testopia/js/util.js +++ b/mozilla/webtools/testopia/testopia/js/util.js @@ -64,15 +64,26 @@ TestopiaUtil = function(){ this.statusIcon = function (name){ return ''+ name +''; }; - this.caseLink = function(id){ + this.caseLink = function(id,m,r,ri,ci,s){ + if (s.isTreport === true) + return '' + id +''; return '' + id +''; }; - this.runLink = function(id){ + this.runLink = function(id,m,r,ri,ci,s){ + if (s.isTreport === true) + return '' + id +''; return '' + id +''; }; - this.planLink = function(id){ + this.planLink = function(id,m,r,ri,ci,s){ + if (s.isTreport === true) + return '' + id +''; return '' + id +''; }; + this.bugLink = function(id,m,r,ri,ci,s){ + if (s.isTreport === true) + return '' + id +''; + return '' + id +''; + }; this.newRunPopup = function(plan){ var win = new Ext.Window({ diff --git a/mozilla/webtools/testopia/tr_run_reports.cgi b/mozilla/webtools/testopia/tr_run_reports.cgi index dcac3460c8d..fba6f0234fc 100644 --- a/mozilla/webtools/testopia/tr_run_reports.cgi +++ b/mozilla/webtools/testopia/tr_run_reports.cgi @@ -143,10 +143,12 @@ elsif ($type eq 'bug'){ push @ids, $r->id; } my $ref = $dbh->selectall_arrayref(" - SELECT DISTINCT tcb.bug_id, tcr.run_id, tcr.case_id + SELECT DISTINCT tcb.bug_id, bugs.bug_status, bugs.bug_severity, tcr.run_id, tcr.case_id, tcrs.name AS case_status FROM test_case_bugs AS tcb INNER JOIN test_case_runs AS tcr ON tcr.case_id = tcb.case_id - WHERE tcr.run_id in (" . join (',',@ids) . ")", + INNER JOIN bugs on tcb.bug_id = bugs.bug_id + INNER JOIN test_case_run_status AS tcrs ON tcr.case_run_status_id = tcrs.case_run_status_id + WHERE tcr.run_id in (" . join (',',@ids) . ") AND tcr.iscurrent = 1", {"Slice" =>{}}); my $json = new JSON;