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