Fix #7123 - getting abra ready to test
[Pman.Xtuple] / Pman.Tab.XtupleReports.bjs
1 {
2     "id": "roo-file-384",
3     "name": "Pman.Tab.XtupleReports",
4     "parent": "Pman.Tab.Admin",
5     "title": "",
6     "path": "/home/alan/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtupleReports.bjs",
7     "items": [
8         {
9             "title": "Reports",
10             "xtype": "NestedLayoutPanel",
11             "|xns": "Roo",
12             "items": [
13                 {
14                     "|xns": "Roo",
15                     "xtype": "BorderLayout",
16                     "*prop": "layout",
17                     "items": [
18                         {
19                             "|xns": "Roo",
20                             "xtype": "LayoutRegion",
21                             "*prop": "center"
22                         },
23                         {
24                             "*prop": "east",
25                             "split": true,
26                             "title": "Versions",
27                             "titlebar": true,
28                             "width": 200,
29                             "xtype": "LayoutRegion",
30                             "|xns": "Roo"
31                         },
32                         {
33                             "|xns": "Roo",
34                             "xtype": "GridPanel",
35                             "title": "report",
36                             "fitToframe": true,
37                             "fitContainer": true,
38                             "tableName": "report",
39                             "background": true,
40                             "region": "center",
41                             "listeners": {
42                                 "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
43                             },
44                             "items": [
45                                 {
46                                     "listeners": {
47                                         "|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}",
48                                         "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}"
49                                     },
50                                     "*prop": "grid",
51                                     "autoExpandColumn": "report_descrip",
52                                     "loadMask": true,
53                                     "xtype": "Grid",
54                                     "|xns": "Roo.grid",
55                                     "items": [
56                                         {
57                                             "listeners": {
58                                                 "beforeload": "function (_self, options)\n{\n    options.params['search[name]'] = _this.searchName.getValue();\n    options.params._max_versions = 1;\n}"
59                                             },
60                                             "*prop": "dataSource",
61                                             "remoteSort": true,
62                                             "xtype": "Store",
63                                             "|sortInfo": "{ field : 'report_name', direction: 'ASC' }",
64                                             "|xns": "Roo.data",
65                                             "items": [
66                                                 {
67                                                     "*prop": "proxy",
68                                                     "xtype": "HttpProxy",
69                                                     "method": "GET",
70                                                     "|url": "baseURL + '/Roo/report.php'",
71                                                     "|xns": "Roo.data"
72                                                 },
73                                                 {
74                                                     "|xns": "Roo.data",
75                                                     "xtype": "JsonReader",
76                                                     "totalProperty": "total",
77                                                     "root": "data",
78                                                     "*prop": "reader",
79                                                     "id": "id",
80                                                     "|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]"
81                                                 }
82                                             ]
83                                         },
84                                         {
85                                             "listeners": {
86                                                 "afterselectionchange": "function (_self)\n{\n    _this.vgrid.footer.onClick('first');\n}"
87                                             },
88                                             "*prop": "sm",
89                                             "singleSelect": true,
90                                             "xtype": "RowSelectionModel",
91                                             "|xns": "Roo.grid"
92                                         },
93                                         {
94                                             "*prop": "footer",
95                                             "xtype": "PagingToolbar",
96                                             "pageSize": 25,
97                                             "displayInfo": true,
98                                             "displayMsg": "Displaying report{0} - {1} of {2}",
99                                             "emptyMsg": "No report found",
100                                             "|xns": "Roo"
101                                         },
102                                         {
103                                             "*prop": "toolbar",
104                                             "xtype": "Toolbar",
105                                             "|xns": "Roo",
106                                             "items": [
107                                                 {
108                                                     "listeners": {
109                                                         "render": "function (_self)\n{\n    _this.searchName = _self;\n}",
110                                                         "specialkey": "function (_self, e)\n{\n    _this.grid.footer.onClick('first');\n}"
111                                                     },
112                                                     "xtype": "TextField",
113                                                     "|xns": "Roo.form"
114                                                 },
115                                                 {
116                                                     "listeners": {
117                                                         "|click": "function (_self, e)\n{\n_this.grid.footer.onClick('first');\n}"
118                                                     },
119                                                     "cls": "x-btn-icon",
120                                                     "xtype": "Button",
121                                                     "|icon": "rootURL + '/Pman/templates/images/search.gif'",
122                                                     "|xns": "Roo.Toolbar"
123                                                 },
124                                                 {
125                                                     "listeners": {
126                                                         "|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}"
127                                                     },
128                                                     "cls": "x-btn-icon",
129                                                     "xtype": "Button",
130                                                     "|icon": "rootURL + '/Pman/templates/images/edit-clear.gif'",
131                                                     "|xns": "Roo.Toolbar"
132                                                 },
133                                                 {
134                                                     "|xns": "Roo.Toolbar",
135                                                     "xtype": "Fill"
136                                                 },
137                                                 {
138                                                     "listeners": {
139                                                         "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}"
140                                                     },
141                                                     "text": "Upload New version",
142                                                     "xtype": "Button",
143                                                     "|xns": "Roo.Toolbar"
144                                                 }
145                                             ]
146                                         },
147                                         {
148                                             "xtype": "ColumnModel",
149                                             "header": "Report name",
150                                             "width": 200,
151                                             "dataIndex": "report_name",
152                                             "|renderer": "function(v) { return String.format('{0}', v); }",
153                                             "|xns": "Roo.grid",
154                                             "*prop": "colModel[]"
155                                         },
156                                         {
157                                             "xtype": "ColumnModel",
158                                             "header": "Report descrip",
159                                             "width": 200,
160                                             "dataIndex": "report_descrip",
161                                             "|renderer": "function(v) { return String.format('{0}', v); }",
162                                             "|xns": "Roo.grid",
163                                             "*prop": "colModel[]"
164                                         }
165                                     ]
166                                 }
167                             ]
168                         },
169                         {
170                             "listeners": {
171                                 "|activate": "function() {\n    _this.vpanel = this;\n    if (_this.vgrid) {\n        _this.vgrid.footer.onClick('first');\n    }\n}"
172                             },
173                             "background": false,
174                             "fitContainer": true,
175                             "fitToframe": true,
176                             "region": "east",
177                             "tableName": "report",
178                             "title": "report",
179                             "xtype": "GridPanel",
180                             "|xns": "Roo",
181                             "items": [
182                                 {
183                                     "listeners": {
184                                         "|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}",
185                                         "|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}"
186                                     },
187                                     "*prop": "grid",
188                                     "autoExpandColumn": "Report loaddate",
189                                     "loadMask": true,
190                                     "xtype": "Grid",
191                                     "|xns": "Roo.grid",
192                                     "items": [
193                                         {
194                                             "listeners": {
195                                                 "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}"
196                                             },
197                                             "*prop": "dataSource",
198                                             "remoteSort": true,
199                                             "xtype": "Store",
200                                             "|sortInfo": "{ field : 'report_grade', direction: 'DESC' }",
201                                             "|xns": "Roo.data",
202                                             "items": [
203                                                 {
204                                                     "*prop": "proxy",
205                                                     "xtype": "HttpProxy",
206                                                     "method": "GET",
207                                                     "|url": "baseURL + '/Roo/report.php'",
208                                                     "|xns": "Roo.data"
209                                                 },
210                                                 {
211                                                     "|xns": "Roo.data",
212                                                     "xtype": "JsonReader",
213                                                     "totalProperty": "total",
214                                                     "root": "data",
215                                                     "*prop": "reader",
216                                                     "id": "id",
217                                                     "|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]"
218                                                 }
219                                             ]
220                                         },
221                                         {
222                                             "*prop": "footer",
223                                             "xtype": "PagingToolbar",
224                                             "pageSize": 25,
225                                             "displayInfo": true,
226                                             "displayMsg": "Displaying report{0} - {1} of {2}",
227                                             "emptyMsg": "No report found",
228                                             "|xns": "Roo"
229                                         },
230                                         {
231                                             "*prop": "colModel[]",
232                                             "dataIndex": "report_grade",
233                                             "header": "Version",
234                                             "width": 20,
235                                             "xtype": "ColumnModel",
236                                             "|renderer": "function(v) { return String.format('{0}', v); }",
237                                             "|xns": "Roo.grid"
238                                         },
239                                         {
240                                             "*prop": "colModel[]",
241                                             "dataIndex": "report_loaddate",
242                                             "header": "Created",
243                                             "width": 200,
244                                             "xtype": "ColumnModel",
245                                             "|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    }",
246                                             "|xns": "Roo.grid"
247                                         }
248                                     ]
249                                 }
250                             ]
251                         }
252                     ]
253                 }
254             ]
255         }
256     ],
257     "permname": "",
258     "modOrder": "500"
259 }