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