Fix #7123 - getting abra ready to test
[Pman.Xtuple] / Pman.Tab.XtupleReports.bjs
index 396def7..32528ed 100644 (file)
@@ -1,5 +1,5 @@
 {
-    "id": "roo-file-527",
+    "id": "roo-file-384",
     "name": "Pman.Tab.XtupleReports",
     "parent": "Pman.Tab.Admin",
     "title": "",
@@ -45,7 +45,7 @@
                                 {
                                     "listeners": {
                                         "|render": "function() \n{\n    _this.grid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.panel.active) {\n       this.footer.onClick('first');\n    }\n}",
-                                        "rowdblclick": "function (_self, rowIndex, e)\n{\n    var rec = this.ds.getAt(rowIndex);\n    new Pman.Download({\n        url : baseURL + '/Roo/Report/' + rec.data.report_name +'-' + rec.data.report_id + '.rpt',\n        method : 'GET',\n        params : {\n            _id : rec.data.report_id,\n            _download : 1\n        }\n    });\n    Roo.MessageBox.alert(\"Downloading\",\n    \n       \"Report template is downloading - use \" +\n           '<a href=\"http://sourceforge.net/projects/openrpt/files/openrpt/\">' + \n           \"report writer to edit this\" + \n           '</a>'\n       );\n           \n    \n    \n}"
+                                        "rowdblclick": "function (_self, rowIndex, e)\n{\n    var rec = this.ds.getAt(rowIndex);\n    new Pman.Download({\n        url : baseURL + '/Roo/Report/' + rec.data.report_name +'-' + rec.data.report_id + '.rpt',\n        method : 'GET',\n        params : {\n            _id : rec.data.report_id,\n            _download : 1\n        }\n    });\n    Roo.MessageBox.alert(\"Downloading\",\n    \n       \"Report template is downloading - use \" +\n           '<a target=\"_new\" href=\"http://sourceforge.net/projects/openrpt/files/openrpt/\">' + \n           \"report writer to edit this\" + \n           '</a>'\n       );\n           \n    \n    \n}"
                                     },
                                     "*prop": "grid",
                                     "autoExpandColumn": "report_descrip",
                                                     "xtype": "Fill"
                                                 },
                                                 {
-                                                    "|xns": "Roo.Toolbar",
-                                                    "xtype": "Button"
+                                                    "listeners": {
+                                                        "click": "function (_self, e)\n{\n    \n    var sel = _this.grid.selModel.getSelected();\n    if (!sel) {\n        Roo.MessageBox.alert(\"Error\", \"Select a report\");\n        return;\n    }\n    \n    Pman.Dialog.Image.show(\n       {\n            _url : baseURL+'/Xtuple/Import/Report',\n             onid : sel.data.report_id\n             \n            \n       },\n       function (data) {\n            Roo.MessageBox.alert(\"Notice\", \"Updated\");\n            _this.grid.footer.onClick('refresh');\n       }\n   );\n}"
+                                                    },
+                                                    "text": "Upload New version",
+                                                    "xtype": "Button",
+                                                    "|xns": "Roo.Toolbar"
                                                 }
                                             ]
                                         },
                                 {
                                     "listeners": {
                                         "|render": "function() \n{\n    _this.vgrid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.vpanel.active) {\n       this.footer.onClick('first');\n    }\n}",
-                                        "|rowdblclick": "function (_self, rowIndex, e)\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {\n        _this.grid.footer.onClick('first');\n    }); \n}\n"
+                                        "|rowdblclick": "function (_self, rowIndex, e)\n{\n    var rec = this.ds.getAt(rowIndex);\n    new Pman.Download({\n        url : baseURL + '/Roo/Report/' + rec.data.report_name +'-' + rec.data.report_id + '.rpt',\n        method : 'GET',\n        params : {\n            _id : rec.data.report_id,\n            _download : 1\n        }\n    });\n    Roo.MessageBox.alert(\"Downloading\",\n    \n       \"Report template is downloading - use \" +\n           '<a target=\"_new\" href=\"http://sourceforge.net/projects/openrpt/files/openrpt/\">' + \n           \"report writer to edit this\" + \n           '</a>'\n       );\n           \n    \n    \n}"
                                     },
                                     "*prop": "grid",
-                                    "autoExpandColumn": "report_name",
+                                    "autoExpandColumn": "Report loaddate",
                                     "loadMask": true,
                                     "xtype": "Grid",
                                     "|xns": "Roo.grid",
                                     "items": [
                                         {
                                             "listeners": {
-                                                "beforeload": "function (_self, options)\n{\n    if (!_this.grid) {\n        return false;\n    } \n    var sel  = _this.grid.selModel.getSelected()\n    if (!sel) {\n        this.removeAll();\n        return false;\n    }\n    options.params.report_name = sel.data.report_name;\n    \n    \n}"
+                                                "beforeload": "function (_self, options)\n{\n    if (!_this.grid) {\n        return false;\n    } \n    var sel  = _this.grid.selModel.getSelected();\n    if (!sel) {\n        this.removeAll();\n        return false;\n    }\n    options.params.report_name = sel.data.report_name;\n    \n    \n}"
                                             },
                                             "*prop": "dataSource",
                                             "remoteSort": true,
                                             "|xns": "Roo"
                                         },
                                         {
-                                            "xtype": "ColumnModel",
-                                            "header": "Report grade",
-                                            "width": 75,
+                                            "*prop": "colModel[]",
                                             "dataIndex": "report_grade",
+                                            "header": "Version",
+                                            "width": 20,
+                                            "xtype": "ColumnModel",
                                             "|renderer": "function(v) { return String.format('{0}', v); }",
-                                            "|xns": "Roo.grid",
-                                            "*prop": "colModel[]"
+                                            "|xns": "Roo.grid"
                                         },
                                         {
-                                            "xtype": "ColumnModel",
-                                            "header": "Report loaddate",
-                                            "width": 75,
+                                            "*prop": "colModel[]",
                                             "dataIndex": "report_loaddate",
-                                            "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
-                                            "|xns": "Roo.grid",
-                                            "*prop": "colModel[]"
+                                            "header": "Created",
+                                            "width": 200,
+                                            "xtype": "ColumnModel",
+                                            "|renderer": "function(v,x,r) { \n    var vv =   Date.parseDate(r.json.report_loaddate.split('.')[0], 'Y-m-d H:i:s').format('d/M/Y h:ia');\n    return String.format('{0}', vv); \n\n    }",
+                                            "|xns": "Roo.grid"
                                         }
                                     ]
                                 }