Pman.Tab.AdminLogDrill.bjs
[Pman.Admin] / Pman.Tab.AdminLogDrill.js
1 //<script type="text/javascript">
2
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
4
5
6
7 // register the module first
8 Pman.on('beforeload', function()
9 {
10     Pman.register({
11         part :  ["Admin","LogDrill"],
12         modKey : '003-Pman.Tab.AdminLogDrill',
13         module : Pman.Tab.AdminLogDrill,
14         region : 'center',
15         parent : Pman.Tab.AdminLogs,
16         name : "Pman.Tab.AdminLogDrill",
17         disabled : false, 
18         permname: '' 
19     });
20 });
21
22 Pman.Tab.AdminLogDrill = new Roo.util.Observable({
23
24     panel : false,
25     disabled : false,
26     parentLayout:  false,
27
28     add : function(parentLayout, region)
29     {
30
31         var _this = this;
32         this.parentLayout = parentLayout;
33
34         this.panel = parentLayout.addxtype({
35             xtype: 'NestedLayoutPanel',
36             xns: Roo,
37             region : 'center',
38             title : "Event Drilldown",
39             layout : {
40                 xtype: 'BorderLayout',
41                 xns: Roo,
42                 items : [
43                     {
44                         xtype: 'GridPanel',
45                         xns: Roo,
46                         listeners : {
47                             activate : function() {
48                                 _this.datepanel = this;
49                                 if (_this.dategrid) {
50                                     _this.dategrid.ds.load({});
51                                 }
52                             }
53                         },
54                         background : true,
55                         fitContainer : true,
56                         fitToframe : true,
57                         region : 'west',
58                         tableName : 'Events',
59                         title : "Events",
60                         grid : {
61                             xtype: 'Grid',
62                             xns: Roo.grid,
63                             listeners : {
64                                 render : function() 
65                                 {
66                                     _this.dategrid = this; 
67                                     //_this.dialog = Pman.Dialog.FILL_IN
68                                     if (_this.panel.active) {
69                                        this.ds.load({});
70                                     }
71                                 }
72                             },
73                             autoExpandColumn : 'person_name',
74                             loadMask : true,
75                             dataSource : {
76                                 xtype: 'Store',
77                                 xns: Roo.data,
78                                 listeners : {
79                                     beforeload : function (_self, options)
80                                     {
81                                         if (! _this.dateFrom) {
82                                          return;
83                                         }
84                                         o.params = o.params || {};
85                                          
86                                      
87                                         act = _this.dateFrom.getValue();
88                                         if (act.format) {
89                                             o.params['query[from]'] = act.format('Y-m-d');
90                                         }
91                                         act = _this.dateTo.getValue();
92                                         if (act.format) {
93                                             o.params['query[to]'] = act.format('Y-m-d');
94                                         }
95                                         o.params['query[person_sum]'] = 1;
96                                         o.params._columns = 'person_id_name,qty';
97                                      
98                                     }
99                                 },
100                                 remoteSort : true,
101                                 sortInfo : { field : 'person_name', direction: 'ASC' },
102                                 proxy : {
103                                     xtype: 'HttpProxy',
104                                     xns: Roo.data,
105                                     method : 'GET',
106                                     url : baseURL + '/Roo/Events.php'
107                                 },
108                                 reader : {
109                                     xtype: 'JsonReader',
110                                     xns: Roo.data,
111                                     totalProperty : 'total',
112                                     root : 'data',
113                                     id : 'id',
114                                     fields : [
115                                         {
116                                             'name': 'id',
117                                             'type': 'int'
118                                         },
119                                         {
120                                             'name': 'person_name',
121                                             'type': 'string'
122                                         },
123                                         {
124                                             'name': 'event_when',
125                                             'type': 'date',
126                                             'dateFormat': 'Y-m-d'
127                                         },
128                                         {
129                                             'name': 'action',
130                                             'type': 'string'
131                                         },
132                                         {
133                                             'name': 'ipaddr',
134                                             'type': 'string'
135                                         },
136                                         {
137                                             'name': 'on_id',
138                                             'type': 'int'
139                                         },
140                                         {
141                                             'name': 'on_table',
142                                             'type': 'string'
143                                         },
144                                         {
145                                             'name': 'person_id',
146                                             'type': 'int'
147                                         },
148                                         {
149                                             'name': 'remarks',
150                                             'type': 'string'
151                                         },
152                                         {
153                                             'name': 'person_id_id',
154                                             'type': 'int'
155                                         },
156                                         {
157                                             'name': 'person_id_office_id',
158                                             'type': 'int'
159                                         },
160                                         {
161                                             'name': 'person_id_name',
162                                             'type': 'string'
163                                         },
164                                         {
165                                             'name': 'person_id_phone',
166                                             'type': 'string'
167                                         },
168                                         {
169                                             'name': 'person_id_fax',
170                                             'type': 'string'
171                                         },
172                                         {
173                                             'name': 'person_id_email',
174                                             'type': 'string'
175                                         },
176                                         {
177                                             'name': 'person_id_company_id',
178                                             'type': 'int'
179                                         },
180                                         {
181                                             'name': 'person_id_role',
182                                             'type': 'string'
183                                         },
184                                         {
185                                             'name': 'person_id_active',
186                                             'type': 'int'
187                                         },
188                                         {
189                                             'name': 'person_id_remarks',
190                                             'type': 'string'
191                                         },
192                                         {
193                                             'name': 'person_id_passwd',
194                                             'type': 'string'
195                                         },
196                                         {
197                                             'name': 'person_id_owner_id',
198                                             'type': 'int'
199                                         },
200                                         {
201                                             'name': 'person_id_lang',
202                                             'type': 'string'
203                                         },
204                                         {
205                                             'name': 'person_id_no_reset_sent',
206                                             'type': 'int'
207                                         },
208                                         {
209                                             'name': 'person_id_action_type',
210                                             'type': 'string'
211                                         },
212                                         {
213                                             'name': 'person_id_project_id',
214                                             'type': 'int'
215                                         },
216                                         {
217                                             'name': 'person_id_deleted_by',
218                                             'type': 'int'
219                                         },
220                                         {
221                                             'name': 'person_id_deleted_dt',
222                                             'type': 'date'
223                                         }
224                                     ]
225                                 }
226                             },
227                             toolbar : {
228                                 xtype: 'Toolbar',
229                                 xns: Roo,
230                                 items : [
231                                     {
232                                         xtype: 'TextItem',
233                                         xns: Roo.Toolbar,
234                                         text : "Date Range"
235                                     },
236                                     {
237                                         xtype: 'DateField',
238                                         xns: Roo.form,
239                                         listeners : {
240                                             render : function (_self)
241                                             {
242                                               _this.dateTo = _self;
243                                             },
244                                             change : function (_self, newValue, oldValue)
245                                             {
246                                               _this.grid.footer.onClick('first');
247                                             }
248                                         },
249                                         format : 'Y-m-d'
250                                     },
251                                     {
252                                         xtype: 'DateField',
253                                         xns: Roo.form,
254                                         listeners : {
255                                             render : function (_self)
256                                             {
257                                               _this.dateFrom = _self;
258                                             },
259                                             change : function (_self, newValue, oldValue)
260                                             {
261                                               _this.grid.footer.onClick('first');
262                                             }
263                                         },
264                                         format : 'Y-m-d'
265                                     }
266                                 ]
267                             },
268                             colModel : [
269                                 {
270                                     xtype: 'ColumnModel',
271                                     xns: Roo.grid,
272                                     header : 'Person name',
273                                     width : 200,
274                                     dataIndex : 'person_name',
275                                     renderer : function(v) { return String.format('{0}', v); }
276                                 },
277                                 {
278                                     xtype: 'ColumnModel',
279                                     xns: Roo.grid,
280                                     dataIndex : 'qty',
281                                     header : 'Changes',
282                                     width : 70,
283                                     renderer : function(v) { return String.format('{0}', v); }
284                                 }
285                             ]
286                         }
287                     },
288                     {
289                         xtype: 'GridPanel',
290                         xns: Roo,
291                         listeners : {
292                             activate : function() {
293                                 _this.tablepanel = this;
294                                 if (_this.tablegrid) {
295                                     _this.tablegrid.footer.onClick('first');
296                                 }
297                             }
298                         },
299                         background : true,
300                         fitContainer : true,
301                         fitToframe : true,
302                         region : 'center',
303                         tableName : 'Events',
304                         title : "Events",
305                         grid : {
306                             xtype: 'Grid',
307                             xns: Roo.grid,
308                             listeners : {
309                                 render : function() 
310                                 {
311                                     _this.tablegrid = this; 
312                                     //_this.dialog = Pman.Dialog.FILL_IN
313                                     if (_this.tablepanel.active) {
314                                        this.footer.onClick('first');
315                                     }
316                                 },
317                                 rowdblclick : function (_self, rowIndex, e)
318                                 {
319                                     if (!_this.dialog) return;
320                                     _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
321                                         _this.grid.footer.onClick('first');
322                                     }); 
323                                 }
324                             },
325                             autoExpandColumn : 'person_name',
326                             loadMask : true,
327                             dataSource : {
328                                 xtype: 'Store',
329                                 xns: Roo.data,
330                                 remoteSort : true,
331                                 sortInfo : { field : 'person_name', direction: 'ASC' },
332                                 proxy : {
333                                     xtype: 'HttpProxy',
334                                     xns: Roo.data,
335                                     method : 'GET',
336                                     url : baseURL + '/Roo/Events.php'
337                                 },
338                                 reader : {
339                                     xtype: 'JsonReader',
340                                     xns: Roo.data,
341                                     totalProperty : 'total',
342                                     root : 'data',
343                                     id : 'id',
344                                     fields : [
345                                         {
346                                             'name': 'id',
347                                             'type': 'int'
348                                         },
349                                         {
350                                             'name': 'person_name',
351                                             'type': 'string'
352                                         },
353                                         {
354                                             'name': 'event_when',
355                                             'type': 'date',
356                                             'dateFormat': 'Y-m-d'
357                                         },
358                                         {
359                                             'name': 'action',
360                                             'type': 'string'
361                                         },
362                                         {
363                                             'name': 'ipaddr',
364                                             'type': 'string'
365                                         },
366                                         {
367                                             'name': 'on_id',
368                                             'type': 'int'
369                                         },
370                                         {
371                                             'name': 'on_table',
372                                             'type': 'string'
373                                         },
374                                         {
375                                             'name': 'person_id',
376                                             'type': 'int'
377                                         },
378                                         {
379                                             'name': 'remarks',
380                                             'type': 'string'
381                                         },
382                                         {
383                                             'name': 'person_id_id',
384                                             'type': 'int'
385                                         },
386                                         {
387                                             'name': 'person_id_office_id',
388                                             'type': 'int'
389                                         },
390                                         {
391                                             'name': 'person_id_name',
392                                             'type': 'string'
393                                         },
394                                         {
395                                             'name': 'person_id_phone',
396                                             'type': 'string'
397                                         },
398                                         {
399                                             'name': 'person_id_fax',
400                                             'type': 'string'
401                                         },
402                                         {
403                                             'name': 'person_id_email',
404                                             'type': 'string'
405                                         },
406                                         {
407                                             'name': 'person_id_company_id',
408                                             'type': 'int'
409                                         },
410                                         {
411                                             'name': 'person_id_role',
412                                             'type': 'string'
413                                         },
414                                         {
415                                             'name': 'person_id_active',
416                                             'type': 'int'
417                                         },
418                                         {
419                                             'name': 'person_id_remarks',
420                                             'type': 'string'
421                                         },
422                                         {
423                                             'name': 'person_id_passwd',
424                                             'type': 'string'
425                                         },
426                                         {
427                                             'name': 'person_id_owner_id',
428                                             'type': 'int'
429                                         },
430                                         {
431                                             'name': 'person_id_lang',
432                                             'type': 'string'
433                                         },
434                                         {
435                                             'name': 'person_id_no_reset_sent',
436                                             'type': 'int'
437                                         },
438                                         {
439                                             'name': 'person_id_action_type',
440                                             'type': 'string'
441                                         },
442                                         {
443                                             'name': 'person_id_project_id',
444                                             'type': 'int'
445                                         },
446                                         {
447                                             'name': 'person_id_deleted_by',
448                                             'type': 'int'
449                                         },
450                                         {
451                                             'name': 'person_id_deleted_dt',
452                                             'type': 'date'
453                                         }
454                                     ]
455                                 }
456                             },
457                             footer : {
458                                 xtype: 'PagingToolbar',
459                                 xns: Roo,
460                                 pageSize : 25,
461                                 displayInfo : true,
462                                 displayMsg : "Displaying Events{0} - {1} of {2}",
463                                 emptyMsg : "No Events found"
464                             },
465                             toolbar : {
466                                 xtype: 'Toolbar',
467                                 xns: Roo,
468                                 items : [
469                                     {
470                                         xtype: 'ComboBox',
471                                         xns: Roo.form,
472                                         listeners : {
473                                             select : function (combo, record, index)
474                                             {
475                                               _this.grid.footer.onClick('first');
476                                             },
477                                             render : function (_self)
478                                             {
479                                               _this.actionSel = _self;
480                                             }
481                                         },
482                                         allowBlank : true,
483                                         displayField : 'action',
484                                         editable : false,
485                                         emptyText : "Select Action",
486                                         forceSelection : true,
487                                         listWidth : 300,
488                                         loadingText : "Searching...",
489                                         minChars : 2,
490                                         name : 'action',
491                                         pageSize : 20,
492                                         qtip : "Select Action",
493                                         queryParam : 'query[action]',
494                                         selectOnFocus : true,
495                                         tpl : '<div class="x-grid-cell-text x-btn button"><b>{action}</b> </div>',
496                                         triggerAction : 'all',
497                                         typeAhead : true,
498                                         valueField : 'action',
499                                         width : 150,
500                                         store : {
501                                             xtype: 'Store',
502                                             xns: Roo.data,
503                                             listeners : {
504                                                 beforeload : function (_self, o)
505                                                 {
506                                                     o.params = o.params || {};
507                                                     // staff can see all logs, other companies can only see their own.
508                                                     if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
509                                                         o.params.company_id = Pman.Login.authUser.company_id;
510                                                     }
511                                                     o.params._distinct = 'action';
512                                                     o.params._columns ='action';
513                                                 }
514                                             },
515                                             remoteSort : true,
516                                             sortInfo : { field : 'action' , direction : 'ASC' },
517                                             proxy : {
518                                                 xtype: 'HttpProxy',
519                                                 xns: Roo.data,
520                                                 method : 'GET',
521                                                 url : baseURL + '/Roo/Events.php'
522                                             },
523                                             reader : {
524                                                 xtype: 'JsonReader',
525                                                 xns: Roo.data,
526                                                 totalProperty : 'total',
527                                                 root : 'data',
528                                                 id : 'id',
529                                                 fields : [
530                                                     {
531                                                         'name': 'id',
532                                                         'type': 'int'
533                                                     },
534                                                     {
535                                                         'name': 'person_name',
536                                                         'type': 'string'
537                                                     },
538                                                     {
539                                                         'name': 'event_when',
540                                                         'type': 'date',
541                                                         'dateFormat': 'Y-m-d'
542                                                     },
543                                                     {
544                                                         'name': 'action',
545                                                         'type': 'string'
546                                                     },
547                                                     {
548                                                         'name': 'ipaddr',
549                                                         'type': 'string'
550                                                     },
551                                                     {
552                                                         'name': 'on_id',
553                                                         'type': 'int'
554                                                     },
555                                                     {
556                                                         'name': 'on_table',
557                                                         'type': 'string'
558                                                     },
559                                                     {
560                                                         'name': 'person_id',
561                                                         'type': 'int'
562                                                     },
563                                                     {
564                                                         'name': 'remarks',
565                                                         'type': 'string'
566                                                     },
567                                                     {
568                                                         'name': 'person_id_id',
569                                                         'type': 'int'
570                                                     },
571                                                     {
572                                                         'name': 'person_id_office_id',
573                                                         'type': 'int'
574                                                     },
575                                                     {
576                                                         'name': 'person_id_name',
577                                                         'type': 'string'
578                                                     },
579                                                     {
580                                                         'name': 'person_id_phone',
581                                                         'type': 'string'
582                                                     },
583                                                     {
584                                                         'name': 'person_id_fax',
585                                                         'type': 'string'
586                                                     },
587                                                     {
588                                                         'name': 'person_id_email',
589                                                         'type': 'string'
590                                                     },
591                                                     {
592                                                         'name': 'person_id_company_id',
593                                                         'type': 'int'
594                                                     },
595                                                     {
596                                                         'name': 'person_id_role',
597                                                         'type': 'string'
598                                                     },
599                                                     {
600                                                         'name': 'person_id_active',
601                                                         'type': 'int'
602                                                     },
603                                                     {
604                                                         'name': 'person_id_remarks',
605                                                         'type': 'string'
606                                                     },
607                                                     {
608                                                         'name': 'person_id_passwd',
609                                                         'type': 'string'
610                                                     },
611                                                     {
612                                                         'name': 'person_id_owner_id',
613                                                         'type': 'int'
614                                                     },
615                                                     {
616                                                         'name': 'person_id_lang',
617                                                         'type': 'string'
618                                                     },
619                                                     {
620                                                         'name': 'person_id_no_reset_sent',
621                                                         'type': 'int'
622                                                     },
623                                                     {
624                                                         'name': 'person_id_action_type',
625                                                         'type': 'string'
626                                                     },
627                                                     {
628                                                         'name': 'person_id_project_id',
629                                                         'type': 'int'
630                                                     },
631                                                     {
632                                                         'name': 'person_id_deleted_by',
633                                                         'type': 'int'
634                                                     },
635                                                     {
636                                                         'name': 'person_id_deleted_dt',
637                                                         'type': 'date'
638                                                     }
639                                                 ]
640                                             }
641                                         }
642                                     },
643                                     {
644                                         xtype: 'ComboBox',
645                                         xns: Roo.form,
646                                         listeners : {
647                                             select : function (combo, record, index)
648                                             {
649                                               _this.grid.footer.onClick('first');
650                                             },
651                                             render : function (_self)
652                                             {
653                                               _this.affectSel = _self;
654                                             }
655                                         },
656                                         allowBlank : true,
657                                         displayField : 'on_table',
658                                         editable : false,
659                                         emptyText : "Select Affects",
660                                         forceSelection : true,
661                                         listWidth : 300,
662                                         loadingText : "Searching...",
663                                         minChars : 2,
664                                         name : 'on_table',
665                                         pageSize : 20,
666                                         qtip : "Select Action",
667                                         queryParam : 'query[on_table]',
668                                         selectOnFocus : true,
669                                         tpl : '<div class="x-grid-cell-text x-btn button"><b>{on_table}</b> </div>',
670                                         triggerAction : 'all',
671                                         typeAhead : true,
672                                         valueField : 'action',
673                                         width : 150,
674                                         store : {
675                                             xtype: 'Store',
676                                             xns: Roo.data,
677                                             listeners : {
678                                                 beforeload : function (_self, o)
679                                                 {
680                                                     o.params = o.params || {};
681                                                     // staff can see all logs, other companies can only see their own.
682                                                     if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
683                                                         o.params.company_id = Pman.Login.authUser.company_id;
684                                                     }
685                                                     o.params._distinct = 'on_table';
686                                                     o.params._columns ='on_table';
687                                                 }
688                                             },
689                                             remoteSort : true,
690                                             sortInfo : { field : 'on_table' , direction : 'ASC' },
691                                             proxy : {
692                                                 xtype: 'HttpProxy',
693                                                 xns: Roo.data,
694                                                 method : 'GET',
695                                                 url : baseURL + '/Roo/Events.php'
696                                             },
697                                             reader : {
698                                                 xtype: 'JsonReader',
699                                                 xns: Roo.data,
700                                                 totalProperty : 'total',
701                                                 root : 'data',
702                                                 id : 'id',
703                                                 fields : [
704                                                     {
705                                                         'name': 'id',
706                                                         'type': 'int'
707                                                     },
708                                                     {
709                                                         'name': 'person_name',
710                                                         'type': 'string'
711                                                     },
712                                                     {
713                                                         'name': 'event_when',
714                                                         'type': 'date',
715                                                         'dateFormat': 'Y-m-d'
716                                                     },
717                                                     {
718                                                         'name': 'action',
719                                                         'type': 'string'
720                                                     },
721                                                     {
722                                                         'name': 'ipaddr',
723                                                         'type': 'string'
724                                                     },
725                                                     {
726                                                         'name': 'on_id',
727                                                         'type': 'int'
728                                                     },
729                                                     {
730                                                         'name': 'on_table',
731                                                         'type': 'string'
732                                                     },
733                                                     {
734                                                         'name': 'person_id',
735                                                         'type': 'int'
736                                                     },
737                                                     {
738                                                         'name': 'remarks',
739                                                         'type': 'string'
740                                                     },
741                                                     {
742                                                         'name': 'person_id_id',
743                                                         'type': 'int'
744                                                     },
745                                                     {
746                                                         'name': 'person_id_office_id',
747                                                         'type': 'int'
748                                                     },
749                                                     {
750                                                         'name': 'person_id_name',
751                                                         'type': 'string'
752                                                     },
753                                                     {
754                                                         'name': 'person_id_phone',
755                                                         'type': 'string'
756                                                     },
757                                                     {
758                                                         'name': 'person_id_fax',
759                                                         'type': 'string'
760                                                     },
761                                                     {
762                                                         'name': 'person_id_email',
763                                                         'type': 'string'
764                                                     },
765                                                     {
766                                                         'name': 'person_id_company_id',
767                                                         'type': 'int'
768                                                     },
769                                                     {
770                                                         'name': 'person_id_role',
771                                                         'type': 'string'
772                                                     },
773                                                     {
774                                                         'name': 'person_id_active',
775                                                         'type': 'int'
776                                                     },
777                                                     {
778                                                         'name': 'person_id_remarks',
779                                                         'type': 'string'
780                                                     },
781                                                     {
782                                                         'name': 'person_id_passwd',
783                                                         'type': 'string'
784                                                     },
785                                                     {
786                                                         'name': 'person_id_owner_id',
787                                                         'type': 'int'
788                                                     },
789                                                     {
790                                                         'name': 'person_id_lang',
791                                                         'type': 'string'
792                                                     },
793                                                     {
794                                                         'name': 'person_id_no_reset_sent',
795                                                         'type': 'int'
796                                                     },
797                                                     {
798                                                         'name': 'person_id_action_type',
799                                                         'type': 'string'
800                                                     },
801                                                     {
802                                                         'name': 'person_id_project_id',
803                                                         'type': 'int'
804                                                     },
805                                                     {
806                                                         'name': 'person_id_deleted_by',
807                                                         'type': 'int'
808                                                     },
809                                                     {
810                                                         'name': 'person_id_deleted_dt',
811                                                         'type': 'date'
812                                                     }
813                                                 ]
814                                             }
815                                         }
816                                     }
817                                 ]
818                             },
819                             colModel : [
820                                 {
821                                     xtype: 'ColumnModel',
822                                     xns: Roo.grid,
823                                     dataIndex : 'table_action',
824                                     header : 'Table',
825                                     width : 200,
826                                     renderer : function(v) { return String.format('{0}', v); }
827                                 },
828                                 {
829                                     xtype: 'ColumnModel',
830                                     xns: Roo.grid,
831                                     dataIndex : 'qty',
832                                     header : 'Changes',
833                                     width : 70,
834                                     renderer : function(v) { return String.format('{0}', v); }
835                                 }
836                             ]
837                         }
838                     },
839                     {
840                         xtype: 'GridPanel',
841                         xns: Roo,
842                         listeners : {
843                             activate : function() {
844                                 _this.evpanel = this;
845                                 if (_this.evgrid) {
846                                     _this.evgrid.footer.onClick('first');
847                                 }
848                             }
849                         },
850                         background : true,
851                         fitContainer : true,
852                         fitToframe : true,
853                         region : 'east',
854                         tableName : 'Events',
855                         title : "Events",
856                         grid : {
857                             xtype: 'Grid',
858                             xns: Roo.grid,
859                             listeners : {
860                                 render : function() 
861                                 {
862                                     _this.evgrid = this; 
863                                     //_this.dialog = Pman.Dialog.FILL_IN
864                                     if (_this.evpanel.active) {
865                                        this.footer.onClick('first');
866                                     }
867                                 },
868                                 rowdblclick : function (_self, rowIndex, e)
869                                 {
870                                     if (!_this.dialog) return;
871                                     _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
872                                         _this.grid.footer.onClick('first');
873                                     }); 
874                                 }
875                             },
876                             autoExpandColumn : 'person_name',
877                             loadMask : true,
878                             dataSource : {
879                                 xtype: 'Store',
880                                 xns: Roo.data,
881                                 remoteSort : true,
882                                 sortInfo : { field : 'person_name', direction: 'ASC' },
883                                 proxy : {
884                                     xtype: 'HttpProxy',
885                                     xns: Roo.data,
886                                     method : 'GET',
887                                     url : baseURL + '/Roo/Events.php'
888                                 },
889                                 reader : {
890                                     xtype: 'JsonReader',
891                                     xns: Roo.data,
892                                     totalProperty : 'total',
893                                     root : 'data',
894                                     id : 'id',
895                                     fields : [
896                                         {
897                                             'name': 'id',
898                                             'type': 'int'
899                                         },
900                                         {
901                                             'name': 'person_name',
902                                             'type': 'string'
903                                         },
904                                         {
905                                             'name': 'event_when',
906                                             'type': 'date',
907                                             'dateFormat': 'Y-m-d'
908                                         },
909                                         {
910                                             'name': 'action',
911                                             'type': 'string'
912                                         },
913                                         {
914                                             'name': 'ipaddr',
915                                             'type': 'string'
916                                         },
917                                         {
918                                             'name': 'on_id',
919                                             'type': 'int'
920                                         },
921                                         {
922                                             'name': 'on_table',
923                                             'type': 'string'
924                                         },
925                                         {
926                                             'name': 'person_id',
927                                             'type': 'int'
928                                         },
929                                         {
930                                             'name': 'remarks',
931                                             'type': 'string'
932                                         },
933                                         {
934                                             'name': 'person_id_id',
935                                             'type': 'int'
936                                         },
937                                         {
938                                             'name': 'person_id_office_id',
939                                             'type': 'int'
940                                         },
941                                         {
942                                             'name': 'person_id_name',
943                                             'type': 'string'
944                                         },
945                                         {
946                                             'name': 'person_id_phone',
947                                             'type': 'string'
948                                         },
949                                         {
950                                             'name': 'person_id_fax',
951                                             'type': 'string'
952                                         },
953                                         {
954                                             'name': 'person_id_email',
955                                             'type': 'string'
956                                         },
957                                         {
958                                             'name': 'person_id_company_id',
959                                             'type': 'int'
960                                         },
961                                         {
962                                             'name': 'person_id_role',
963                                             'type': 'string'
964                                         },
965                                         {
966                                             'name': 'person_id_active',
967                                             'type': 'int'
968                                         },
969                                         {
970                                             'name': 'person_id_remarks',
971                                             'type': 'string'
972                                         },
973                                         {
974                                             'name': 'person_id_passwd',
975                                             'type': 'string'
976                                         },
977                                         {
978                                             'name': 'person_id_owner_id',
979                                             'type': 'int'
980                                         },
981                                         {
982                                             'name': 'person_id_lang',
983                                             'type': 'string'
984                                         },
985                                         {
986                                             'name': 'person_id_no_reset_sent',
987                                             'type': 'int'
988                                         },
989                                         {
990                                             'name': 'person_id_action_type',
991                                             'type': 'string'
992                                         },
993                                         {
994                                             'name': 'person_id_project_id',
995                                             'type': 'int'
996                                         },
997                                         {
998                                             'name': 'person_id_deleted_by',
999                                             'type': 'int'
1000                                         },
1001                                         {
1002                                             'name': 'person_id_deleted_dt',
1003                                             'type': 'date'
1004                                         }
1005                                     ]
1006                                 }
1007                             },
1008                             footer : {
1009                                 xtype: 'PagingToolbar',
1010                                 xns: Roo,
1011                                 pageSize : 25,
1012                                 displayInfo : true,
1013                                 displayMsg : "Displaying Events{0} - {1} of {2}",
1014                                 emptyMsg : "No Events found"
1015                             },
1016                             toolbar : {
1017                                 xtype: 'Toolbar',
1018                                 xns: Roo,
1019                                 items : [
1020                                     {
1021                                         xtype: 'TextItem',
1022                                         xns: Roo.Toolbar,
1023                                         text : "Show"
1024                                     }
1025                                 ]
1026                             },
1027                             colModel : [
1028                                 {
1029                                     xtype: 'ColumnModel',
1030                                     xns: Roo.grid,
1031                                     dataIndex : 'table_action',
1032                                     header : 'Table',
1033                                     width : 200,
1034                                     renderer : function(v) { return String.format('{0}', v); }
1035                                 },
1036                                 {
1037                                     xtype: 'ColumnModel',
1038                                     xns: Roo.grid,
1039                                     dataIndex : 'qty',
1040                                     header : 'Changes',
1041                                     width : 70,
1042                                     renderer : function(v) { return String.format('{0}', v); }
1043                                 }
1044                             ]
1045                         }
1046                     }
1047                 ],
1048                 west : {
1049                     xtype: 'LayoutRegion',
1050                     xns: Roo,
1051                     split : true,
1052                     width : 300
1053                 },
1054                 center : {
1055                     xtype: 'LayoutRegion',
1056                     xns: Roo
1057                 },
1058                 east : {
1059                     xtype: 'LayoutRegion',
1060                     xns: Roo,
1061                     split : true,
1062                     width : 400
1063                 }
1064             }
1065         });
1066         this.layout = this.panel.layout;
1067
1068     }
1069 });