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                                     if (!_this.data || !_this.data.on_id) {
82                                         return false;
83                                     }
84                                     o.params.on_table = _this.data.on_table;
85                                     o.params.on_id = _this.data.on_id;
86                                 }
87                             },
88                             remoteSort : true,
89                             sortInfo : { field : 'person_name', direction: 'ASC' },
90                             proxy : {
91                                 xtype: 'HttpProxy',
92                                 xns: Roo.data,
93                                 method : 'GET',
94                                 url : baseURL + '/Roo/Events.php'
95                             },
96                             reader : {
97                                 xtype: 'JsonReader',
98                                 xns: Roo.data,
99                                 totalProperty : 'total',
100                                 root : 'data',
101                                 id : 'id',
102                                 fields : [
103                                     {
104                                         'name': 'id',
105                                         'type': 'int'
106                                     },
107                                     {
108                                         'name': 'person_name',
109                                         'type': 'string'
110                                     },
111                                     {
112                                         'name': 'event_when',
113                                         'type': 'date',
114                                         'dateFormat': 'Y-m-d'
115                                     },
116                                     {
117                                         'name': 'action',
118                                         'type': 'string'
119                                     },
120                                     {
121                                         'name': 'ipaddr',
122                                         'type': 'string'
123                                     },
124                                     {
125                                         'name': 'on_id',
126                                         'type': 'int'
127                                     },
128                                     {
129                                         'name': 'on_table',
130                                         'type': 'string'
131                                     },
132                                     {
133                                         'name': 'person_id',
134                                         'type': 'int'
135                                     },
136                                     {
137                                         'name': 'remarks',
138                                         'type': 'string'
139                                     },
140                                     {
141                                         'name': 'person_table',
142                                         'type': 'string'
143                                     },
144                                     {
145                                         'name': 'person_id_id',
146                                         'type': 'int'
147                                     },
148                                     {
149                                         'name': 'person_id_office_id',
150                                         'type': 'int'
151                                     },
152                                     {
153                                         'name': 'person_id_name',
154                                         'type': 'string'
155                                     },
156                                     {
157                                         'name': 'person_id_phone',
158                                         'type': 'string'
159                                     },
160                                     {
161                                         'name': 'person_id_fax',
162                                         'type': 'string'
163                                     },
164                                     {
165                                         'name': 'person_id_email',
166                                         'type': 'string'
167                                     },
168                                     {
169                                         'name': 'person_id_company_id',
170                                         'type': 'int'
171                                     },
172                                     {
173                                         'name': 'person_id_role',
174                                         'type': 'string'
175                                     },
176                                     {
177                                         'name': 'person_id_active',
178                                         'type': 'int'
179                                     },
180                                     {
181                                         'name': 'person_id_remarks',
182                                         'type': 'string'
183                                     },
184                                     {
185                                         'name': 'person_id_passwd',
186                                         'type': 'string'
187                                     },
188                                     {
189                                         'name': 'person_id_owner_id',
190                                         'type': 'int'
191                                     },
192                                     {
193                                         'name': 'person_id_lang',
194                                         'type': 'string'
195                                     },
196                                     {
197                                         'name': 'person_id_no_reset_sent',
198                                         'type': 'int'
199                                     },
200                                     {
201                                         'name': 'person_id_action_type',
202                                         'type': 'string'
203                                     },
204                                     {
205                                         'name': 'person_id_project_id',
206                                         'type': 'int'
207                                     },
208                                     {
209                                         'name': 'person_id_deleted_by',
210                                         'type': 'int'
211                                     },
212                                     {
213                                         'name': 'person_id_deleted_dt',
214                                         'type': 'date'
215                                     },
216                                     {
217                                         'name': 'person_id_firstname',
218                                         'type': 'string'
219                                     },
220                                     {
221                                         'name': 'person_id_lastname',
222                                         'type': 'string'
223                                     }
224                                 ]
225                             }
226                         },
227                         footer : {
228                             xtype: 'PagingToolbar',
229                             xns: Roo,
230                             pageSize : 25,
231                             displayInfo : true,
232                             displayMsg : "Displaying Events{0} - {1} of {2}",
233                             emptyMsg : "No Events found"
234                         },
235                         colModel : [
236                             {
237                                 xtype: 'ColumnModel',
238                                 xns: Roo.grid,
239                                 header : 'Event when',
240                                 width : 75,
241                                 dataIndex : 'event_when',
242                                 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }
243                             },
244                             {
245                                 xtype: 'ColumnModel',
246                                 xns: Roo.grid,
247                                 dataIndex : 'person_id_name',
248                                 header : 'Person name',
249                                 width : 100,
250                                 renderer : function(v) { return String.format('{0}', v); }
251                             },
252                             {
253                                 xtype: 'ColumnModel',
254                                 xns: Roo.grid,
255                                 dataIndex : 'action',
256                                 header : 'Action',
257                                 width : 80,
258                                 renderer : function(v) { return String.format('{0}', v); }
259                             },
260                             {
261                                 xtype: 'ColumnModel',
262                                 xns: Roo.grid,
263                                 dataIndex : 'ipaddr',
264                                 header : 'Ipaddr',
265                                 width : 80,
266                                 renderer : function(v) { return String.format('{0}', v); }
267                             },
268                             {
269                                 xtype: 'ColumnModel',
270                                 xns: Roo.grid,
271                                 header : 'Remarks',
272                                 width : 200,
273                                 dataIndex : 'remarks',
274                                 renderer : function(v) { return String.format('{0}', v); }
275                             }
276                         ]
277                     }
278                 }
279             ],
280             center : {
281                 xtype: 'LayoutRegion',
282                 xns: Roo
283             },
284             buttons : [
285                 {
286                     xtype: 'Button',
287                     xns: Roo
288                 }
289             ]
290         });
291     }
292 };