Fix #7123 - getting abra ready to test
[Pman.Xtuple] / Pman.Tab.XtupleReports.js
index d2235e2..021e82f 100644 (file)
@@ -65,7 +65,7 @@ Pman.Tab.XtupleReports = new Roo.XComponent({
                                     Roo.MessageBox.alert("Downloading",
                                     
                                        "Report template is downloading - use " +
-                                           '<a href="http://sourceforge.net/projects/openrpt/files/openrpt/">' + 
+                                           '<a target="_new" href="http://sourceforge.net/projects/openrpt/files/openrpt/">' + 
                                            "report writer to edit this" + 
                                            '</a>'
                                        );
@@ -288,10 +288,25 @@ Pman.Tab.XtupleReports = new Roo.XComponent({
                                 },
                                 rowdblclick : function (_self, rowIndex, e)
                                 {
-                                    if (!_this.dialog) return;
-                                    _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
-                                        _this.grid.footer.onClick('first');
-                                    }); 
+                                    var rec = this.ds.getAt(rowIndex);
+                                    new Pman.Download({
+                                        url : baseURL + '/Roo/Report/' + rec.data.report_name +'-' + rec.data.report_id + '.rpt',
+                                        method : 'GET',
+                                        params : {
+                                            _id : rec.data.report_id,
+                                            _download : 1
+                                        }
+                                    });
+                                    Roo.MessageBox.alert("Downloading",
+                                    
+                                       "Report template is downloading - use " +
+                                           '<a target="_new" href="http://sourceforge.net/projects/openrpt/files/openrpt/">' + 
+                                           "report writer to edit this" + 
+                                           '</a>'
+                                       );
+                                           
+                                    
+                                    
                                 }
                             },
                             autoExpandColumn : 'Report loaddate',
@@ -305,7 +320,7 @@ Pman.Tab.XtupleReports = new Roo.XComponent({
                                         if (!_this.grid) {
                                             return false;
                                         } 
-                                        var sel  = _this.grid.selModel.getSelected()
+                                        var sel  = _this.grid.selModel.getSelected();
                                         if (!sel) {
                                             this.removeAll();
                                             return false;