{ "id": "roo-file-384", "name": "Pman.Tab.XtupleReports", "parent": "Pman.Tab.Admin", "title": "", "path": "/home/alan/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtupleReports.bjs", "items": [ { "title": "Reports", "xtype": "NestedLayoutPanel", "|xns": "Roo", "items": [ { "|xns": "Roo", "xtype": "BorderLayout", "*prop": "layout", "items": [ { "|xns": "Roo", "xtype": "LayoutRegion", "*prop": "center" }, { "*prop": "east", "split": true, "title": "Versions", "titlebar": true, "width": 200, "xtype": "LayoutRegion", "|xns": "Roo" }, { "|xns": "Roo", "xtype": "GridPanel", "title": "report", "fitToframe": true, "fitContainer": true, "tableName": "report", "background": true, "region": "center", "listeners": { "|activate": "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}" }, "items": [ { "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 '' + \n \"report writer to edit this\" + \n ''\n );\n \n \n \n}" }, "*prop": "grid", "autoExpandColumn": "report_descrip", "loadMask": true, "xtype": "Grid", "|xns": "Roo.grid", "items": [ { "listeners": { "beforeload": "function (_self, options)\n{\n options.params['search[name]'] = _this.searchName.getValue();\n options.params._max_versions = 1;\n}" }, "*prop": "dataSource", "remoteSort": true, "xtype": "Store", "|sortInfo": "{ field : 'report_name', direction: 'ASC' }", "|xns": "Roo.data", "items": [ { "*prop": "proxy", "xtype": "HttpProxy", "method": "GET", "|url": "baseURL + '/Roo/report.php'", "|xns": "Roo.data" }, { "|xns": "Roo.data", "xtype": "JsonReader", "totalProperty": "total", "root": "data", "*prop": "reader", "id": "id", "|fields": "[\n {\n 'name': 'report_id',\n 'type': 'int'\n },\n {\n 'name': 'report_name',\n 'type': 'string'\n },\n {\n 'name': 'report_sys',\n 'type': 'int'\n },\n {\n 'name': 'report_source',\n 'type': 'string'\n },\n {\n 'name': 'report_descrip',\n 'type': 'string'\n },\n {\n 'name': 'report_grade',\n 'type': 'int'\n },\n {\n 'name': 'report_loaddate',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n }\n]" } ] }, { "listeners": { "afterselectionchange": "function (_self)\n{\n _this.vgrid.footer.onClick('first');\n}" }, "*prop": "sm", "singleSelect": true, "xtype": "RowSelectionModel", "|xns": "Roo.grid" }, { "*prop": "footer", "xtype": "PagingToolbar", "pageSize": 25, "displayInfo": true, "displayMsg": "Displaying report{0} - {1} of {2}", "emptyMsg": "No report found", "|xns": "Roo" }, { "*prop": "toolbar", "xtype": "Toolbar", "|xns": "Roo", "items": [ { "listeners": { "render": "function (_self)\n{\n _this.searchName = _self;\n}", "specialkey": "function (_self, e)\n{\n _this.grid.footer.onClick('first');\n}" }, "xtype": "TextField", "|xns": "Roo.form" }, { "listeners": { "|click": "function (_self, e)\n{\n_this.grid.footer.onClick('first');\n}" }, "cls": "x-btn-icon", "xtype": "Button", "|icon": "rootURL + '/Pman/templates/images/search.gif'", "|xns": "Roo.Toolbar" }, { "listeners": { "|click": "function (_self, e)\n{\n _this.searchBox.setValue('');\n _this.publication_name_combo.setValue('');\n _this.publication_lang_combo.setValue('');\n _this.country_combo.setValue('');\n _this.category_media_id_combo.setValue('');\n _this.role_combo.setValue(''); \n\n \n _this.grid.footer.onClick('first');\n}" }, "cls": "x-btn-icon", "xtype": "Button", "|icon": "rootURL + '/Pman/templates/images/edit-clear.gif'", "|xns": "Roo.Toolbar" }, { "|xns": "Roo.Toolbar", "xtype": "Fill" }, { "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" } ] }, { "xtype": "ColumnModel", "header": "Report name", "width": 200, "dataIndex": "report_name", "|renderer": "function(v) { return String.format('{0}', v); }", "|xns": "Roo.grid", "*prop": "colModel[]" }, { "xtype": "ColumnModel", "header": "Report descrip", "width": 200, "dataIndex": "report_descrip", "|renderer": "function(v) { return String.format('{0}', v); }", "|xns": "Roo.grid", "*prop": "colModel[]" } ] } ] }, { "listeners": { "|activate": "function() {\n _this.vpanel = this;\n if (_this.vgrid) {\n _this.vgrid.footer.onClick('first');\n }\n}" }, "background": false, "fitContainer": true, "fitToframe": true, "region": "east", "tableName": "report", "title": "report", "xtype": "GridPanel", "|xns": "Roo", "items": [ { "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 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 '' + \n \"report writer to edit this\" + \n ''\n );\n \n \n \n}" }, "*prop": "grid", "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}" }, "*prop": "dataSource", "remoteSort": true, "xtype": "Store", "|sortInfo": "{ field : 'report_grade', direction: 'DESC' }", "|xns": "Roo.data", "items": [ { "*prop": "proxy", "xtype": "HttpProxy", "method": "GET", "|url": "baseURL + '/Roo/report.php'", "|xns": "Roo.data" }, { "|xns": "Roo.data", "xtype": "JsonReader", "totalProperty": "total", "root": "data", "*prop": "reader", "id": "id", "|fields": "[\n {\n 'name': 'report_id',\n 'type': 'int'\n },\n {\n 'name': 'report_name',\n 'type': 'string'\n },\n {\n 'name': 'report_sys',\n 'type': 'int'\n },\n {\n 'name': 'report_source',\n 'type': 'string'\n },\n {\n 'name': 'report_descrip',\n 'type': 'string'\n },\n {\n 'name': 'report_grade',\n 'type': 'int'\n },\n {\n 'name': 'report_loaddate',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n }\n]" } ] }, { "*prop": "footer", "xtype": "PagingToolbar", "pageSize": 25, "displayInfo": true, "displayMsg": "Displaying report{0} - {1} of {2}", "emptyMsg": "No report found", "|xns": "Roo" }, { "*prop": "colModel[]", "dataIndex": "report_grade", "header": "Version", "width": 20, "xtype": "ColumnModel", "|renderer": "function(v) { return String.format('{0}', v); }", "|xns": "Roo.grid" }, { "*prop": "colModel[]", "dataIndex": "report_loaddate", "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" } ] } ] } ] } ] } ], "permname": "", "modOrder": "500" }