Pman.Tab.XtupleReports.bjs
[Pman.Xtuple] / Pman.Tab.XtupleReports.bjs
1 {
2     "id": "roo-file-527",
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 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                                         },
139                                         {
140                                             "xtype": "ColumnModel",
141                                             "header": "Report name",
142                                             "width": 200,
143                                             "dataIndex": "report_name",
144                                             "|renderer": "function(v) { return String.format('{0}', v); }",
145                                             "|xns": "Roo.grid",
146                                             "*prop": "colModel[]"
147                                         },
148                                         {
149                                             "xtype": "ColumnModel",
150                                             "header": "Report descrip",
151                                             "width": 200,
152                                             "dataIndex": "report_descrip",
153                                             "|renderer": "function(v) { return String.format('{0}', v); }",
154                                             "|xns": "Roo.grid",
155                                             "*prop": "colModel[]"
156                                         }
157                                     ]
158                                 }
159                             ]
160                         },
161                         {
162                             "listeners": {
163                                 "|activate": "function() {\n    _this.vpanel = this;\n    if (_this.vgrid) {\n        _this.vgrid.footer.onClick('first');\n    }\n}"
164                             },
165                             "background": false,
166                             "fitContainer": true,
167                             "fitToframe": true,
168                             "region": "east",
169                             "tableName": "report",
170                             "title": "report",
171                             "xtype": "GridPanel",
172                             "|xns": "Roo",
173                             "items": [
174                                 {
175                                     "listeners": {
176                                         "|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}",
177                                         "|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"
178                                     },
179                                     "*prop": "grid",
180                                     "autoExpandColumn": "report_name",
181                                     "loadMask": true,
182                                     "xtype": "Grid",
183                                     "|xns": "Roo.grid",
184                                     "items": [
185                                         {
186                                             "listeners": {
187                                                 "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}"
188                                             },
189                                             "*prop": "dataSource",
190                                             "remoteSort": true,
191                                             "xtype": "Store",
192                                             "|sortInfo": "{ field : 'report_grade', direction: 'DESC' }",
193                                             "|xns": "Roo.data",
194                                             "items": [
195                                                 {
196                                                     "*prop": "proxy",
197                                                     "xtype": "HttpProxy",
198                                                     "method": "GET",
199                                                     "|url": "baseURL + '/Roo/report.php'",
200                                                     "|xns": "Roo.data"
201                                                 },
202                                                 {
203                                                     "|xns": "Roo.data",
204                                                     "xtype": "JsonReader",
205                                                     "totalProperty": "total",
206                                                     "root": "data",
207                                                     "*prop": "reader",
208                                                     "id": "id",
209                                                     "|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]"
210                                                 }
211                                             ]
212                                         },
213                                         {
214                                             "*prop": "footer",
215                                             "xtype": "PagingToolbar",
216                                             "pageSize": 25,
217                                             "displayInfo": true,
218                                             "displayMsg": "Displaying report{0} - {1} of {2}",
219                                             "emptyMsg": "No report found",
220                                             "|xns": "Roo"
221                                         },
222                                         {
223                                             "xtype": "ColumnModel",
224                                             "header": "Report grade",
225                                             "width": 75,
226                                             "dataIndex": "report_grade",
227                                             "|renderer": "function(v) { return String.format('{0}', v); }",
228                                             "|xns": "Roo.grid",
229                                             "*prop": "colModel[]"
230                                         },
231                                         {
232                                             "xtype": "ColumnModel",
233                                             "header": "Report loaddate",
234                                             "width": 75,
235                                             "dataIndex": "report_loaddate",
236                                             "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
237                                             "|xns": "Roo.grid",
238                                             "*prop": "colModel[]"
239                                         }
240                                     ]
241                                 }
242                             ]
243                         }
244                     ]
245                 }
246             ]
247         }
248     ],
249     "permname": "",
250     "modOrder": "500"
251 }