Pman.Dialog.AdminEventLog.bjs
[Pman.Admin] / Pman.Dialog.AdminEventLog.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.Dialog.AdminEventLog = {
6
7     dialog : false,
8     callback:  false,
9
10     show : function(data, cb)
11     {
12         if (!this.dialog) {
13             this.create();
14         }
15
16         this.callback = cb;
17         this.data = data;
18         this.dialog.show(this.data._el);
19         if (this.form) {
20            this.form.reset();
21            this.form.setValues(data);
22            this.form.fireEvent('actioncomplete', this.form,  { type: 'setdata', data: data });
23         }
24
25     },
26
27     create : function()
28     {
29         var _this = this;
30         this.dialog = Roo.factory({
31             xtype: 'LayoutDialog',
32             xns: Roo,
33             height : 800,
34             width : 500,
35             items : [
36                 {
37                     xtype: 'GridPanel',
38                     xns: Roo,
39                     listeners : {
40                         activate : function() {
41                             _this.panel = this;
42                             if (_this.grid) {
43                                 _this.grid.footer.onClick('first');
44                             }
45                         }
46                     },
47                     background : false,
48                     fitContainer : true,
49                     fitToframe : true,
50                     region : 'center',
51                     tableName : 'Events',
52                     title : "Events",
53                     grid : {
54                         xtype: 'Grid',
55                         xns: Roo.grid,
56                         listeners : {
57                             render : function() 
58                             {
59                                 _this.grid = this; 
60                                 //_this.dialog = Pman.Dialog.FILL_IN
61                                 if (_this.panel.active) {
62                                    this.footer.onClick('first');
63                                 }
64                             },
65                             rowdblclick : function (_self, rowIndex, e)
66                             {
67                                 if (!_this.dialog) return;
68                                 _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
69                                     _this.grid.footer.onClick('first');
70                                 }); 
71                             }
72                         },
73                         autoExpandColumn : 'remarks',
74                         loadMask : true,
75                         dataSource : {
76                             xtype: 'Store',
77                             xns: Roo.data,
78                             listeners : {
79                                 beforeload : function (_self,o )
80                                 {
81                                     o.params.on_table = _this.data.on_table;
82                                     o.params.on_id = _this.data.on_id;
83                                 }
84                             },
85                             remoteSort : true,
86                             sortInfo : { field : 'person_name', direction: 'ASC' },
87                             proxy : {
88                                 xtype: 'HttpProxy',
89                                 xns: Roo.data,
90                                 method : 'GET',
91                                 url : baseURL + '/Roo/Events.php'
92                             },
93                             reader : {
94                                 xtype: 'JsonReader',
95                                 xns: Roo.data,
96                                 totalProperty : 'total',
97                                 root : 'data',
98                                 id : 'id',
99                                 fields : [
100                                     {
101                                         'name': 'id',
102                                         'type': 'int'
103                                     },
104                                     {
105                                         'name': 'person_name',
106                                         'type': 'string'
107                                     },
108                                     {
109                                         'name': 'event_when',
110                                         'type': 'date',
111                                         'dateFormat': 'Y-m-d'
112                                     },
113                                     {
114                                         'name': 'action',
115                                         'type': 'string'
116                                     },
117                                     {
118                                         'name': 'ipaddr',
119                                         'type': 'string'
120                                     },
121                                     {
122                                         'name': 'on_id',
123                                         'type': 'int'
124                                     },
125                                     {
126                                         'name': 'on_table',
127                                         'type': 'string'
128                                     },
129                                     {
130                                         'name': 'person_id',
131                                         'type': 'int'
132                                     },
133                                     {
134                                         'name': 'remarks',
135                                         'type': 'string'
136                                     },
137                                     {
138                                         'name': 'person_table',
139                                         'type': 'string'
140                                     },
141                                     {
142                                         'name': 'person_id_id',
143                                         'type': 'int'
144                                     },
145                                     {
146                                         'name': 'person_id_office_id',
147                                         'type': 'int'
148                                     },
149                                     {
150                                         'name': 'person_id_name',
151                                         'type': 'string'
152                                     },
153                                     {
154                                         'name': 'person_id_phone',
155                                         'type': 'string'
156                                     },
157                                     {
158                                         'name': 'person_id_fax',
159                                         'type': 'string'
160                                     },
161                                     {
162                                         'name': 'person_id_email',
163                                         'type': 'string'
164                                     },
165                                     {
166                                         'name': 'person_id_company_id',
167                                         'type': 'int'
168                                     },
169                                     {
170                                         'name': 'person_id_role',
171                                         'type': 'string'
172                                     },
173                                     {
174                                         'name': 'person_id_active',
175                                         'type': 'int'
176                                     },
177                                     {
178                                         'name': 'person_id_remarks',
179                                         'type': 'string'
180                                     },
181                                     {
182                                         'name': 'person_id_passwd',
183                                         'type': 'string'
184                                     },
185                                     {
186                                         'name': 'person_id_owner_id',
187                                         'type': 'int'
188                                     },
189                                     {
190                                         'name': 'person_id_lang',
191                                         'type': 'string'
192                                     },
193                                     {
194                                         'name': 'person_id_no_reset_sent',
195                                         'type': 'int'
196                                     },
197                                     {
198                                         'name': 'person_id_action_type',
199                                         'type': 'string'
200                                     },
201                                     {
202                                         'name': 'person_id_project_id',
203                                         'type': 'int'
204                                     },
205                                     {
206                                         'name': 'person_id_deleted_by',
207                                         'type': 'int'
208                                     },
209                                     {
210                                         'name': 'person_id_deleted_dt',
211                                         'type': 'date'
212                                     },
213                                     {
214                                         'name': 'person_id_firstname',
215                                         'type': 'string'
216                                     },
217                                     {
218                                         'name': 'person_id_lastname',
219                                         'type': 'string'
220                                     }
221                                 ]
222                             }
223                         },
224                         footer : {
225                             xtype: 'PagingToolbar',
226                             xns: Roo,
227                             pageSize : 25,
228                             displayInfo : true,
229                             displayMsg : "Displaying Events{0} - {1} of {2}",
230                             emptyMsg : "No Events found"
231                         },
232                         colModel : [
233                             {
234                                 xtype: 'ColumnModel',
235                                 xns: Roo.grid,
236                                 header : 'Event when',
237                                 width : 75,
238                                 dataIndex : 'event_when',
239                                 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }
240                             },
241                             {
242                                 xtype: 'ColumnModel',
243                                 xns: Roo.grid,
244                                 dataIndex : 'person_id_name',
245                                 header : 'Person name',
246                                 width : 100,
247                                 renderer : function(v) { return String.format('{0}', v); }
248                             },
249                             {
250                                 xtype: 'ColumnModel',
251                                 xns: Roo.grid,
252                                 dataIndex : 'action',
253                                 header : 'Action',
254                                 width : 80,
255                                 renderer : function(v) { return String.format('{0}', v); }
256                             },
257                             {
258                                 xtype: 'ColumnModel',
259                                 xns: Roo.grid,
260                                 dataIndex : 'ipaddr',
261                                 header : 'Ipaddr',
262                                 width : 80,
263                                 renderer : function(v) { return String.format('{0}', v); }
264                             },
265                             {
266                                 xtype: 'ColumnModel',
267                                 xns: Roo.grid,
268                                 header : 'Remarks',
269                                 width : 200,
270                                 dataIndex : 'remarks',
271                                 renderer : function(v) { return String.format('{0}', v); }
272                             }
273                         ]
274                     }
275                 }
276             ],
277             center : {
278                 xtype: 'LayoutRegion',
279                 xns: Roo
280             }
281         });
282     }
283 };