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