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