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