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