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           allowBlank : true,
378           alwaysQuery : true,
379           displayField : 'value',
380           editable : false,
381           emptyText : _this._strings['037fd50b0e85bb65995ca7125d06c7cd'],
382           forceSelection : true,
383           listWidth : 300,
384           loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'],
385           minChars : 2,
386           name : 'person_table',
387           pageSize : 20,
388           qtip : _this._strings['037fd50b0e85bb65995ca7125d06c7cd'],
389           selectOnFocus : true,
390           tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{value}</b> </div>',
391           triggerAction : 'all',
392           typeAhead : true,
393           valueField : 'value',
394           width : 150,
395           xns : Roo.form,
396           xtype : 'ComboBox',
397           listeners : {
398            render : function (_self)
399             {
400                 _this.tableSel = _self;
401               
402                 //this.el.setVisibilityMode(Roo.Element.DISPLAY);
403                 /*
404                 if(
405                     typeof(uiConfig) == 'undefined' || 
406                     typeof(uiConfig.events_person_table) == 'undefined' || 
407                     !uiConfig.events_person_table.length
408                 ){
409                     Roo.log(this.getActionEl);
410                     this.actionMode = 'fieldEl';
411                     this.hideMode = 'display';
412                     this.el.hide();
413                 }
414                 */
415             },
416            select : function (combo, record, index)
417             {
418               _this.grid.footer.onClick('first');
419             }
420           },
421           items : [
422
423           ]
424
425          },
426          {
427           store : {
428            proxy : {
429             '|xns' : 'Roo.data',
430             method : 'GET',
431             url : baseURL + '/Roo/Person.php',
432             xns : Roo.data,
433             xtype : 'HttpProxy'
434            },
435            reader : {
436             '|xns' : 'Roo.data',
437             fields : [
438                 {
439                     'name': 'id',
440                     'type': 'int'
441                 },
442                 {
443                     'name': 'office_id',
444                     'type': 'int'
445                 },
446                 {
447                     'name': 'name',
448                     'type': 'string'
449                 },
450                 {
451                     'name': 'phone',
452                     'type': 'string'
453                 },
454                 {
455                     'name': 'fax',
456                     'type': 'string'
457                 },
458                 {
459                     'name': 'email',
460                     'type': 'string'
461                 },
462                 {
463                     'name': 'company_id',
464                     'type': 'int'
465                 },
466                 {
467                     'name': 'role',
468                     'type': 'string'
469                 },
470                 {
471                     'name': 'active',
472                     'type': 'int'
473                 },
474                 {
475                     'name': 'remarks',
476                     'type': 'string'
477                 },
478                 {
479                     'name': 'passwd',
480                     'type': 'string'
481                 },
482                 {
483                     'name': 'owner_id',
484                     'type': 'int'
485                 },
486                 {
487                     'name': 'lang',
488                     'type': 'string'
489                 },
490                 {
491                     'name': 'no_reset_sent',
492                     'type': 'int'
493                 },
494                 {
495                     'name': 'action_type',
496                     'type': 'string'
497                 },
498                 {
499                     'name': 'project_id',
500                     'type': 'int'
501                 },
502                 {
503                     'name': 'deleted_by',
504                     'type': 'int'
505                 },
506                 {
507                     'name': 'deleted_dt',
508                     'type': 'date',
509                     'dateFormat': 'Y-m-d'
510                 },
511                 {
512                     'name': 'office_id_id',
513                     'type': 'int'
514                 },
515                 {
516                     'name': 'office_id_company_id',
517                     'type': 'int'
518                 },
519                 {
520                     'name': 'office_id_name',
521                     'type': 'string'
522                 },
523                 {
524                     'name': 'office_id_address',
525                     'type': 'string'
526                 },
527                 {
528                     'name': 'office_id_phone',
529                     'type': 'string'
530                 },
531                 {
532                     'name': 'office_id_fax',
533                     'type': 'string'
534                 },
535                 {
536                     'name': 'office_id_email',
537                     'type': 'string'
538                 },
539                 {
540                     'name': 'office_id_role',
541                     'type': 'string'
542                 },
543                 {
544                     'name': 'company_id_code',
545                     'type': 'string'
546                 },
547                 {
548                     'name': 'company_id_name',
549                     'type': 'string'
550                 },
551                 {
552                     'name': 'company_id_remarks',
553                     'type': 'string'
554                 },
555                 {
556                     'name': 'company_id_owner_id',
557                     'type': 'int'
558                 },
559                 {
560                     'name': 'company_id_address',
561                     'type': 'string'
562                 },
563                 {
564                     'name': 'company_id_tel',
565                     'type': 'string'
566                 },
567                 {
568                     'name': 'company_id_fax',
569                     'type': 'string'
570                 },
571                 {
572                     'name': 'company_id_email',
573                     'type': 'string'
574                 },
575                 {
576                     'name': 'company_id_id',
577                     'type': 'int'
578                 },
579                 {
580                     'name': 'company_id_isOwner',
581                     'type': 'int'
582                 },
583                 {
584                     'name': 'company_id_logo_id',
585                     'type': 'int'
586                 },
587                 {
588                     'name': 'company_id_background_color',
589                     'type': 'string'
590                 },
591                 {
592                     'name': 'company_id_comptype',
593                     'type': 'string'
594                 },
595                 {
596                     'name': 'company_id_url',
597                     'type': 'string'
598                 },
599                 {
600                     'name': 'company_id_main_office_id',
601                     'type': 'int'
602                 },
603                 {
604                     'name': 'company_id_created_by',
605                     'type': 'int'
606                 },
607                 {
608                     'name': 'company_id_created_dt',
609                     'type': 'date'
610                 },
611                 {
612                     'name': 'company_id_updated_by',
613                     'type': 'int'
614                 },
615                 {
616                     'name': 'company_id_updated_dt',
617                     'type': 'date'
618                 },
619                 {
620                     'name': 'company_id_passwd',
621                     'type': 'string'
622                 },
623                 {
624                     'name': 'company_id_dispatch_port',
625                     'type': 'string'
626                 },
627                 {
628                     'name': 'company_id_province',
629                     'type': 'string'
630                 },
631                 {
632                     'name': 'company_id_country',
633                     'type': 'string'
634                 },
635                 {
636                     'name': 'project_id_id',
637                     'type': 'int'
638                 },
639                 {
640                     'name': 'project_id_name',
641                     'type': 'string'
642                 },
643                 {
644                     'name': 'project_id_remarks',
645                     'type': 'string'
646                 },
647                 {
648                     'name': 'project_id_owner_id',
649                     'type': 'int'
650                 },
651                 {
652                     'name': 'project_id_code',
653                     'type': 'string'
654                 },
655                 {
656                     'name': 'project_id_active',
657                     'type': 'int'
658                 },
659                 {
660                     'name': 'project_id_type',
661                     'type': 'string'
662                 },
663                 {
664                     'name': 'project_id_client_id',
665                     'type': 'int'
666                 },
667                 {
668                     'name': 'project_id_team_id',
669                     'type': 'int'
670                 },
671                 {
672                     'name': 'project_id_file_location',
673                     'type': 'string'
674                 },
675                 {
676                     'name': 'project_id_open_date',
677                     'type': 'date'
678                 },
679                 {
680                     'name': 'project_id_open_by',
681                     'type': 'int'
682                 },
683                 {
684                     'name': 'project_id_close_date',
685                     'type': 'date'
686                 },
687                 {
688                     'name': 'project_id_countries',
689                     'type': 'string'
690                 },
691                 {
692                     'name': 'project_id_languages',
693                     'type': 'string'
694                 },
695                 {
696                     'name': 'project_id_agency_id',
697                     'type': 'int'
698                 },
699                 {
700                     'name': 'owner_id_id',
701                     'type': 'int'
702                 },
703                 {
704                     'name': 'owner_id_office_id',
705                     'type': 'int'
706                 },
707                 {
708                     'name': 'owner_id_name',
709                     'type': 'string'
710                 },
711                 {
712                     'name': 'owner_id_phone',
713                     'type': 'string'
714                 },
715                 {
716                     'name': 'owner_id_fax',
717                     'type': 'string'
718                 },
719                 {
720                     'name': 'owner_id_email',
721                     'type': 'string'
722                 },
723                 {
724                     'name': 'owner_id_company_id',
725                     'type': 'int'
726                 },
727                 {
728                     'name': 'owner_id_role',
729                     'type': 'string'
730                 },
731                 {
732                     'name': 'owner_id_active',
733                     'type': 'int'
734                 },
735                 {
736                     'name': 'owner_id_remarks',
737                     'type': 'string'
738                 },
739                 {
740                     'name': 'owner_id_passwd',
741                     'type': 'string'
742                 },
743                 {
744                     'name': 'owner_id_owner_id',
745                     'type': 'int'
746                 },
747                 {
748                     'name': 'owner_id_lang',
749                     'type': 'string'
750                 },
751                 {
752                     'name': 'owner_id_no_reset_sent',
753                     'type': 'int'
754                 },
755                 {
756                     'name': 'owner_id_action_type',
757                     'type': 'string'
758                 },
759                 {
760                     'name': 'owner_id_project_id',
761                     'type': 'int'
762                 },
763                 {
764                     'name': 'owner_id_deleted_by',
765                     'type': 'int'
766                 },
767                 {
768                     'name': 'owner_id_deleted_dt',
769                     'type': 'date'
770                 }
771             ],
772             id : 'id',
773             root : 'data',
774             totalProperty : 'total',
775             xns : Roo.data,
776             xtype : 'JsonReader'
777            },
778            '|xns' : 'Roo.data',
779            remoteSort : true,
780            sortInfo : { field : 'name' , direction : 'ASC' },
781            xns : Roo.data,
782            xtype : 'Store',
783            listeners : {
784             beforeload : function (_self, o)
785              {
786                  o.params = o.params || {};
787                  o.params.company_id = Pman.Login.authUser.company_id;
788              }
789            },
790            items : [
791
792            ]
793
794           },
795           '|xns' : 'Roo.form',
796           allowBlank : true,
797           displayField : 'name',
798           editable : true,
799           emptyText : _this._strings['fd7535ce3979bb8547e2c01689db0767'],
800           fieldLabel : 'Person ',
801           forceSelection : true,
802           listWidth : 600,
803           loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'],
804           minChars : 2,
805           name : 'person_id_name',
806           pageSize : 20,
807           qtip : _this._strings['fd7535ce3979bb8547e2c01689db0767'],
808           queryParam : 'query[name]',
809           selectOnFocus : true,
810           tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> ({company_id_name}) &lt;{email}&gt; </div>',
811           triggerAction : 'all',
812           typeAhead : true,
813           valueField : 'id',
814           width : 150,
815           xns : Roo.form,
816           xtype : 'ComboBox',
817           listeners : {
818            render : function (_self)
819             {
820               _this.personSel = _self;
821             },
822            select : function (combo, record, index)
823             {
824               _this.grid.footer.onClick('first');
825               
826             }
827           },
828           items : [
829
830           ]
831
832          },
833          {
834           store : {
835            proxy : {
836             '|xns' : 'Roo.data',
837             method : 'GET',
838             url : baseURL + '/Roo/Events.php',
839             xns : Roo.data,
840             xtype : 'HttpProxy'
841            },
842            reader : {
843             '|xns' : 'Roo.data',
844             fields : [
845                 {
846                     'name': 'id',
847                     'type': 'int'
848                 },
849                 {
850                     'name': 'person_name',
851                     'type': 'string'
852                 },
853                 {
854                     'name': 'event_when',
855                     'type': 'date',
856                     'dateFormat': 'Y-m-d'
857                 },
858                 {
859                     'name': 'action',
860                     'type': 'string'
861                 },
862                 {
863                     'name': 'ipaddr',
864                     'type': 'string'
865                 },
866                 {
867                     'name': 'on_id',
868                     'type': 'int'
869                 },
870                 {
871                     'name': 'on_table',
872                     'type': 'string'
873                 },
874                 {
875                     'name': 'person_id',
876                     'type': 'int'
877                 },
878                 {
879                     'name': 'remarks',
880                     'type': 'string'
881                 },
882                 {
883                     'name': 'person_id_id',
884                     'type': 'int'
885                 },
886                 {
887                     'name': 'person_id_office_id',
888                     'type': 'int'
889                 },
890                 {
891                     'name': 'person_id_name',
892                     'type': 'string'
893                 },
894                 {
895                     'name': 'person_id_phone',
896                     'type': 'string'
897                 },
898                 {
899                     'name': 'person_id_fax',
900                     'type': 'string'
901                 },
902                 {
903                     'name': 'person_id_email',
904                     'type': 'string'
905                 },
906                 {
907                     'name': 'person_id_company_id',
908                     'type': 'int'
909                 },
910                 {
911                     'name': 'person_id_role',
912                     'type': 'string'
913                 },
914                 {
915                     'name': 'person_id_active',
916                     'type': 'int'
917                 },
918                 {
919                     'name': 'person_id_remarks',
920                     'type': 'string'
921                 },
922                 {
923                     'name': 'person_id_passwd',
924                     'type': 'string'
925                 },
926                 {
927                     'name': 'person_id_owner_id',
928                     'type': 'int'
929                 },
930                 {
931                     'name': 'person_id_lang',
932                     'type': 'string'
933                 },
934                 {
935                     'name': 'person_id_no_reset_sent',
936                     'type': 'int'
937                 },
938                 {
939                     'name': 'person_id_action_type',
940                     'type': 'string'
941                 },
942                 {
943                     'name': 'person_id_project_id',
944                     'type': 'int'
945                 },
946                 {
947                     'name': 'person_id_deleted_by',
948                     'type': 'int'
949                 },
950                 {
951                     'name': 'person_id_deleted_dt',
952                     'type': 'date'
953                 }
954             ],
955             id : 'id',
956             root : 'data',
957             totalProperty : 'total',
958             xns : Roo.data,
959             xtype : 'JsonReader'
960            },
961            '|xns' : 'Roo.data',
962            remoteSort : true,
963            sortInfo : { field : 'action' , direction : 'ASC' },
964            xns : Roo.data,
965            xtype : 'Store',
966            listeners : {
967             beforeload : function (_self, o)
968              {
969                  o.params = o.params || {};
970                  // staff can see all logs, other companies can only see their own.
971                  if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
972                      o.params.company_id = Pman.Login.authUser.company_id;
973                  }
974                  o.params._distinct = 'action';
975                  o.params._columns ='action';
976              }
977            },
978            items : [
979
980            ]
981
982           },
983           '|xns' : 'Roo.form',
984           allowBlank : true,
985           displayField : 'action',
986           editable : true,
987           emptyText : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'],
988           forceSelection : true,
989           listWidth : 300,
990           loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'],
991           minChars : 2,
992           name : 'action',
993           pageSize : 20,
994           qtip : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'],
995           queryParam : 'query[action]',
996           selectOnFocus : true,
997           tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{action}</b> </div>',
998           triggerAction : 'all',
999           typeAhead : true,
1000           valueField : 'action',
1001           width : 150,
1002           xns : Roo.form,
1003           xtype : 'ComboBox',
1004           listeners : {
1005            render : function (_self)
1006             {
1007               _this.actionSel = _self;
1008             },
1009            select : function (combo, record, index)
1010             {
1011               _this.grid.footer.onClick('first');
1012             }
1013           },
1014           items : [
1015
1016           ]
1017
1018          },
1019          {
1020           store : {
1021            proxy : {
1022             '|xns' : 'Roo.data',
1023             method : 'GET',
1024             url : baseURL + '/Roo/Events.php',
1025             xns : Roo.data,
1026             xtype : 'HttpProxy'
1027            },
1028            reader : {
1029             '|xns' : 'Roo.data',
1030             fields : [
1031                 {
1032                     'name': 'id',
1033                     'type': 'int'
1034                 },
1035                 {
1036                     'name': 'person_name',
1037                     'type': 'string'
1038                 },
1039                 {
1040                     'name': 'event_when',
1041                     'type': 'date',
1042                     'dateFormat': 'Y-m-d'
1043                 },
1044                 {
1045                     'name': 'action',
1046                     'type': 'string'
1047                 },
1048                 {
1049                     'name': 'ipaddr',
1050                     'type': 'string'
1051                 },
1052                 {
1053                     'name': 'on_id',
1054                     'type': 'int'
1055                 },
1056                 {
1057                     'name': 'on_table',
1058                     'type': 'string'
1059                 },
1060                 {
1061                     'name': 'person_id',
1062                     'type': 'int'
1063                 },
1064                 {
1065                     'name': 'remarks',
1066                     'type': 'string'
1067                 },
1068                 {
1069                     'name': 'person_id_id',
1070                     'type': 'int'
1071                 },
1072                 {
1073                     'name': 'person_id_office_id',
1074                     'type': 'int'
1075                 },
1076                 {
1077                     'name': 'person_id_name',
1078                     'type': 'string'
1079                 },
1080                 {
1081                     'name': 'person_id_phone',
1082                     'type': 'string'
1083                 },
1084                 {
1085                     'name': 'person_id_fax',
1086                     'type': 'string'
1087                 },
1088                 {
1089                     'name': 'person_id_email',
1090                     'type': 'string'
1091                 },
1092                 {
1093                     'name': 'person_id_company_id',
1094                     'type': 'int'
1095                 },
1096                 {
1097                     'name': 'person_id_role',
1098                     'type': 'string'
1099                 },
1100                 {
1101                     'name': 'person_id_active',
1102                     'type': 'int'
1103                 },
1104                 {
1105                     'name': 'person_id_remarks',
1106                     'type': 'string'
1107                 },
1108                 {
1109                     'name': 'person_id_passwd',
1110                     'type': 'string'
1111                 },
1112                 {
1113                     'name': 'person_id_owner_id',
1114                     'type': 'int'
1115                 },
1116                 {
1117                     'name': 'person_id_lang',
1118                     'type': 'string'
1119                 },
1120                 {
1121                     'name': 'person_id_no_reset_sent',
1122                     'type': 'int'
1123                 },
1124                 {
1125                     'name': 'person_id_action_type',
1126                     'type': 'string'
1127                 },
1128                 {
1129                     'name': 'person_id_project_id',
1130                     'type': 'int'
1131                 },
1132                 {
1133                     'name': 'person_id_deleted_by',
1134                     'type': 'int'
1135                 },
1136                 {
1137                     'name': 'person_id_deleted_dt',
1138                     'type': 'date'
1139                 }
1140             ],
1141             id : 'id',
1142             root : 'data',
1143             totalProperty : 'total',
1144             xns : Roo.data,
1145             xtype : 'JsonReader'
1146            },
1147            '|xns' : 'Roo.data',
1148            remoteSort : true,
1149            sortInfo : { field : 'on_table' , direction : 'ASC' },
1150            xns : Roo.data,
1151            xtype : 'Store',
1152            listeners : {
1153             beforeload : function (_self, o)
1154              {
1155                  o.params = o.params || {};
1156                  // staff can see all logs, other companies can only see their own.
1157                  if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
1158                      o.params.company_id = Pman.Login.authUser.company_id;
1159                  }
1160                  o.params._distinct = 'on_table';
1161                  o.params._columns ='on_table';
1162              }
1163            },
1164            items : [
1165
1166            ]
1167
1168           },
1169           '|xns' : 'Roo.form',
1170           allowBlank : true,
1171           displayField : 'on_table',
1172           editable : true,
1173           emptyText : _this._strings['679308a758de538c5f39c4c6cdba6593'],
1174           forceSelection : true,
1175           listWidth : 300,
1176           loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'],
1177           minChars : 2,
1178           name : 'on_table',
1179           pageSize : 20,
1180           qtip : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'],
1181           queryParam : 'query[on_table]',
1182           selectOnFocus : true,
1183           tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{on_table}</b> </div>',
1184           triggerAction : 'all',
1185           typeAhead : true,
1186           valueField : 'action',
1187           width : 150,
1188           xns : Roo.form,
1189           xtype : 'ComboBox',
1190           listeners : {
1191            render : function (_self)
1192             {
1193               _this.affectSel = _self;
1194             },
1195            select : function (combo, record, index)
1196             {
1197               _this.grid.footer.onClick('first');
1198             }
1199           },
1200           items : [
1201
1202           ]
1203
1204          },
1205          {
1206           '|xns' : 'Roo.Toolbar',
1207           text : _this._strings['39b9e051f9fe75e65c7a330bb00499d4'],
1208           xns : Roo.Toolbar,
1209           xtype : 'TextItem'
1210          },
1211          {
1212           '|xns' : 'Roo.form',
1213           format : 'Y-m-d',
1214           xns : Roo.form,
1215           xtype : 'DateField',
1216           listeners : {
1217            change : function (_self, newValue, oldValue)
1218             {
1219               _this.grid.footer.onClick('first');
1220             },
1221            render : function (_self)
1222             {
1223               _this.dateFrom = _self;
1224             }
1225           }
1226          },
1227          {
1228           '|xns' : 'Roo.form',
1229           format : 'Y-m-d',
1230           xns : Roo.form,
1231           xtype : 'DateField',
1232           listeners : {
1233            change : function (_self, newValue, oldValue)
1234             {
1235               _this.grid.footer.onClick('first');
1236             },
1237            render : function (_self)
1238             {
1239               _this.dateTo = _self;
1240             }
1241           }
1242          }
1243         ]
1244
1245        },
1246        '|xns' : 'Roo.grid',
1247        autoExpandColumn : 'remarks',
1248        loadMask : true,
1249        xns : Roo.grid,
1250        xtype : 'Grid',
1251        colModel : [
1252          {
1253           '|xns' : 'Roo.grid',
1254           dataIndex : 'event_when',
1255           header : _this._strings['4e97aeeaa8b15ca1180fcd1f3ac478d1'],
1256           renderer : function(v) { return v ? v.dateFormat('d/m/Y H:i') : ''; },
1257           width : 100,
1258           xns : Roo.grid,
1259           xtype : 'ColumnModel'
1260          },
1261 {
1262           '|xns' : 'Roo.grid',
1263           dataIndex : 'id',
1264           header : _this._strings['1b7f7d24575cdbfadb83b9587fa1bf97'],
1265           width : 100,
1266           xns : Roo.grid,
1267           xtype : 'ColumnModel'
1268          },
1269 {
1270           '|xns' : 'Roo.grid',
1271           dataIndex : 'person_id_name',
1272           header : _this._strings['8f7f93630c366dc55aec88eb8e9640d0'],
1273           renderer : function(v,x,r) { 
1274               
1275               var efield = typeof(_this.email_field) == 'undefined' ? 'person_id_email' : _this.email_field;
1276               var nfield = typeof(_this.name_field) == 'undefined' ? 'person_id_name' : _this.name_field;    
1277               
1278               //Roo.log([r, efield, nfield]);
1279               
1280               var email = r.json[efield]; // ? r.data.person_id_email : r.data.person_id_email;
1281               var name  = r.json[nfield]; // ? r.data.person_id_name : r.data.person_id_name;    
1282               return String.format('{0} &lt;<a href="mailto:{1}">{1}</a>&gt;', 
1283                   name, email); 
1284           
1285           
1286           },
1287           width : 150,
1288           xns : Roo.grid,
1289           xtype : 'ColumnModel'
1290          },
1291 {
1292           '|xns' : 'Roo.grid',
1293           dataIndex : 'action',
1294           header : _this._strings['004bf6c9a40003140292e97330236c53'],
1295           renderer : function(v) { return String.format('{0}', v); },
1296           width : 100,
1297           xns : Roo.grid,
1298           xtype : 'ColumnModel'
1299          },
1300 {
1301           '|xns' : 'Roo.grid',
1302           dataIndex : 'ipaddr',
1303           header : _this._strings['a12a3079e14ced46e69ba52b8a90b21a'],
1304           renderer : function(v) { return String.format('{0}', v); },
1305           width : 100,
1306           xns : Roo.grid,
1307           xtype : 'ColumnModel'
1308          },
1309 {
1310           '|xns' : 'Roo.grid',
1311           dataIndex : 'on_table',
1312           header : _this._strings['2c92a9a6a5dbf570825e62eabcdecd8d'],
1313           renderer : function(v, x, r) {                     
1314                       return v ? String.format('{0}({1})', v,  r.data.on_id)  : '';  
1315              },
1316           width : 100,
1317           xns : Roo.grid,
1318           xtype : 'ColumnModel'
1319          },
1320 {
1321           '|xns' : 'Roo.grid',
1322           dataIndex : 'remarks',
1323           header : _this._strings['231bc72756b5e6de492aaaa1577f61b1'],
1324           renderer : function(v) { return String.format('<span qtip="{1}">{0}</span>', v, Roo.util.Format.htmlEncode(v)); },
1325           width : 300,
1326           xns : Roo.grid,
1327           xtype : 'ColumnModel'
1328          }
1329        ],
1330        listeners : {
1331         render : function() { 
1332              _this.grid = this; 
1333              //_this.dialog = Pman.Dialog.FILL_IN
1334              if (_this.panel.active) {
1335                 this.footer.onClick('first');
1336              }
1337          }
1338        },
1339        items : [
1340
1341        ]
1342
1343       },
1344       '|xns' : 'Roo',
1345       background : false,
1346       fitContainer : true,
1347       fitToframe : true,
1348       region : 'center',
1349       tableName : 'Events',
1350       title : _this._strings['87f9f735a1d36793ceaecd4e47124b63'],
1351       xns : Roo,
1352       xtype : 'GridPanel',
1353       listeners : {
1354        activate : function() {
1355             _this.panel = this;
1356             if (_this.grid) {
1357                 _this.grid.footer.onClick('first');
1358             }
1359         }
1360       },
1361       items : [
1362
1363       ]
1364
1365      }
1366     ]
1367
1368    },
1369    '|xns' : 'Roo',
1370    region : 'center',
1371    title : _this._strings['87f9f735a1d36793ceaecd4e47124b63'],
1372    xns : Roo,
1373    xtype : 'NestedLayoutPanel',
1374    items : [
1375
1376    ]
1377
1378   };  }
1379 });