Pman.Tab.XtupleReports.bjs
[Pman.Xtuple] / Pman.Tab.XtupleReports.js
1 //<script type="text/javascript">
2
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
4
5 Pman.Tab.XtupleReports = new Roo.XComponent({
6     part     :  ["Xtuple","Reports"],
7     order    : '500-Pman.Tab.XtupleReports',
8     region   : 'center',
9     parent   : 'Pman.Tab.Admin',
10     name     : "unnamed module",
11     disabled : false, 
12     permname : '', 
13     _tree : function()
14     {
15         var _this = this;
16         var MODULE = this;
17         return {
18             xtype: 'NestedLayoutPanel',
19             xns: Roo,
20             title : "Reports",
21             layout : {
22                 xtype: 'BorderLayout',
23                 xns: Roo,
24                 items : [
25                     {
26                         xtype: 'GridPanel',
27                         xns: Roo,
28                         title : "report",
29                         fitToframe : true,
30                         fitContainer : true,
31                         tableName : 'report',
32                         background : true,
33                         region : 'center',
34                         listeners : {
35                             activate : function() {
36                                 _this.panel = this;
37                                 if (_this.grid) {
38                                     _this.grid.footer.onClick('first');
39                                 }
40                             }
41                         },
42                         grid : {
43                             xtype: 'Grid',
44                             xns: Roo.grid,
45                             listeners : {
46                                 render : function() 
47                                 {
48                                     _this.grid = this; 
49                                     //_this.dialog = Pman.Dialog.FILL_IN
50                                     if (_this.panel.active) {
51                                        this.footer.onClick('first');
52                                     }
53                                 },
54                                 rowdblclick : function (_self, rowIndex, e)
55                                 {
56                                     if (!_this.dialog) return;
57                                     _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
58                                         _this.grid.footer.onClick('first');
59                                     }); 
60                                 }
61                             },
62                             autoExpandColumn : 'report_descrip',
63                             loadMask : true,
64                             dataSource : {
65                                 xtype: 'Store',
66                                 xns: Roo.data,
67                                 remoteSort : true,
68                                 sortInfo : { field : 'report_name', direction: 'ASC' },
69                                 proxy : {
70                                     xtype: 'HttpProxy',
71                                     xns: Roo.data,
72                                     method : 'GET',
73                                     url : baseURL + '/Roo/report.php'
74                                 },
75                                 reader : {
76                                     xtype: 'JsonReader',
77                                     xns: Roo.data,
78                                     totalProperty : 'total',
79                                     root : 'data',
80                                     id : 'id',
81                                     fields : [
82                                         {
83                                             'name': 'report_id',
84                                             'type': 'int'
85                                         },
86                                         {
87                                             'name': 'report_name',
88                                             'type': 'string'
89                                         },
90                                         {
91                                             'name': 'report_sys',
92                                             'type': 'int'
93                                         },
94                                         {
95                                             'name': 'report_source',
96                                             'type': 'string'
97                                         },
98                                         {
99                                             'name': 'report_descrip',
100                                             'type': 'string'
101                                         },
102                                         {
103                                             'name': 'report_grade',
104                                             'type': 'int'
105                                         },
106                                         {
107                                             'name': 'report_loaddate',
108                                             'type': 'date',
109                                             'dateFormat': 'Y-m-d'
110                                         }
111                                     ]
112                                 }
113                             },
114                             footer : {
115                                 xtype: 'PagingToolbar',
116                                 xns: Roo,
117                                 pageSize : 25,
118                                 displayInfo : true,
119                                 displayMsg : "Displaying report{0} - {1} of {2}",
120                                 emptyMsg : "No report found"
121                             },
122                             toolbar : {
123                                 xtype: 'Toolbar',
124                                 xns: Roo,
125                                 items : [
126                                     {
127                                         xtype: 'TextField',
128                                         xns: Roo.form
129                                     },
130                                     {
131                                         xtype: 'Button',
132                                         xns: Roo.Toolbar,
133                                         listeners : {
134                                             click : function (_self, e)
135                                             {
136                                             _this.grid.footer.onClick('first');
137                                             }
138                                         },
139                                         cls : 'x-btn-icon',
140                                         icon : rootURL + '/Pman/templates/images/search.gif'
141                                     },
142                                     {
143                                         xtype: 'Button',
144                                         xns: Roo.Toolbar,
145                                         listeners : {
146                                             click : function (_self, e)
147                                             {
148                                                 _this.searchBox.setValue('');
149                                                 _this.publication_name_combo.setValue('');
150                                                 _this.publication_lang_combo.setValue('');
151                                                 _this.country_combo.setValue('');
152                                                 _this.category_media_id_combo.setValue('');
153                                                 _this.role_combo.setValue('');      
154                                             
155                                                 
156                                                 _this.grid.footer.onClick('first');
157                                             }
158                                         },
159                                         cls : 'x-btn-icon',
160                                         icon : rootURL + '/Pman/templates/images/edit-clear.gif'
161                                     },
162                                     {
163                                         xtype: 'Fill',
164                                         xns: Roo.Toolbar
165                                     },
166                                     {
167                                         xtype: 'Button',
168                                         xns: Roo.Toolbar,
169                                         text : "Add",
170                                         cls : 'x-btn-text-icon',
171                                         icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
172                                         listeners : {
173                                             click : function()
174                                             {
175                                                 if (!_this.dialog) return;
176                                                 _this.dialog.show( { id : 0 } , function() {
177                                                     _this.grid.footer.onClick('first');
178                                                }); 
179                                             }
180                                         }
181                                     }
182                                 ]
183                             },
184                             colModel : [
185                                 {
186                                     xtype: 'ColumnModel',
187                                     xns: Roo.grid,
188                                     header : 'Report name',
189                                     width : 200,
190                                     dataIndex : 'report_name',
191                                     renderer : function(v) { return String.format('{0}', v); }
192                                 },
193                                 {
194                                     xtype: 'ColumnModel',
195                                     xns: Roo.grid,
196                                     header : 'Report descrip',
197                                     width : 200,
198                                     dataIndex : 'report_descrip',
199                                     renderer : function(v) { return String.format('{0}', v); }
200                                 }
201                             ]
202                         }
203                     },
204                     {
205                         xtype: 'GridPanel',
206                         xns: Roo,
207                         title : "report",
208                         fitToframe : true,
209                         fitContainer : true,
210                         tableName : 'report',
211                         background : true,
212                         region : 'center',
213                         listeners : {
214                             activate : function() {
215                                 _this.panel = this;
216                                 if (_this.grid) {
217                                     _this.grid.footer.onClick('first');
218                                 }
219                             }
220                         },
221                         grid : {
222                             xtype: 'Grid',
223                             xns: Roo.grid,
224                             autoExpandColumn : 'report_name',
225                             loadMask : true,
226                             listeners : {
227                                 render : function() 
228                                 {
229                                     _this.grid = this; 
230                                     //_this.dialog = Pman.Dialog.FILL_IN
231                                     if (_this.panel.active) {
232                                        this.footer.onClick('first');
233                                     }
234                                 },
235                                 rowdblclick : function (_self, rowIndex, e)
236                                 {
237                                     if (!_this.dialog) return;
238                                     _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
239                                         _this.grid.footer.onClick('first');
240                                     }); 
241                                 }
242                             },
243                             dataSource : {
244                                 xtype: 'Store',
245                                 xns: Roo.data,
246                                 remoteSort : true,
247                                 sortInfo : { field : 'report_name', direction: 'ASC' },
248                                 proxy : {
249                                     xtype: 'HttpProxy',
250                                     xns: Roo.data,
251                                     method : 'GET',
252                                     url : baseURL + '/Roo/report.php'
253                                 },
254                                 reader : {
255                                     xtype: 'JsonReader',
256                                     xns: Roo.data,
257                                     totalProperty : 'total',
258                                     root : 'data',
259                                     id : 'id',
260                                     fields : [
261                                         {
262                                             'name': 'report_id',
263                                             'type': 'int'
264                                         },
265                                         {
266                                             'name': 'report_name',
267                                             'type': 'string'
268                                         },
269                                         {
270                                             'name': 'report_sys',
271                                             'type': 'int'
272                                         },
273                                         {
274                                             'name': 'report_source',
275                                             'type': 'string'
276                                         },
277                                         {
278                                             'name': 'report_descrip',
279                                             'type': 'string'
280                                         },
281                                         {
282                                             'name': 'report_grade',
283                                             'type': 'int'
284                                         },
285                                         {
286                                             'name': 'report_loaddate',
287                                             'type': 'date',
288                                             'dateFormat': 'Y-m-d'
289                                         }
290                                     ]
291                                 }
292                             },
293                             footer : {
294                                 xtype: 'PagingToolbar',
295                                 xns: Roo,
296                                 pageSize : 25,
297                                 displayInfo : true,
298                                 displayMsg : "Displaying report{0} - {1} of {2}",
299                                 emptyMsg : "No report found"
300                             },
301                             colModel : [
302                                 {
303                                     xtype: 'ColumnModel',
304                                     xns: Roo.grid,
305                                     header : 'Report grade',
306                                     width : 75,
307                                     dataIndex : 'report_grade',
308                                     renderer : function(v) { return String.format('{0}', v); }
309                                 },
310                                 {
311                                     xtype: 'ColumnModel',
312                                     xns: Roo.grid,
313                                     header : 'Report loaddate',
314                                     width : 75,
315                                     dataIndex : 'report_loaddate',
316                                     renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }
317                                 }
318                             ]
319                         }
320                     }
321                 ],
322                 center : {
323                     xtype: 'LayoutRegion',
324                     xns: Roo
325                 },
326                 east : {
327                     xtype: 'LayoutRegion',
328                     xns: Roo,
329                     title : "Versions",
330                     titlebar : true,
331                     width : 150
332                 }
333             }
334         };
335     }
336 });