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