Pman.Tab.AdminLogEvents.bjs
[Pman.Admin] / Pman.Tab.AdminLogEvents.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.Tab');
6
7 Pman.Tab.AdminLogEvents = new Roo.XComponent({
8     part     :  ["Admin", "LogEvents" ],
9     order    : '001-Pman.Tab.AdminLogEvents',
10     region   : 'center',
11     parent   : 'Pman.Tab.AdminLogs',
12     name     : "Admin - Logs - Events",
13     disabled : false, 
14     permname : 'Admin.Logs', 
15     _tree : function()
16     {
17         var _this = this;
18         var MODULE = this;
19         return {
20             layout : {
21                 center : {
22                     '|xns' : 'Roo',
23                     xtype : 'LayoutRegion',
24                     xns : Roo
25                 },
26                 south : {
27                     '|xns' : 'Roo',
28                     autoScroll : true,
29                     xtype : 'LayoutRegion',
30                     xns : Roo,
31                     split : true,
32                     height : 150
33                 },
34                 '|xns' : 'Roo',
35                 xtype : 'BorderLayout',
36                 xns : Roo,
37                 items : [
38                         {
39                         '|xns' : 'Roo',
40                         fitToFrame : true,
41                         region : 'south',
42                         xtype : 'ContentPanel',
43                         xns : Roo,
44                         listeners : {
45                                 render : function (_self)
46                                    {
47                                      _this.viewPanel = _self;
48                                    }
49                         }
50                     },
51                         {
52                         grid : {
53                             sm : {
54                                 '|xns' : 'Roo.grid',
55                                 xtype : 'RowSelectionModel',
56                                 singleSelect : true,
57                                 xns : Roo.grid,
58                                 listeners : {
59                                         afterselectionchange : function (_self)
60                                            {
61                                                // load detail log in _this.viewPanel;
62                                                if (!this.getSelected()) {
63                                                    this.viewPanel.setContent("Nothing Selected");
64                                                    return;
65                                                }
66                                                var id = this.getSelected().data.id;
67                                                _this.viewPanel.load( { url : baseURL + "/Admin/EventView/" + id + ".html" });
68                                                
69                                            }
70                                 }
71                             },
72                             dataSource : {
73                                 reader : {
74                                     '|xns' : 'Roo.data',
75                                     id : 'id',
76                                     root : 'data',
77                                     xtype : 'JsonReader',
78                                     xns : Roo.data,
79                                     fields : [
80                                         {
81                                             'name': 'id',
82                                             'type': 'int'
83                                         },
84                                         {
85                                             'name': 'person_name',
86                                             'type': 'string'
87                                         },
88                                         {
89                                             'name': 'event_when',
90                                             'type': 'date',
91                                             'dateFormat': 'Y-m-d'
92                                         },
93                                         {
94                                             'name': 'action',
95                                             'type': 'string'
96                                         },
97                                         {
98                                             'name': 'ipaddr',
99                                             'type': 'string'
100                                         },
101                                         {
102                                             'name': 'on_id',
103                                             'type': 'int'
104                                         },
105                                         {
106                                             'name': 'on_table',
107                                             'type': 'string'
108                                         },
109                                         {
110                                             'name': 'person_id',
111                                             'type': 'int'
112                                         },
113                                         {
114                                             'name': 'remarks',
115                                             'type': 'string'
116                                         },
117                                         {
118                                             'name': 'person_id_id',
119                                             'type': 'int'
120                                         },
121                                         {
122                                             'name': 'person_id_office_id',
123                                             'type': 'int'
124                                         },
125                                         {
126                                             'name': 'person_id_name',
127                                             'type': 'string'
128                                         },
129                                         {
130                                             'name': 'person_id_phone',
131                                             'type': 'string'
132                                         },
133                                         {
134                                             'name': 'person_id_fax',
135                                             'type': 'string'
136                                         },
137                                         {
138                                             'name': 'person_id_email',
139                                             'type': 'string'
140                                         },
141                                         {
142                                             'name': 'person_id_company_id',
143                                             'type': 'int'
144                                         },
145                                         {
146                                             'name': 'person_id_role',
147                                             'type': 'string'
148                                         },
149                                         {
150                                             'name': 'person_id_active',
151                                             'type': 'int'
152                                         },
153                                         {
154                                             'name': 'person_id_remarks',
155                                             'type': 'string'
156                                         },
157                                         {
158                                             'name': 'person_id_passwd',
159                                             'type': 'string'
160                                         },
161                                         {
162                                             'name': 'person_id_owner_id',
163                                             'type': 'int'
164                                         },
165                                         {
166                                             'name': 'person_id_lang',
167                                             'type': 'string'
168                                         },
169                                         {
170                                             'name': 'person_id_no_reset_sent',
171                                             'type': 'int'
172                                         },
173                                         {
174                                             'name': 'person_id_action_type',
175                                             'type': 'string'
176                                         },
177                                         {
178                                             'name': 'person_id_project_id',
179                                             'type': 'int'
180                                         },
181                                         {
182                                             'name': 'person_id_deleted_by',
183                                             'type': 'int'
184                                         },
185                                         {
186                                             'name': 'person_id_deleted_dt',
187                                             'type': 'date'
188                                         }
189                                     ],
190                                     totalProperty : 'total'
191                                 },
192                                 proxy : {
193                                     '|xns' : 'Roo.data',
194                                     url : baseURL + '/Roo/Events.php',
195                                     method : 'GET',
196                                     xtype : 'HttpProxy',
197                                     xns : Roo.data
198                                 },
199                                 '|xns' : 'Roo.data',
200                                 xtype : 'Store',
201                                 remoteSort : true,
202                                 sortInfo : { field: 'event_when', direction: 'DESC'},
203                                 xns : Roo.data,
204                                 listeners : {
205                                         beforeload : function (_self, o)
206                                            {
207                                                if (!Pman.buildCompleted) {
208                                                    return false;
209                                                }
210                                               
211                                               
212                                               if (! _this.personSel) {
213                                                return false;
214                                                }
215                                                o.params = o.params || {};
216                                                o.params.person_id = _this.personSel.getValue();
217                                                var act = _this.actionSel.getValue();
218                                                if (act.length) {
219                                                    o.params.action = act;
220                                                }
221                                                var tbl = _this.affectSel.getValue();
222                                                if (tbl.length) {
223                                                    o.params.on_table = tbl;
224                                                }
225                                                act = _this.dateFrom.getValue();
226                                                if (act.format) {
227                                                    o.params['query[from]'] = act.format('Y-m-d');
228                                                }
229                                                act = _this.dateTo.getValue();
230                                                if (act.format) {
231                                                    o.params['query[to]'] = act.format('Y-m-d');
232                                                }
233                                             
234                                                
235                                                /*
236                                                act = _this.groupedCombo.getValue();
237                                                o.params['query[grouped]'] = act;
238                                                if (o.params['query[grouped]'] == 'gr') {
239                                                
240                                                    if (!tbl.length) {
241                                                        Roo.MessageBox.alert("Error", "Select a table to group results on");
242                                                        return false;
243                                                    }
244                                            //        o.params['_columns']  = 
245                                                    o.params['_distinct'] = 'on_id';
246                                                    
247                                                    
248                                                }
249                                                
250                                                */
251                                            
252                                                
253                                            }
254                                 },
255                                 items : [
256
257                                 ]
258
259                             },
260                             footer : {
261                                 '|xns' : 'Roo',
262                                 pageSize : 25,
263                                 xtype : 'PagingToolbar',
264                                 emptyMsg : "No Events found",
265                                 xns : Roo,
266                                 displayInfo : true,
267                                 displayMsg : "Displaying Events  {0} - {1} of {2}",
268                                 items : [
269                                         {
270                                         '|xns' : 'Roo.Toolbar',
271                                         text : "Download to Excel",
272                                         xtype : 'Button',
273                                         xns : Roo.Toolbar,
274                                         listeners : {
275                                                 click : function (_self, e)
276                                                    {
277                                                        
278                                                        var params = {
279                                                            'sort' : 'event_when',
280                                                            'dir' : 'DESC',
281                                                            'start' : 0,
282                                                            'limit' : 900,
283                                                            person_id : _this.personSel.getValue(), 
284                                                            'csvTitles[0]' : 'When',   'csvCols[0]' : 'event_when', 
285                                                            'csvTitles[1]' : 'Staff',   'csvCols[1]' : 'person_id_name', 
286                                                            'csvTitles[2]' : 'Action',   'csvCols[2]' : 'action', 
287                                                            'csvTitles[3]' : 'Record ID',   'csvCols[3]' : 'on_id'       ,
288                                                            'csvTitles[4]' : 'Record Type',   'csvCols[4]' : 'on_table',
289                                                            'csvTitles[5]' : 'Remarks',   'csvCols[5]' : 'remarks'        
290                                                        }
291                                                            
292                                                        params.person_id = _this.personSel.getValue();
293                                                        var act = _this.actionSel.getValue();
294                                                        if (act.length) {
295                                                            params.action = act;
296                                                        }
297                                                        var tbl = _this.affectSel.getValue();
298                                                        if (tbl.length) {
299                                                            params.on_table = tbl;
300                                                        }
301                                                        act = _this.dateFrom.getValue();
302                                                        if (act.format) {
303                                                            params['query[from]'] = act.format('Y-m-d');
304                                                        }
305                                                        act = _this.dateTo.getValue();
306                                                        if (act.format) {
307                                                            params['query[to]'] = act.format('Y-m-d');
308                                                        }
309                                                        params.limit = 9999;
310                                                        
311                                                    
312                                                        new Pman.download({
313                                                            url : baseURL + '/Roo/Events.php',
314                                                            params : params ,
315                                                            newWindow: true
316                                                            
317                                                        });
318                                                    }
319                                         }
320                                     }
321                                 ]
322
323                             },
324                             toolbar : {
325                                 '|xns' : 'Roo',
326                                 xtype : 'Toolbar',
327                                 xns : Roo,
328                                 items : [
329                                         {
330                                         '|xns' : 'Roo.Toolbar',
331                                         text : "Show",
332                                         xtype : 'TextItem',
333                                         xns : Roo.Toolbar
334                                     },
335                                         {
336                                         store : {
337                                             proxy : {
338                                                 '|xns' : 'Roo.data',
339                                                 url : baseURL + '/Roo/Person.php',
340                                                 method : 'GET',
341                                                 xtype : 'HttpProxy',
342                                                 xns : Roo.data
343                                             },
344                                             reader : {
345                                                 '|xns' : 'Roo.data',
346                                                 id : 'id',
347                                                 root : 'data',
348                                                 xtype : 'JsonReader',
349                                                 fields : [
350                                                     {
351                                                         'name': 'id',
352                                                         'type': 'int'
353                                                     },
354                                                     {
355                                                         'name': 'office_id',
356                                                         'type': 'int'
357                                                     },
358                                                     {
359                                                         'name': 'name',
360                                                         'type': 'string'
361                                                     },
362                                                     {
363                                                         'name': 'phone',
364                                                         'type': 'string'
365                                                     },
366                                                     {
367                                                         'name': 'fax',
368                                                         'type': 'string'
369                                                     },
370                                                     {
371                                                         'name': 'email',
372                                                         'type': 'string'
373                                                     },
374                                                     {
375                                                         'name': 'company_id',
376                                                         'type': 'int'
377                                                     },
378                                                     {
379                                                         'name': 'role',
380                                                         'type': 'string'
381                                                     },
382                                                     {
383                                                         'name': 'active',
384                                                         'type': 'int'
385                                                     },
386                                                     {
387                                                         'name': 'remarks',
388                                                         'type': 'string'
389                                                     },
390                                                     {
391                                                         'name': 'passwd',
392                                                         'type': 'string'
393                                                     },
394                                                     {
395                                                         'name': 'owner_id',
396                                                         'type': 'int'
397                                                     },
398                                                     {
399                                                         'name': 'lang',
400                                                         'type': 'string'
401                                                     },
402                                                     {
403                                                         'name': 'no_reset_sent',
404                                                         'type': 'int'
405                                                     },
406                                                     {
407                                                         'name': 'action_type',
408                                                         'type': 'string'
409                                                     },
410                                                     {
411                                                         'name': 'project_id',
412                                                         'type': 'int'
413                                                     },
414                                                     {
415                                                         'name': 'deleted_by',
416                                                         'type': 'int'
417                                                     },
418                                                     {
419                                                         'name': 'deleted_dt',
420                                                         'type': 'date',
421                                                         'dateFormat': 'Y-m-d'
422                                                     },
423                                                     {
424                                                         'name': 'office_id_id',
425                                                         'type': 'int'
426                                                     },
427                                                     {
428                                                         'name': 'office_id_company_id',
429                                                         'type': 'int'
430                                                     },
431                                                     {
432                                                         'name': 'office_id_name',
433                                                         'type': 'string'
434                                                     },
435                                                     {
436                                                         'name': 'office_id_address',
437                                                         'type': 'string'
438                                                     },
439                                                     {
440                                                         'name': 'office_id_phone',
441                                                         'type': 'string'
442                                                     },
443                                                     {
444                                                         'name': 'office_id_fax',
445                                                         'type': 'string'
446                                                     },
447                                                     {
448                                                         'name': 'office_id_email',
449                                                         'type': 'string'
450                                                     },
451                                                     {
452                                                         'name': 'office_id_role',
453                                                         'type': 'string'
454                                                     },
455                                                     {
456                                                         'name': 'company_id_code',
457                                                         'type': 'string'
458                                                     },
459                                                     {
460                                                         'name': 'company_id_name',
461                                                         'type': 'string'
462                                                     },
463                                                     {
464                                                         'name': 'company_id_remarks',
465                                                         'type': 'string'
466                                                     },
467                                                     {
468                                                         'name': 'company_id_owner_id',
469                                                         'type': 'int'
470                                                     },
471                                                     {
472                                                         'name': 'company_id_address',
473                                                         'type': 'string'
474                                                     },
475                                                     {
476                                                         'name': 'company_id_tel',
477                                                         'type': 'string'
478                                                     },
479                                                     {
480                                                         'name': 'company_id_fax',
481                                                         'type': 'string'
482                                                     },
483                                                     {
484                                                         'name': 'company_id_email',
485                                                         'type': 'string'
486                                                     },
487                                                     {
488                                                         'name': 'company_id_id',
489                                                         'type': 'int'
490                                                     },
491                                                     {
492                                                         'name': 'company_id_isOwner',
493                                                         'type': 'int'
494                                                     },
495                                                     {
496                                                         'name': 'company_id_logo_id',
497                                                         'type': 'int'
498                                                     },
499                                                     {
500                                                         'name': 'company_id_background_color',
501                                                         'type': 'string'
502                                                     },
503                                                     {
504                                                         'name': 'company_id_comptype',
505                                                         'type': 'string'
506                                                     },
507                                                     {
508                                                         'name': 'company_id_url',
509                                                         'type': 'string'
510                                                     },
511                                                     {
512                                                         'name': 'company_id_main_office_id',
513                                                         'type': 'int'
514                                                     },
515                                                     {
516                                                         'name': 'company_id_created_by',
517                                                         'type': 'int'
518                                                     },
519                                                     {
520                                                         'name': 'company_id_created_dt',
521                                                         'type': 'date'
522                                                     },
523                                                     {
524                                                         'name': 'company_id_updated_by',
525                                                         'type': 'int'
526                                                     },
527                                                     {
528                                                         'name': 'company_id_updated_dt',
529                                                         'type': 'date'
530                                                     },
531                                                     {
532                                                         'name': 'company_id_passwd',
533                                                         'type': 'string'
534                                                     },
535                                                     {
536                                                         'name': 'company_id_dispatch_port',
537                                                         'type': 'string'
538                                                     },
539                                                     {
540                                                         'name': 'company_id_province',
541                                                         'type': 'string'
542                                                     },
543                                                     {
544                                                         'name': 'company_id_country',
545                                                         'type': 'string'
546                                                     },
547                                                     {
548                                                         'name': 'project_id_id',
549                                                         'type': 'int'
550                                                     },
551                                                     {
552                                                         'name': 'project_id_name',
553                                                         'type': 'string'
554                                                     },
555                                                     {
556                                                         'name': 'project_id_remarks',
557                                                         'type': 'string'
558                                                     },
559                                                     {
560                                                         'name': 'project_id_owner_id',
561                                                         'type': 'int'
562                                                     },
563                                                     {
564                                                         'name': 'project_id_code',
565                                                         'type': 'string'
566                                                     },
567                                                     {
568                                                         'name': 'project_id_active',
569                                                         'type': 'int'
570                                                     },
571                                                     {
572                                                         'name': 'project_id_type',
573                                                         'type': 'string'
574                                                     },
575                                                     {
576                                                         'name': 'project_id_client_id',
577                                                         'type': 'int'
578                                                     },
579                                                     {
580                                                         'name': 'project_id_team_id',
581                                                         'type': 'int'
582                                                     },
583                                                     {
584                                                         'name': 'project_id_file_location',
585                                                         'type': 'string'
586                                                     },
587                                                     {
588                                                         'name': 'project_id_open_date',
589                                                         'type': 'date'
590                                                     },
591                                                     {
592                                                         'name': 'project_id_open_by',
593                                                         'type': 'int'
594                                                     },
595                                                     {
596                                                         'name': 'project_id_close_date',
597                                                         'type': 'date'
598                                                     },
599                                                     {
600                                                         'name': 'project_id_countries',
601                                                         'type': 'string'
602                                                     },
603                                                     {
604                                                         'name': 'project_id_languages',
605                                                         'type': 'string'
606                                                     },
607                                                     {
608                                                         'name': 'project_id_agency_id',
609                                                         'type': 'int'
610                                                     },
611                                                     {
612                                                         'name': 'owner_id_id',
613                                                         'type': 'int'
614                                                     },
615                                                     {
616                                                         'name': 'owner_id_office_id',
617                                                         'type': 'int'
618                                                     },
619                                                     {
620                                                         'name': 'owner_id_name',
621                                                         'type': 'string'
622                                                     },
623                                                     {
624                                                         'name': 'owner_id_phone',
625                                                         'type': 'string'
626                                                     },
627                                                     {
628                                                         'name': 'owner_id_fax',
629                                                         'type': 'string'
630                                                     },
631                                                     {
632                                                         'name': 'owner_id_email',
633                                                         'type': 'string'
634                                                     },
635                                                     {
636                                                         'name': 'owner_id_company_id',
637                                                         'type': 'int'
638                                                     },
639                                                     {
640                                                         'name': 'owner_id_role',
641                                                         'type': 'string'
642                                                     },
643                                                     {
644                                                         'name': 'owner_id_active',
645                                                         'type': 'int'
646                                                     },
647                                                     {
648                                                         'name': 'owner_id_remarks',
649                                                         'type': 'string'
650                                                     },
651                                                     {
652                                                         'name': 'owner_id_passwd',
653                                                         'type': 'string'
654                                                     },
655                                                     {
656                                                         'name': 'owner_id_owner_id',
657                                                         'type': 'int'
658                                                     },
659                                                     {
660                                                         'name': 'owner_id_lang',
661                                                         'type': 'string'
662                                                     },
663                                                     {
664                                                         'name': 'owner_id_no_reset_sent',
665                                                         'type': 'int'
666                                                     },
667                                                     {
668                                                         'name': 'owner_id_action_type',
669                                                         'type': 'string'
670                                                     },
671                                                     {
672                                                         'name': 'owner_id_project_id',
673                                                         'type': 'int'
674                                                     },
675                                                     {
676                                                         'name': 'owner_id_deleted_by',
677                                                         'type': 'int'
678                                                     },
679                                                     {
680                                                         'name': 'owner_id_deleted_dt',
681                                                         'type': 'date'
682                                                     }
683                                                 ],
684                                                 xns : Roo.data,
685                                                 totalProperty : 'total'
686                                             },
687                                             '|xns' : 'Roo.data',
688                                             xtype : 'Store',
689                                             remoteSort : true,
690                                             sortInfo : { field : 'name' , direction : 'ASC' },
691                                             xns : Roo.data,
692                                             listeners : {
693                                                 beforeload : function (_self, o)
694                                                    {
695                                                        o.params = o.params || {};
696                                                        o.params.company_id = Pman.Login.authUser.company_id;
697                                                    }
698                                             },
699                                             items : [
700
701                                             ]
702
703                                         },
704                                         '|xns' : 'Roo.form',
705                                         listWidth : 600,
706                                         triggerAction : 'all',
707                                         fieldLabel : 'Person ',
708                                         forceSelection : true,
709                                         selectOnFocus : true,
710                                         pageSize : 20,
711                                         displayField : 'name',
712                                         emptyText : "Select Person ",
713                                         minChars : 2,
714                                         valueField : 'id',
715                                         xtype : 'ComboBox',
716                                         allowBlank : true,
717                                         typeAhead : true,
718                                         editable : true,
719                                         width : 150,
720                                         xns : Roo.form,
721                                         name : 'person_id_name',
722                                         qtip : "Select Person ",
723                                         queryParam : 'query[name]',
724                                         tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> ({company_id_name}) &lt;{email}&gt; </div>',
725                                         loadingText : "Searching...",
726                                         listeners : {
727                                                 render : function (_self)
728                                                    {
729                                                      _this.personSel = _self;
730                                                    },
731                                                 select : function (combo, record, index)
732                                                    {
733                                                      _this.grid.footer.onClick('first');
734                                                      
735                                                    }
736                                         },
737                                         items : [
738
739                                         ]
740
741                                     },
742                                         {
743                                         store : {
744                                             proxy : {
745                                                 '|xns' : 'Roo.data',
746                                                 url : baseURL + '/Roo/Person.php',
747                                                 xtype : 'HttpProxy',
748                                                 method : 'GET',
749                                                 xns : Roo.data
750                                             },
751                                             reader : {
752                                                 '|xns' : 'Roo.data',
753                                                 id : 'id',
754                                                 root : 'data',
755                                                 xtype : 'JsonReader',
756                                                 fields : [
757                                                     {
758                                                         'name': 'id',
759                                                         'type': 'int'
760                                                     },
761                                                     {
762                                                         'name': 'office_id',
763                                                         'type': 'int'
764                                                     },
765                                                     {
766                                                         'name': 'name',
767                                                         'type': 'string'
768                                                     },
769                                                     {
770                                                         'name': 'phone',
771                                                         'type': 'string'
772                                                     },
773                                                     {
774                                                         'name': 'fax',
775                                                         'type': 'string'
776                                                     },
777                                                     {
778                                                         'name': 'email',
779                                                         'type': 'string'
780                                                     },
781                                                     {
782                                                         'name': 'company_id',
783                                                         'type': 'int'
784                                                     },
785                                                     {
786                                                         'name': 'role',
787                                                         'type': 'string'
788                                                     },
789                                                     {
790                                                         'name': 'active',
791                                                         'type': 'int'
792                                                     },
793                                                     {
794                                                         'name': 'remarks',
795                                                         'type': 'string'
796                                                     },
797                                                     {
798                                                         'name': 'passwd',
799                                                         'type': 'string'
800                                                     },
801                                                     {
802                                                         'name': 'owner_id',
803                                                         'type': 'int'
804                                                     },
805                                                     {
806                                                         'name': 'lang',
807                                                         'type': 'string'
808                                                     },
809                                                     {
810                                                         'name': 'no_reset_sent',
811                                                         'type': 'int'
812                                                     },
813                                                     {
814                                                         'name': 'action_type',
815                                                         'type': 'string'
816                                                     },
817                                                     {
818                                                         'name': 'project_id',
819                                                         'type': 'int'
820                                                     },
821                                                     {
822                                                         'name': 'deleted_by',
823                                                         'type': 'int'
824                                                     },
825                                                     {
826                                                         'name': 'deleted_dt',
827                                                         'type': 'date',
828                                                         'dateFormat': 'Y-m-d'
829                                                     },
830                                                     {
831                                                         'name': 'office_id_id',
832                                                         'type': 'int'
833                                                     },
834                                                     {
835                                                         'name': 'office_id_company_id',
836                                                         'type': 'int'
837                                                     },
838                                                     {
839                                                         'name': 'office_id_name',
840                                                         'type': 'string'
841                                                     },
842                                                     {
843                                                         'name': 'office_id_address',
844                                                         'type': 'string'
845                                                     },
846                                                     {
847                                                         'name': 'office_id_phone',
848                                                         'type': 'string'
849                                                     },
850                                                     {
851                                                         'name': 'office_id_fax',
852                                                         'type': 'string'
853                                                     },
854                                                     {
855                                                         'name': 'office_id_email',
856                                                         'type': 'string'
857                                                     },
858                                                     {
859                                                         'name': 'office_id_role',
860                                                         'type': 'string'
861                                                     },
862                                                     {
863                                                         'name': 'company_id_code',
864                                                         'type': 'string'
865                                                     },
866                                                     {
867                                                         'name': 'company_id_name',
868                                                         'type': 'string'
869                                                     },
870                                                     {
871                                                         'name': 'company_id_remarks',
872                                                         'type': 'string'
873                                                     },
874                                                     {
875                                                         'name': 'company_id_owner_id',
876                                                         'type': 'int'
877                                                     },
878                                                     {
879                                                         'name': 'company_id_address',
880                                                         'type': 'string'
881                                                     },
882                                                     {
883                                                         'name': 'company_id_tel',
884                                                         'type': 'string'
885                                                     },
886                                                     {
887                                                         'name': 'company_id_fax',
888                                                         'type': 'string'
889                                                     },
890                                                     {
891                                                         'name': 'company_id_email',
892                                                         'type': 'string'
893                                                     },
894                                                     {
895                                                         'name': 'company_id_id',
896                                                         'type': 'int'
897                                                     },
898                                                     {
899                                                         'name': 'company_id_isOwner',
900                                                         'type': 'int'
901                                                     },
902                                                     {
903                                                         'name': 'company_id_logo_id',
904                                                         'type': 'int'
905                                                     },
906                                                     {
907                                                         'name': 'company_id_background_color',
908                                                         'type': 'string'
909                                                     },
910                                                     {
911                                                         'name': 'company_id_comptype',
912                                                         'type': 'string'
913                                                     },
914                                                     {
915                                                         'name': 'company_id_url',
916                                                         'type': 'string'
917                                                     },
918                                                     {
919                                                         'name': 'company_id_main_office_id',
920                                                         'type': 'int'
921                                                     },
922                                                     {
923                                                         'name': 'company_id_created_by',
924                                                         'type': 'int'
925                                                     },
926                                                     {
927                                                         'name': 'company_id_created_dt',
928                                                         'type': 'date'
929                                                     },
930                                                     {
931                                                         'name': 'company_id_updated_by',
932                                                         'type': 'int'
933                                                     },
934                                                     {
935                                                         'name': 'company_id_updated_dt',
936                                                         'type': 'date'
937                                                     },
938                                                     {
939                                                         'name': 'company_id_passwd',
940                                                         'type': 'string'
941                                                     },
942                                                     {
943                                                         'name': 'company_id_dispatch_port',
944                                                         'type': 'string'
945                                                     },
946                                                     {
947                                                         'name': 'company_id_province',
948                                                         'type': 'string'
949                                                     },
950                                                     {
951                                                         'name': 'company_id_country',
952                                                         'type': 'string'
953                                                     },
954                                                     {
955                                                         'name': 'project_id_id',
956                                                         'type': 'int'
957                                                     },
958                                                     {
959                                                         'name': 'project_id_name',
960                                                         'type': 'string'
961                                                     },
962                                                     {
963                                                         'name': 'project_id_remarks',
964                                                         'type': 'string'
965                                                     },
966                                                     {
967                                                         'name': 'project_id_owner_id',
968                                                         'type': 'int'
969                                                     },
970                                                     {
971                                                         'name': 'project_id_code',
972                                                         'type': 'string'
973                                                     },
974                                                     {
975                                                         'name': 'project_id_active',
976                                                         'type': 'int'
977                                                     },
978                                                     {
979                                                         'name': 'project_id_type',
980                                                         'type': 'string'
981                                                     },
982                                                     {
983                                                         'name': 'project_id_client_id',
984                                                         'type': 'int'
985                                                     },
986                                                     {
987                                                         'name': 'project_id_team_id',
988                                                         'type': 'int'
989                                                     },
990                                                     {
991                                                         'name': 'project_id_file_location',
992                                                         'type': 'string'
993                                                     },
994                                                     {
995                                                         'name': 'project_id_open_date',
996                                                         'type': 'date'
997                                                     },
998                                                     {
999                                                         'name': 'project_id_open_by',
1000                                                         'type': 'int'
1001                                                     },
1002                                                     {
1003                                                         'name': 'project_id_close_date',
1004                                                         'type': 'date'
1005                                                     },
1006                                                     {
1007                                                         'name': 'project_id_countries',
1008                                                         'type': 'string'
1009                                                     },
1010                                                     {
1011                                                         'name': 'project_id_languages',
1012                                                         'type': 'string'
1013                                                     },
1014                                                     {
1015                                                         'name': 'project_id_agency_id',
1016                                                         'type': 'int'
1017                                                     },
1018                                                     {
1019                                                         'name': 'owner_id_id',
1020                                                         'type': 'int'
1021                                                     },
1022                                                     {
1023                                                         'name': 'owner_id_office_id',
1024                                                         'type': 'int'
1025                                                     },
1026                                                     {
1027                                                         'name': 'owner_id_name',
1028                                                         'type': 'string'
1029                                                     },
1030                                                     {
1031                                                         'name': 'owner_id_phone',
1032                                                         'type': 'string'
1033                                                     },
1034                                                     {
1035                                                         'name': 'owner_id_fax',
1036                                                         'type': 'string'
1037                                                     },
1038                                                     {
1039                                                         'name': 'owner_id_email',
1040                                                         'type': 'string'
1041                                                     },
1042                                                     {
1043                                                         'name': 'owner_id_company_id',
1044                                                         'type': 'int'
1045                                                     },
1046                                                     {
1047                                                         'name': 'owner_id_role',
1048                                                         'type': 'string'
1049                                                     },
1050                                                     {
1051                                                         'name': 'owner_id_active',
1052                                                         'type': 'int'
1053                                                     },
1054                                                     {
1055                                                         'name': 'owner_id_remarks',
1056                                                         'type': 'string'
1057                                                     },
1058                                                     {
1059                                                         'name': 'owner_id_passwd',
1060                                                         'type': 'string'
1061                                                     },
1062                                                     {
1063                                                         'name': 'owner_id_owner_id',
1064                                                         'type': 'int'
1065                                                     },
1066                                                     {
1067                                                         'name': 'owner_id_lang',
1068                                                         'type': 'string'
1069                                                     },
1070                                                     {
1071                                                         'name': 'owner_id_no_reset_sent',
1072                                                         'type': 'int'
1073                                                     },
1074                                                     {
1075                                                         'name': 'owner_id_action_type',
1076                                                         'type': 'string'
1077                                                     },
1078                                                     {
1079                                                         'name': 'owner_id_project_id',
1080                                                         'type': 'int'
1081                                                     },
1082                                                     {
1083                                                         'name': 'owner_id_deleted_by',
1084                                                         'type': 'int'
1085                                                     },
1086                                                     {
1087                                                         'name': 'owner_id_deleted_dt',
1088                                                         'type': 'date'
1089                                                     }
1090                                                 ],
1091                                                 xns : Roo.data,
1092                                                 totalProperty : 'total'
1093                                             },
1094                                             '|xns' : 'Roo.data',
1095                                             xtype : 'Store',
1096                                             remoteSort : true,
1097                                             sortInfo : { field : 'name' , direction : 'ASC' },
1098                                             xns : Roo.data,
1099                                             listeners : {
1100                                                 beforeload : function (_self, o)
1101                                                    {
1102                                                        o.params = o.params || {};
1103                                                        o.params.company_id = Pman.Login.authUser.company_id;
1104                                                    }
1105                                             },
1106                                             items : [
1107
1108                                             ]
1109
1110                                         },
1111                                         '|xns' : 'Roo.form',
1112                                         listWidth : 600,
1113                                         triggerAction : 'all',
1114                                         fieldLabel : 'Person ',
1115                                         forceSelection : true,
1116                                         selectOnFocus : true,
1117                                         pageSize : 20,
1118                                         displayField : 'name',
1119                                         emptyText : "Select Person ",
1120                                         minChars : 2,
1121                                         valueField : 'id',
1122                                         xtype : 'ComboBox',
1123                                         allowBlank : true,
1124                                         typeAhead : true,
1125                                         editable : true,
1126                                         width : 150,
1127                                         xns : Roo.form,
1128                                         name : 'person_id_name',
1129                                         qtip : "Select Person ",
1130                                         queryParam : 'query[name]',
1131                                         tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> ({company_id_name}) &lt;{email}&gt; </div>',
1132                                         loadingText : "Searching...",
1133                                         listeners : {
1134                                                 render : function (_self)
1135                                                    {
1136                                                      _this.personSel = _self;
1137                                                    },
1138                                                 select : function (combo, record, index)
1139                                                    {
1140                                                      _this.grid.footer.onClick('first');
1141                                                      
1142                                                    }
1143                                         },
1144                                         items : [
1145
1146                                         ]
1147
1148                                     },
1149                                         {
1150                                         store : {
1151                                             proxy : {
1152                                                 '|xns' : 'Roo.data',
1153                                                 url : baseURL + '/Roo/Events.php',
1154                                                 xtype : 'HttpProxy',
1155                                                 method : 'GET',
1156                                                 xns : Roo.data
1157                                             },
1158                                             reader : {
1159                                                 '|xns' : 'Roo.data',
1160                                                 id : 'id',
1161                                                 root : 'data',
1162                                                 xtype : 'JsonReader',
1163                                                 fields : [
1164                                                     {
1165                                                         'name': 'id',
1166                                                         'type': 'int'
1167                                                     },
1168                                                     {
1169                                                         'name': 'person_name',
1170                                                         'type': 'string'
1171                                                     },
1172                                                     {
1173                                                         'name': 'event_when',
1174                                                         'type': 'date',
1175                                                         'dateFormat': 'Y-m-d'
1176                                                     },
1177                                                     {
1178                                                         'name': 'action',
1179                                                         'type': 'string'
1180                                                     },
1181                                                     {
1182                                                         'name': 'ipaddr',
1183                                                         'type': 'string'
1184                                                     },
1185                                                     {
1186                                                         'name': 'on_id',
1187                                                         'type': 'int'
1188                                                     },
1189                                                     {
1190                                                         'name': 'on_table',
1191                                                         'type': 'string'
1192                                                     },
1193                                                     {
1194                                                         'name': 'person_id',
1195                                                         'type': 'int'
1196                                                     },
1197                                                     {
1198                                                         'name': 'remarks',
1199                                                         'type': 'string'
1200                                                     },
1201                                                     {
1202                                                         'name': 'person_id_id',
1203                                                         'type': 'int'
1204                                                     },
1205                                                     {
1206                                                         'name': 'person_id_office_id',
1207                                                         'type': 'int'
1208                                                     },
1209                                                     {
1210                                                         'name': 'person_id_name',
1211                                                         'type': 'string'
1212                                                     },
1213                                                     {
1214                                                         'name': 'person_id_phone',
1215                                                         'type': 'string'
1216                                                     },
1217                                                     {
1218                                                         'name': 'person_id_fax',
1219                                                         'type': 'string'
1220                                                     },
1221                                                     {
1222                                                         'name': 'person_id_email',
1223                                                         'type': 'string'
1224                                                     },
1225                                                     {
1226                                                         'name': 'person_id_company_id',
1227                                                         'type': 'int'
1228                                                     },
1229                                                     {
1230                                                         'name': 'person_id_role',
1231                                                         'type': 'string'
1232                                                     },
1233                                                     {
1234                                                         'name': 'person_id_active',
1235                                                         'type': 'int'
1236                                                     },
1237                                                     {
1238                                                         'name': 'person_id_remarks',
1239                                                         'type': 'string'
1240                                                     },
1241                                                     {
1242                                                         'name': 'person_id_passwd',
1243                                                         'type': 'string'
1244                                                     },
1245                                                     {
1246                                                         'name': 'person_id_owner_id',
1247                                                         'type': 'int'
1248                                                     },
1249                                                     {
1250                                                         'name': 'person_id_lang',
1251                                                         'type': 'string'
1252                                                     },
1253                                                     {
1254                                                         'name': 'person_id_no_reset_sent',
1255                                                         'type': 'int'
1256                                                     },
1257                                                     {
1258                                                         'name': 'person_id_action_type',
1259                                                         'type': 'string'
1260                                                     },
1261                                                     {
1262                                                         'name': 'person_id_project_id',
1263                                                         'type': 'int'
1264                                                     },
1265                                                     {
1266                                                         'name': 'person_id_deleted_by',
1267                                                         'type': 'int'
1268                                                     },
1269                                                     {
1270                                                         'name': 'person_id_deleted_dt',
1271                                                         'type': 'date'
1272                                                     }
1273                                                 ],
1274                                                 xns : Roo.data,
1275                                                 totalProperty : 'total'
1276                                             },
1277                                             '|xns' : 'Roo.data',
1278                                             xtype : 'Store',
1279                                             remoteSort : true,
1280                                             sortInfo : { field : 'action' , direction : 'ASC' },
1281                                             xns : Roo.data,
1282                                             listeners : {
1283                                                 beforeload : function (_self, o)
1284                                                    {
1285                                                        o.params = o.params || {};
1286                                                        // staff can see all logs, other companies can only see their own.
1287                                                        if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
1288                                                            o.params.company_id = Pman.Login.authUser.company_id;
1289                                                        }
1290                                                        o.params._distinct = 'action';
1291                                                        o.params._columns ='action';
1292                                                    }
1293                                             },
1294                                             items : [
1295
1296                                             ]
1297
1298                                         },
1299                                         '|xns' : 'Roo.form',
1300                                         listWidth : 300,
1301                                         triggerAction : 'all',
1302                                         forceSelection : true,
1303                                         selectOnFocus : true,
1304                                         pageSize : 20,
1305                                         displayField : 'action',
1306                                         emptyText : "Select Action",
1307                                         minChars : 2,
1308                                         valueField : 'action',
1309                                         xtype : 'ComboBox',
1310                                         allowBlank : true,
1311                                         typeAhead : true,
1312                                         editable : true,
1313                                         width : 150,
1314                                         xns : Roo.form,
1315                                         name : 'action',
1316                                         qtip : "Select Action",
1317                                         queryParam : 'query[action]',
1318                                         tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{action}</b> </div>',
1319                                         loadingText : "Searching...",
1320                                         listeners : {
1321                                                 render : function (_self)
1322                                                    {
1323                                                      _this.actionSel = _self;
1324                                                    },
1325                                                 select : function (combo, record, index)
1326                                                    {
1327                                                      _this.grid.footer.onClick('first');
1328                                                    }
1329                                         },
1330                                         items : [
1331
1332                                         ]
1333
1334                                     },
1335                                         {
1336                                         store : {
1337                                             proxy : {
1338                                                 '|xns' : 'Roo.data',
1339                                                 url : baseURL + '/Roo/Events.php',
1340                                                 xtype : 'HttpProxy',
1341                                                 method : 'GET',
1342                                                 xns : Roo.data
1343                                             },
1344                                             reader : {
1345                                                 '|xns' : 'Roo.data',
1346                                                 id : 'id',
1347                                                 root : 'data',
1348                                                 xtype : 'JsonReader',
1349                                                 xns : Roo.data,
1350                                                 fields : [
1351                                                     {
1352                                                         'name': 'id',
1353                                                         'type': 'int'
1354                                                     },
1355                                                     {
1356                                                         'name': 'person_name',
1357                                                         'type': 'string'
1358                                                     },
1359                                                     {
1360                                                         'name': 'event_when',
1361                                                         'type': 'date',
1362                                                         'dateFormat': 'Y-m-d'
1363                                                     },
1364                                                     {
1365                                                         'name': 'action',
1366                                                         'type': 'string'
1367                                                     },
1368                                                     {
1369                                                         'name': 'ipaddr',
1370                                                         'type': 'string'
1371                                                     },
1372                                                     {
1373                                                         'name': 'on_id',
1374                                                         'type': 'int'
1375                                                     },
1376                                                     {
1377                                                         'name': 'on_table',
1378                                                         'type': 'string'
1379                                                     },
1380                                                     {
1381                                                         'name': 'person_id',
1382                                                         'type': 'int'
1383                                                     },
1384                                                     {
1385                                                         'name': 'remarks',
1386                                                         'type': 'string'
1387                                                     },
1388                                                     {
1389                                                         'name': 'person_id_id',
1390                                                         'type': 'int'
1391                                                     },
1392                                                     {
1393                                                         'name': 'person_id_office_id',
1394                                                         'type': 'int'
1395                                                     },
1396                                                     {
1397                                                         'name': 'person_id_name',
1398                                                         'type': 'string'
1399                                                     },
1400                                                     {
1401                                                         'name': 'person_id_phone',
1402                                                         'type': 'string'
1403                                                     },
1404                                                     {
1405                                                         'name': 'person_id_fax',
1406                                                         'type': 'string'
1407                                                     },
1408                                                     {
1409                                                         'name': 'person_id_email',
1410                                                         'type': 'string'
1411                                                     },
1412                                                     {
1413                                                         'name': 'person_id_company_id',
1414                                                         'type': 'int'
1415                                                     },
1416                                                     {
1417                                                         'name': 'person_id_role',
1418                                                         'type': 'string'
1419                                                     },
1420                                                     {
1421                                                         'name': 'person_id_active',
1422                                                         'type': 'int'
1423                                                     },
1424                                                     {
1425                                                         'name': 'person_id_remarks',
1426                                                         'type': 'string'
1427                                                     },
1428                                                     {
1429                                                         'name': 'person_id_passwd',
1430                                                         'type': 'string'
1431                                                     },
1432                                                     {
1433                                                         'name': 'person_id_owner_id',
1434                                                         'type': 'int'
1435                                                     },
1436                                                     {
1437                                                         'name': 'person_id_lang',
1438                                                         'type': 'string'
1439                                                     },
1440                                                     {
1441                                                         'name': 'person_id_no_reset_sent',
1442                                                         'type': 'int'
1443                                                     },
1444                                                     {
1445                                                         'name': 'person_id_action_type',
1446                                                         'type': 'string'
1447                                                     },
1448                                                     {
1449                                                         'name': 'person_id_project_id',
1450                                                         'type': 'int'
1451                                                     },
1452                                                     {
1453                                                         'name': 'person_id_deleted_by',
1454                                                         'type': 'int'
1455                                                     },
1456                                                     {
1457                                                         'name': 'person_id_deleted_dt',
1458                                                         'type': 'date'
1459                                                     }
1460                                                 ],
1461                                                 totalProperty : 'total'
1462                                             },
1463                                             '|xns' : 'Roo.data',
1464                                             xtype : 'Store',
1465                                             remoteSort : true,
1466                                             sortInfo : { field : 'on_table' , direction : 'ASC' },
1467                                             xns : Roo.data,
1468                                             listeners : {
1469                                                 beforeload : function (_self, o)
1470                                                    {
1471                                                        o.params = o.params || {};
1472                                                        // staff can see all logs, other companies can only see their own.
1473                                                        if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
1474                                                            o.params.company_id = Pman.Login.authUser.company_id;
1475                                                        }
1476                                                        o.params._distinct = 'on_table';
1477                                                        o.params._columns ='on_table';
1478                                                    }
1479                                             },
1480                                             items : [
1481
1482                                             ]
1483
1484                                         },
1485                                         '|xns' : 'Roo.form',
1486                                         listWidth : 300,
1487                                         triggerAction : 'all',
1488                                         forceSelection : true,
1489                                         selectOnFocus : true,
1490                                         pageSize : 20,
1491                                         displayField : 'on_table',
1492                                         emptyText : "Select Affects",
1493                                         minChars : 2,
1494                                         valueField : 'action',
1495                                         xtype : 'ComboBox',
1496                                         allowBlank : true,
1497                                         typeAhead : true,
1498                                         editable : true,
1499                                         width : 150,
1500                                         xns : Roo.form,
1501                                         name : 'on_table',
1502                                         qtip : "Select Action",
1503                                         queryParam : 'query[on_table]',
1504                                         tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{on_table}</b> </div>',
1505                                         loadingText : "Searching...",
1506                                         listeners : {
1507                                                 render : function (_self)
1508                                                    {
1509                                                      _this.affectSel = _self;
1510                                                    },
1511                                                 select : function (combo, record, index)
1512                                                    {
1513                                                      _this.grid.footer.onClick('first');
1514                                                    }
1515                                         },
1516                                         items : [
1517
1518                                         ]
1519
1520                                     },
1521                                         {
1522                                         '|xns' : 'Roo.Toolbar',
1523                                         text : "Date Range",
1524                                         xtype : 'TextItem',
1525                                         xns : Roo.Toolbar
1526                                     },
1527                                         {
1528                                         '|xns' : 'Roo.form',
1529                                         format : 'Y-m-d',
1530                                         xtype : 'DateField',
1531                                         xns : Roo.form,
1532                                         listeners : {
1533                                                 render : function (_self)
1534                                                    {
1535                                                      _this.dateFrom = _self;
1536                                                    },
1537                                                 change : function (_self, newValue, oldValue)
1538                                                    {
1539                                                      _this.grid.footer.onClick('first');
1540                                                    }
1541                                         }
1542                                     },
1543                                         {
1544                                         '|xns' : 'Roo.form',
1545                                         format : 'Y-m-d',
1546                                         xtype : 'DateField',
1547                                         xns : Roo.form,
1548                                         listeners : {
1549                                                 render : function (_self)
1550                                                    {
1551                                                      _this.dateTo = _self;
1552                                                    },
1553                                                 change : function (_self, newValue, oldValue)
1554                                                    {
1555                                                      _this.grid.footer.onClick('first');
1556                                                    }
1557                                         }
1558                                     }
1559                                 ]
1560
1561                             },
1562                             '|xns' : 'Roo.grid',
1563                             autoExpandColumn : 'remarks',
1564                             xtype : 'Grid',
1565                             loadMask : true,
1566                             xns : Roo.grid,
1567                             colModel : [
1568                                  {
1569                                         '|xns' : 'Roo.grid',
1570                                         xtype : 'ColumnModel',
1571                                         header : 'When',
1572                                         width : 100,
1573                                         renderer : function(v) { return v ? v.dateFormat('d/m/Y H:i') : ''; },
1574                                         xns : Roo.grid,
1575                                         dataIndex : 'event_when'
1576                                     },
1577 {
1578                                         '|xns' : 'Roo.grid',
1579                                         xtype : 'ColumnModel',
1580                                         header : '#id',
1581                                         width : 100,
1582                                         xns : Roo.grid,
1583                                         dataIndex : 'id'
1584                                     },
1585 {
1586                                         '|xns' : 'Roo.grid',
1587                                         xtype : 'ColumnModel',
1588                                         header : 'Staff',
1589                                         width : 150,
1590                                         renderer : function(v,x,r) { 
1591                                             
1592                                             var efield = typeof(_this.email_field) == 'undefined' ? 'person_id_email' : _this.email_field;
1593                                             var nfield = typeof(_this.name_field) == 'undefined' ? 'person_id_name' : _this.name_field;    
1594                                             
1595                                             Roo.log([r, efield, nfield]);
1596                                             
1597                                             var email = r.json[efield]; // ? r.data.person_id_email : r.data.person_id_email;
1598                                             var name  = r.json[nfield]; // ? r.data.person_id_name : r.data.person_id_name;    
1599                                             return String.format('{0} &lt;<a href="mailto:{1}">{1}</a>&gt;', 
1600                                                 name, email); 
1601                                         
1602                                         
1603                                         },
1604                                         xns : Roo.grid,
1605                                         dataIndex : 'person_id_name'
1606                                     },
1607 {
1608                                         '|xns' : 'Roo.grid',
1609                                         xtype : 'ColumnModel',
1610                                         width : 100,
1611                                         header : 'Action',
1612                                         renderer : function(v) { return String.format('{0}', v); },
1613                                         xns : Roo.grid,
1614                                         dataIndex : 'action'
1615                                     },
1616 {
1617                                         '|xns' : 'Roo.grid',
1618                                         xtype : 'ColumnModel',
1619                                         width : 100,
1620                                         header : 'IP',
1621                                         renderer : function(v) { return String.format('{0}', v); },
1622                                         xns : Roo.grid,
1623                                         dataIndex : 'ipaddr'
1624                                     },
1625 {
1626                                         '|xns' : 'Roo.grid',
1627                                         xtype : 'ColumnModel',
1628                                         header : 'Affected',
1629                                         width : 100,
1630                                         renderer : function(v, x, r) {                     
1631                                                     return v ? String.format('{0}({1})', v,  r.data.on_id)  : '';  
1632                                            },
1633                                         xns : Roo.grid,
1634                                         dataIndex : 'on_table'
1635                                     },
1636 {
1637                                         '|xns' : 'Roo.grid',
1638                                         xtype : 'ColumnModel',
1639                                         header : 'Remarks',
1640                                         width : 300,
1641                                         renderer : function(v) { return String.format('<span qtip="{1}">{0}</span>', v, Roo.util.Format.htmlEncode(v)); },
1642                                         xns : Roo.grid,
1643                                         dataIndex : 'remarks'
1644                                     }
1645                             ],
1646                             listeners : {
1647                                 render : function() { 
1648                                        _this.grid = this; 
1649                                        //_this.dialog = Pman.Dialog.FILL_IN
1650                                        if (_this.panel.active) {
1651                                           this.footer.onClick('first');
1652                                        }
1653                                    }
1654                             },
1655                             items : [
1656
1657                             ]
1658
1659                         },
1660                         '|xns' : 'Roo',
1661                         fitToframe : true,
1662                         background : false,
1663                         region : 'center',
1664                         title : "Events",
1665                         xtype : 'GridPanel',
1666                         fitContainer : true,
1667                         xns : Roo,
1668                         tableName : 'Events',
1669                         listeners : {
1670                                 activate : function() {
1671                                        _this.panel = this;
1672                                        if (_this.grid) {
1673                                            _this.grid.footer.onClick('first');
1674                                        }
1675                                    }
1676                         },
1677                         items : [
1678
1679                         ]
1680
1681                     }
1682                 ]
1683
1684             },
1685             '|xns' : 'Roo',
1686             region : 'center',
1687             xtype : 'NestedLayoutPanel',
1688             title : "Events",
1689             xns : Roo,
1690             items : [
1691
1692             ]
1693
1694         };    }
1695 });