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