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    },
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 : 1,
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 : 'line-height: 34px;',
167                    xns : Roo.bootstrap,
168                    '|xns' : 'Roo.bootstrap'
169                   }
170                  ]
171                 },
172                 {
173                  xtype : 'Column',
174                  md : 2,
175                  xns : Roo.bootstrap,
176                  '|xns' : 'Roo.bootstrap',
177                  items  : [
178                   {
179                    xtype : 'ComboBox',
180                    allowBlank : true,
181                    alwaysQuery : false,
182                    displayField : 'name',
183                    editable : false,
184                    forceSelection : true,
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                  listeners : {
573                   render : function (_self)
574                    {
575                        this.show();
576                        
577                        if(appDisabled.indexOf('Core.SuperAdmin') * 1 != -1) {
578                            this.hide();
579                        }
580                    }
581                  },
582                  xns : Roo.bootstrap,
583                  '|xns' : 'Roo.bootstrap',
584                  items  : [
585                   {
586                    xtype : 'ComboBox',
587                    allowBlank : true,
588                    alwaysQuery : false,
589                    displayField : 'action',
590                    editable : false,
591                    forceSelection : true,
592                    listWidth : 300,
593                    multiple : false,
594                    placeholder : _this._strings['10927a67903afd162cc29267d434a2bb'] /* select action */,
595                    removable : true,
596                    triggerAction : 'all',
597                    typeAhead : true,
598                    valueField : 'id',
599                    listeners : {
600                     render : function (_self)
601                      {
602                          _this.actionSel = this;
603                          
604                      },
605                     select : function (combo, record, index)
606                      {
607                          _this.table.footer.onClick('first');
608                      }
609                    },
610                    xns : Roo.bootstrap,
611                    '|xns' : 'Roo.bootstrap',
612                    store : {
613                     xtype : 'Store',
614                     remoteSort : true,
615                     sortInfo : { field : 'action' , direction : 'ASC' },
616                     listeners : {
617                      beforeload : function (_self, o)
618                       {
619                           o.params = o.params || {};
620                           
621                           /*
622                           // staff can see all logs, other companies can only see their own.
623                           if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
624                               o.params.company_id = Pman.Login.authUser.company_id;
625                           }
626                           */
627                           o.params.limit = 9999;
628                           o.params._distinct = 'action';
629                           
630                           o.params._columns ='action';
631                       }
632                     },
633                     xns : Roo.data,
634                     '|xns' : 'Roo.data',
635                     proxy : {
636                      xtype : 'HttpProxy',
637                      method : 'GET',
638                      url : baseURL + '/Roo/Events',
639                      xns : Roo.data,
640                      '|xns' : 'Roo.data'
641                     },
642                     reader : {
643                      xtype : 'JsonReader',
644                      fields : [
645                          {
646                              'name': 'id',
647                              'type': 'int'
648                          },
649                          {
650                              'name': 'person_name',
651                              'type': 'string'
652                          },
653                          {
654                              'name': 'event_when',
655                              'type': 'date',
656                              'dateFormat': 'Y-m-d'
657                          },
658                          {
659                              'name': 'action',
660                              'type': 'string'
661                          },
662                          {
663                              'name': 'ipaddr',
664                              'type': 'string'
665                          },
666                          {
667                              'name': 'on_id',
668                              'type': 'int'
669                          },
670                          {
671                              'name': 'on_table',
672                              'type': 'string'
673                          },
674                          {
675                              'name': 'person_id',
676                              'type': 'int'
677                          },
678                          {
679                              'name': 'remarks',
680                              'type': 'string'
681                          },
682                          {
683                              'name': 'person_id_id',
684                              'type': 'int'
685                          },
686                          {
687                              'name': 'person_id_office_id',
688                              'type': 'int'
689                          },
690                          {
691                              'name': 'person_id_name',
692                              'type': 'string'
693                          },
694                          {
695                              'name': 'person_id_phone',
696                              'type': 'string'
697                          },
698                          {
699                              'name': 'person_id_fax',
700                              'type': 'string'
701                          },
702                          {
703                              'name': 'person_id_email',
704                              'type': 'string'
705                          },
706                          {
707                              'name': 'person_id_company_id',
708                              'type': 'int'
709                          },
710                          {
711                              'name': 'person_id_role',
712                              'type': 'string'
713                          },
714                          {
715                              'name': 'person_id_active',
716                              'type': 'int'
717                          },
718                          {
719                              'name': 'person_id_remarks',
720                              'type': 'string'
721                          },
722                          {
723                              'name': 'person_id_passwd',
724                              'type': 'string'
725                          },
726                          {
727                              'name': 'person_id_owner_id',
728                              'type': 'int'
729                          },
730                          {
731                              'name': 'person_id_lang',
732                              'type': 'string'
733                          },
734                          {
735                              'name': 'person_id_no_reset_sent',
736                              'type': 'int'
737                          },
738                          {
739                              'name': 'person_id_action_type',
740                              'type': 'string'
741                          },
742                          {
743                              'name': 'person_id_project_id',
744                              'type': 'int'
745                          },
746                          {
747                              'name': 'person_id_deleted_by',
748                              'type': 'int'
749                          },
750                          {
751                              'name': 'person_id_deleted_dt',
752                              'type': 'date'
753                          }
754                      ],
755                      xns : Roo.data,
756                      '|xns' : 'Roo.data'
757                     }
758                    }
759                   }
760                  ]
761                 },
762                 {
763                  xtype : 'Column',
764                  md : 2,
765                  listeners : {
766                   render : function (_self)
767                    {
768                        this.show();
769                        
770                        if(appDisabled.indexOf('Core.SuperAdmin') * 1 != -1) {
771                            this.hide();
772                        }
773                    }
774                  },
775                  xns : Roo.bootstrap,
776                  '|xns' : 'Roo.bootstrap',
777                  items  : [
778                   {
779                    xtype : 'ComboBox',
780                    allowBlank : true,
781                    alwaysQuery : false,
782                    displayField : 'on_table',
783                    editable : false,
784                    forceSelection : true,
785                    listWidth : 300,
786                    multiple : false,
787                    placeholder : _this._strings['c759559b750d502a5be8dceae85ed841'] /* select affected */,
788                    removable : true,
789                    triggerAction : 'all',
790                    typeAhead : true,
791                    valueField : 'id',
792                    listeners : {
793                     render : function (_self)
794                      {
795                          _this.affectSel = this;
796                      },
797                     select : function (combo, record, index)
798                      {
799                          _this.table.footer.onClick('first');
800                      }
801                    },
802                    xns : Roo.bootstrap,
803                    '|xns' : 'Roo.bootstrap',
804                    store : {
805                     xtype : 'Store',
806                     remoteSort : true,
807                     sortInfo : '{ field : \'on_table\' , direction : \'ASC\' }',
808                     listeners : {
809                      beforeload : function (_self, o)
810                       {
811                           o.params = o.params || {};
812                           
813                           /*
814                           // staff can see all logs, other companies can only see their own.
815                           if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
816                               o.params.company_id = Pman.Login.authUser.company_id;
817                           }
818                           */
819                               o.params.limit = 9999;
820                           o.params._distinct = 'on_table';
821                           
822                           o.params._columns ='on_table';
823                       }
824                     },
825                     xns : Roo.data,
826                     '|xns' : 'Roo.data',
827                     proxy : {
828                      xtype : 'HttpProxy',
829                      method : 'GET',
830                      url : baseURL + '/Roo/Events',
831                      xns : Roo.data,
832                      '|xns' : 'Roo.data'
833                     },
834                     reader : {
835                      xtype : 'JsonReader',
836                      fields : [
837                          {
838                              'name': 'id',
839                              'type': 'int'
840                          },
841                          {
842                              'name': 'person_name',
843                              'type': 'string'
844                          },
845                          {
846                              'name': 'event_when',
847                              'type': 'date',
848                              'dateFormat': 'Y-m-d'
849                          },
850                          {
851                              'name': 'action',
852                              'type': 'string'
853                          },
854                          {
855                              'name': 'ipaddr',
856                              'type': 'string'
857                          },
858                          {
859                              'name': 'on_id',
860                              'type': 'int'
861                          },
862                          {
863                              'name': 'on_table',
864                              'type': 'string'
865                          },
866                          {
867                              'name': 'person_id',
868                              'type': 'int'
869                          },
870                          {
871                              'name': 'remarks',
872                              'type': 'string'
873                          },
874                          {
875                              'name': 'person_id_id',
876                              'type': 'int'
877                          },
878                          {
879                              'name': 'person_id_office_id',
880                              'type': 'int'
881                          },
882                          {
883                              'name': 'person_id_name',
884                              'type': 'string'
885                          },
886                          {
887                              'name': 'person_id_phone',
888                              'type': 'string'
889                          },
890                          {
891                              'name': 'person_id_fax',
892                              'type': 'string'
893                          },
894                          {
895                              'name': 'person_id_email',
896                              'type': 'string'
897                          },
898                          {
899                              'name': 'person_id_company_id',
900                              'type': 'int'
901                          },
902                          {
903                              'name': 'person_id_role',
904                              'type': 'string'
905                          },
906                          {
907                              'name': 'person_id_active',
908                              'type': 'int'
909                          },
910                          {
911                              'name': 'person_id_remarks',
912                              'type': 'string'
913                          },
914                          {
915                              'name': 'person_id_passwd',
916                              'type': 'string'
917                          },
918                          {
919                              'name': 'person_id_owner_id',
920                              'type': 'int'
921                          },
922                          {
923                              'name': 'person_id_lang',
924                              'type': 'string'
925                          },
926                          {
927                              'name': 'person_id_no_reset_sent',
928                              'type': 'int'
929                          },
930                          {
931                              'name': 'person_id_action_type',
932                              'type': 'string'
933                          },
934                          {
935                              'name': 'person_id_project_id',
936                              'type': 'int'
937                          },
938                          {
939                              'name': 'person_id_deleted_by',
940                              'type': 'int'
941                          },
942                          {
943                              'name': 'person_id_deleted_dt',
944                              'type': 'date'
945                          }
946                      ],
947                      xns : Roo.data,
948                      '|xns' : 'Roo.data'
949                     }
950                    }
951                   }
952                  ]
953                 },
954                 {
955                  xtype : 'Column',
956                  md : 1,
957                  xns : Roo.bootstrap,
958                  '|xns' : 'Roo.bootstrap',
959                  items  : [
960                   {
961                    xtype : 'FieldLabel',
962                    cls : 'roo-toolbar-label',
963                    html : _this._strings['90275c90e270853fee34db3b87d24d7c'] /* Date Range <i class="fa fa-calendar" aria-hidden="true"></i> */,
964                    style : 'line-height: 34px;',
965                    xns : Roo.bootstrap,
966                    '|xns' : 'Roo.bootstrap'
967                   }
968                  ]
969                 },
970                 {
971                  xtype : 'Column',
972                  md : 1,
973                  xns : Roo.bootstrap,
974                  '|xns' : 'Roo.bootstrap',
975                  items  : [
976                   {
977                    xtype : 'DateField',
978                    placeholder : _this._strings['a6122a65eaa676f700ae68d393054a37'] /* Start */,
979                    listeners : {
980                     change : function (_self, newValue, oldValue)
981                      {
982                            _this.table.footer.onClick('first');
983                      },
984                     render : function (_self)
985                      {
986                          _this.dateFrom = _self;
987                      }
988                    },
989                    xns : Roo.bootstrap,
990                    '|xns' : 'Roo.bootstrap'
991                   }
992                  ]
993                 },
994                 {
995                  xtype : 'Column',
996                  md : 1,
997                  xns : Roo.bootstrap,
998                  '|xns' : 'Roo.bootstrap',
999                  items  : [
1000                   {
1001                    xtype : 'DateField',
1002                    placeholder : _this._strings['87557f11575c0ad78e4e28abedc13b6e'] /* End */,
1003                    listeners : {
1004                     change : function (_self, newValue, oldValue)
1005                      {
1006                          _this.table.footer.onClick('first');
1007                      },
1008                     render : function (_self)
1009                      {
1010                          _this.dateTo = _self;
1011                      }
1012                    },
1013                    xns : Roo.bootstrap,
1014                    '|xns' : 'Roo.bootstrap'
1015                   }
1016                  ]
1017                 }
1018                ]
1019               },
1020               {
1021                xtype : 'Row',
1022                cls : 'roo-toolbar',
1023                xns : Roo.bootstrap,
1024                '|xns' : 'Roo.bootstrap',
1025                items  : [
1026                 {
1027                  xtype : 'Column',
1028                  md : 12,
1029                  xns : Roo.bootstrap,
1030                  '|xns' : 'Roo.bootstrap',
1031                  items  : [
1032                   {
1033                    xtype : 'FieldLabel',
1034                    cls : 'roo-toolbar-label',
1035                    html : _this._strings['31c03fdb82204f0ac1fe916b2c713c8c'] /* Show <i class="fa fa-search" aria-hidden="true"></i> */,
1036                    style : 'line-height: 34px; width: 80px;',
1037                    listeners : {
1038                     render : function (_self)
1039                      {
1040                          this.indicator.setVisibilityMode(Roo.Element.DISPLAY).hide();
1041                      }
1042                    },
1043                    xns : Roo.bootstrap,
1044                    '|xns' : 'Roo.bootstrap'
1045                   },
1046                   {
1047                    xtype : 'ComboBox',
1048                    allowBlank : true,
1049                    alwaysQuery : false,
1050                    displayField : 'name',
1051                    editable : false,
1052                    forceSelection : true,
1053                    loadingText : _this._strings['098f6bcd4621d373cade4e832627b4f6'] /* test */,
1054                    multiple : false,
1055                    placeholder : _this._strings['340c2ee497b85d5954b01c64de7f44f6'] /* Select Person */,
1056                    removable : true,
1057                    triggerAction : 'all',
1058                    typeAhead : true,
1059                    valueField : 'id',
1060                    listeners : {
1061                     render : function (_self)
1062                      {
1063                          _this.personSel = this;
1064                          
1065                      },
1066                     select : function (combo, record, index)
1067                      {
1068                          _this.table.footer.onClick('first');
1069                      }
1070                    },
1071                    xns : Roo.bootstrap,
1072                    '|xns' : 'Roo.bootstrap',
1073                    store : {
1074                     xtype : 'Store',
1075                     remoteSort : true,
1076                     sortInfo : {field : 'name' , direction : 'ASC'},
1077                     listeners : {
1078                      beforeload : function (_self, o)
1079                       {
1080                           o.params = o.params || {};
1081                               o.params.limit = 9999;
1082                       }
1083                     },
1084                     xns : Roo.data,
1085                     '|xns' : 'Roo.data',
1086                     proxy : {
1087                      xtype : 'HttpProxy',
1088                      method : 'GET',
1089                      url : baseURL+'/Roo/Core_person',
1090                      xns : Roo.data,
1091                      '|xns' : 'Roo.data'
1092                     },
1093                     reader : {
1094                      xtype : 'JsonReader',
1095                      fields : [
1096                          {
1097                              'name': 'id',
1098                              'type': 'int'
1099                          },
1100                          {
1101                              'name': 'office_id',
1102                              'type': 'int'
1103                          },
1104                          {
1105                              'name': 'name',
1106                              'type': 'string'
1107                          },
1108                          {
1109                              'name': 'phone',
1110                              'type': 'string'
1111                          },
1112                          {
1113                              'name': 'fax',
1114                              'type': 'string'
1115                          },
1116                          {
1117                              'name': 'email',
1118                              'type': 'string'
1119                          },
1120                          {
1121                              'name': 'company_id',
1122                              'type': 'int'
1123                          },
1124                          {
1125                              'name': 'role',
1126                              'type': 'string'
1127                          },
1128                          {
1129                              'name': 'active',
1130                              'type': 'int'
1131                          },
1132                          {
1133                              'name': 'remarks',
1134                              'type': 'string'
1135                          },
1136                          {
1137                              'name': 'passwd',
1138                              'type': 'string'
1139                          },
1140                          {
1141                              'name': 'owner_id',
1142                              'type': 'int'
1143                          },
1144                          {
1145                              'name': 'lang',
1146                              'type': 'string'
1147                          },
1148                          {
1149                              'name': 'no_reset_sent',
1150                              'type': 'int'
1151                          },
1152                          {
1153                              'name': 'action_type',
1154                              'type': 'string'
1155                          },
1156                          {
1157                              'name': 'project_id',
1158                              'type': 'int'
1159                          },
1160                          {
1161                              'name': 'deleted_by',
1162                              'type': 'int'
1163                          },
1164                          {
1165                              'name': 'deleted_dt',
1166                              'type': 'date',
1167                              'dateFormat': 'Y-m-d'
1168                          },
1169                          {
1170                              'name': 'office_id_id',
1171                              'type': 'int'
1172                          },
1173                          {
1174                              'name': 'office_id_company_id',
1175                              'type': 'int'
1176                          },
1177                          {
1178                              'name': 'office_id_name',
1179                              'type': 'string'
1180                          },
1181                          {
1182                              'name': 'office_id_address',
1183                              'type': 'string'
1184                          },
1185                          {
1186                              'name': 'office_id_phone',
1187                              'type': 'string'
1188                          },
1189                          {
1190                              'name': 'office_id_fax',
1191                              'type': 'string'
1192                          },
1193                          {
1194                              'name': 'office_id_email',
1195                              'type': 'string'
1196                          },
1197                          {
1198                              'name': 'office_id_role',
1199                              'type': 'string'
1200                          },
1201                          {
1202                              'name': 'company_id_code',
1203                              'type': 'string'
1204                          },
1205                          {
1206                              'name': 'company_id_name',
1207                              'type': 'string'
1208                          },
1209                          {
1210                              'name': 'company_id_remarks',
1211                              'type': 'string'
1212                          },
1213                          {
1214                              'name': 'company_id_owner_id',
1215                              'type': 'int'
1216                          },
1217                          {
1218                              'name': 'company_id_address',
1219                              'type': 'string'
1220                          },
1221                          {
1222                              'name': 'company_id_tel',
1223                              'type': 'string'
1224                          },
1225                          {
1226                              'name': 'company_id_fax',
1227                              'type': 'string'
1228                          },
1229                          {
1230                              'name': 'company_id_email',
1231                              'type': 'string'
1232                          },
1233                          {
1234                              'name': 'company_id_id',
1235                              'type': 'int'
1236                          },
1237                          {
1238                              'name': 'company_id_isOwner',
1239                              'type': 'int'
1240                          },
1241                          {
1242                              'name': 'company_id_logo_id',
1243                              'type': 'int'
1244                          },
1245                          {
1246                              'name': 'company_id_background_color',
1247                              'type': 'string'
1248                          },
1249                          {
1250                              'name': 'company_id_comptype',
1251                              'type': 'string'
1252                          },
1253                          {
1254                              'name': 'company_id_url',
1255                              'type': 'string'
1256                          },
1257                          {
1258                              'name': 'company_id_main_office_id',
1259                              'type': 'int'
1260                          },
1261                          {
1262                              'name': 'company_id_created_by',
1263                              'type': 'int'
1264                          },
1265                          {
1266                              'name': 'company_id_created_dt',
1267                              'type': 'date'
1268                          },
1269                          {
1270                              'name': 'company_id_updated_by',
1271                              'type': 'int'
1272                          },
1273                          {
1274                              'name': 'company_id_updated_dt',
1275                              'type': 'date'
1276                          },
1277                          {
1278                              'name': 'company_id_passwd',
1279                              'type': 'string'
1280                          },
1281                          {
1282                              'name': 'company_id_dispatch_port',
1283                              'type': 'string'
1284                          },
1285                          {
1286                              'name': 'company_id_province',
1287                              'type': 'string'
1288                          },
1289                          {
1290                              'name': 'company_id_country',
1291                              'type': 'string'
1292                          },
1293                          {
1294                              'name': 'project_id_id',
1295                              'type': 'int'
1296                          },
1297                          {
1298                              'name': 'project_id_name',
1299                              'type': 'string'
1300                          },
1301                          {
1302                              'name': 'project_id_remarks',
1303                              'type': 'string'
1304                          },
1305                          {
1306                              'name': 'project_id_owner_id',
1307                              'type': 'int'
1308                          },
1309                          {
1310                              'name': 'project_id_code',
1311                              'type': 'string'
1312                          },
1313                          {
1314                              'name': 'project_id_active',
1315                              'type': 'int'
1316                          },
1317                          {
1318                              'name': 'project_id_type',
1319                              'type': 'string'
1320                          },
1321                          {
1322                              'name': 'project_id_client_id',
1323                              'type': 'int'
1324                          },
1325                          {
1326                              'name': 'project_id_team_id',
1327                              'type': 'int'
1328                          },
1329                          {
1330                              'name': 'project_id_file_location',
1331                              'type': 'string'
1332                          },
1333                          {
1334                              'name': 'project_id_open_date',
1335                              'type': 'date'
1336                          },
1337                          {
1338                              'name': 'project_id_open_by',
1339                              'type': 'int'
1340                          },
1341                          {
1342                              'name': 'project_id_close_date',
1343                              'type': 'date'
1344                          },
1345                          {
1346                              'name': 'project_id_countries',
1347                              'type': 'string'
1348                          },
1349                          {
1350                              'name': 'project_id_languages',
1351                              'type': 'string'
1352                          },
1353                          {
1354                              'name': 'project_id_agency_id',
1355                              'type': 'int'
1356                          },
1357                          {
1358                              'name': 'owner_id_id',
1359                              'type': 'int'
1360                          },
1361                          {
1362                              'name': 'owner_id_office_id',
1363                              'type': 'int'
1364                          },
1365                          {
1366                              'name': 'owner_id_name',
1367                              'type': 'string'
1368                          },
1369                          {
1370                              'name': 'owner_id_phone',
1371                              'type': 'string'
1372                          },
1373                          {
1374                              'name': 'owner_id_fax',
1375                              'type': 'string'
1376                          },
1377                          {
1378                              'name': 'owner_id_email',
1379                              'type': 'string'
1380                          },
1381                          {
1382                              'name': 'owner_id_company_id',
1383                              'type': 'int'
1384                          },
1385                          {
1386                              'name': 'owner_id_role',
1387                              'type': 'string'
1388                          },
1389                          {
1390                              'name': 'owner_id_active',
1391                              'type': 'int'
1392                          },
1393                          {
1394                              'name': 'owner_id_remarks',
1395                              'type': 'string'
1396                          },
1397                          {
1398                              'name': 'owner_id_passwd',
1399                              'type': 'string'
1400                          },
1401                          {
1402                              'name': 'owner_id_owner_id',
1403                              'type': 'int'
1404                          },
1405                          {
1406                              'name': 'owner_id_lang',
1407                              'type': 'string'
1408                          },
1409                          {
1410                              'name': 'owner_id_no_reset_sent',
1411                              'type': 'int'
1412                          },
1413                          {
1414                              'name': 'owner_id_action_type',
1415                              'type': 'string'
1416                          },
1417                          {
1418                              'name': 'owner_id_project_id',
1419                              'type': 'int'
1420                          },
1421                          {
1422                              'name': 'owner_id_deleted_by',
1423                              'type': 'int'
1424                          },
1425                          {
1426                              'name': 'owner_id_deleted_dt',
1427                              'type': 'date'
1428                          }
1429                      ],
1430                      xns : Roo.data,
1431                      '|xns' : 'Roo.data'
1432                     }
1433                    }
1434                   }
1435                  ]
1436                 }
1437                ]
1438               }
1439              ]
1440             }
1441            ]
1442           }
1443          ]
1444         }
1445        ]
1446       },
1447       grid : {
1448        xtype : 'Table',
1449        cls : 'table-fixed',
1450        hover : true,
1451        loadMask : true,
1452        responsive : true,
1453        rowSelection : true,
1454        striped : false,
1455        listeners : {
1456         render : function (_self)
1457          {
1458              
1459              _this.table = _self;
1460              
1461          },
1462         rowdblclick : function (_self, el, rowIndex, e)
1463          {
1464          /*
1465              if (!_this.dialog) {
1466                  return;
1467              }
1468              _this.dialog.show(_this.grid.grid.store.getAt(rowIndex).data, function() {
1469                  if (_this.table) {
1470                      _this.table.footer.onClick('first');
1471                  }
1472              });
1473          */
1474          }
1475        },
1476        xns : Roo.bootstrap,
1477        '|xns' : 'Roo.bootstrap',
1478        footer : {
1479         xtype : 'PagingToolbar',
1480         displayInfo : false,
1481         displayMsg : _this._strings['155ca6a755e25c15ad7ce45e2f638f10'] /* Displaying Companies{0} - {1} of {2} */,
1482         emptyMsg : _this._strings['fc6f97505d89fe9277965c126744647a'] /* No Companies found */,
1483         name : 'footer',
1484         pageSize : 25,
1485         listeners : {
1486          render : function (_self)
1487           {
1488               _this.footer = _self;
1489           }
1490         },
1491         xns : Roo.bootstrap,
1492         '|xns' : 'Roo.bootstrap'
1493        },
1494        store : {
1495         xtype : 'Store',
1496         hover : true,
1497         loadMask : true,
1498         remoteSort : true,
1499         rowSelection : true,
1500         sortInfo : { field: 'event_when', direction: 'DESC'},
1501         striped : true,
1502         listeners : {
1503          beforeload : function (_self, o)
1504           {
1505               if (!Pman.buildCompleted) {
1506                   return false;
1507               }
1508               
1509               o.params = o.params || {};
1510               
1511               o.params.person_id = _this.personSel.getValue();
1512               
1513               var act = _this.actionSel.getValue();
1514               
1515               if (act.length) {
1516                   
1517                   o.params.action = act;
1518                   
1519               }
1520               var tbl = _this.affectSel.getValue();
1521               
1522               if (tbl.length) {
1523               
1524                   o.params.on_table = tbl;
1525                   
1526               }
1527               
1528               var f = _this.dateFrom.getValue().split("/");
1529               
1530               var df_string = f[2]+"-"+f[0]+"-"+f[1];
1531               
1532               var df = new Date(Date.parse(f));
1533               
1534               var t = _this.dateTo.getValue().split("/");
1535                   
1536               var dt_string = t[2]+"-"+t[0]+"-"+t[1];
1537               
1538               var dt = new Date(Date.parse(t));
1539               
1540               if (
1541                   _this.dateFrom.format && 
1542                   
1543                   _this.dateTo.format &&
1544                   
1545                   (dt > df)
1546               ) {
1547                   o.params['query[from]'] = df_string;
1548                   
1549                   o.params['query[to]'] = dt_string;
1550                   
1551               }
1552               
1553           },
1554          load : function (_self, records, options)
1555           {
1556               //Roo.log(records);
1557           }
1558         },
1559         xns : Roo.data,
1560         '|xns' : 'Roo.data',
1561         proxy : {
1562          xtype : 'HttpProxy',
1563          method : 'GET',
1564          url : baseURL + '/Roo/Events',
1565          listeners : {
1566           load : function (This, o, arg)
1567            {
1568                //_this.table.footer.onClick('first');
1569            }
1570          },
1571          xns : Roo.data,
1572          '|xns' : 'Roo.data'
1573         },
1574         reader : {
1575          xtype : 'JsonReader',
1576          fields : [
1577              {
1578                  'name': 'id',
1579                  'type': 'int'
1580              },
1581              {
1582                  'name': 'person_name',
1583                  'type': 'string'
1584              },
1585              {
1586                  'name': 'event_when',
1587                  'type': 'date',
1588                  'dateFormat': 'Y-m-d'
1589              },
1590              {
1591                  'name': 'action',
1592                  'type': 'string'
1593              },
1594              {
1595                  'name': 'ipaddr',
1596                  'type': 'string'
1597              },
1598              {
1599                  'name': 'on_id',
1600                  'type': 'int'
1601              },
1602              {
1603                  'name': 'on_table',
1604                  'type': 'string'
1605              },
1606              {
1607                  'name': 'person_id',
1608                  'type': 'int'
1609              },
1610              {
1611                  'name': 'remarks',
1612                  'type': 'string'
1613              },
1614              {
1615                  'name': 'person_id_id',
1616                  'type': 'int'
1617              },
1618              {
1619                  'name': 'person_id_office_id',
1620                  'type': 'int'
1621              },
1622              {
1623                  'name': 'person_id_name',
1624                  'type': 'string'
1625              },
1626              {
1627                  'name': 'person_id_phone',
1628                  'type': 'string'
1629              },
1630              {
1631                  'name': 'person_id_fax',
1632                  'type': 'string'
1633              },
1634              {
1635                  'name': 'person_id_email',
1636                  'type': 'string'
1637              },
1638              {
1639                  'name': 'person_id_company_id',
1640                  'type': 'int'
1641              },
1642              {
1643                  'name': 'person_id_role',
1644                  'type': 'string'
1645              },
1646              {
1647                  'name': 'person_id_active',
1648                  'type': 'int'
1649              },
1650              {
1651                  'name': 'person_id_remarks',
1652                  'type': 'string'
1653              },
1654              {
1655                  'name': 'person_id_passwd',
1656                  'type': 'string'
1657              },
1658              {
1659                  'name': 'person_id_owner_id',
1660                  'type': 'int'
1661              },
1662              {
1663                  'name': 'person_id_lang',
1664                  'type': 'string'
1665              },
1666              {
1667                  'name': 'person_id_no_reset_sent',
1668                  'type': 'int'
1669              },
1670              {
1671                  'name': 'person_id_action_type',
1672                  'type': 'string'
1673              },
1674              {
1675                  'name': 'person_id_project_id',
1676                  'type': 'int'
1677              },
1678              {
1679                  'name': 'person_id_deleted_by',
1680                  'type': 'int'
1681              },
1682              {
1683                  'name': 'person_id_deleted_dt',
1684                  'type': 'date'
1685              }
1686          ],
1687          id : 'id',
1688          root : 'data',
1689          totalProperty : 'total',
1690          xns : Roo.data,
1691          '|xns' : 'Roo.data'
1692         }
1693        },
1694        sm : {
1695         xtype : 'RowSelectionModel',
1696         singleSelect : true,
1697         listeners : {
1698          afterselectionchange : function (_self)
1699           {
1700               
1701               if (!this.getSelected()) {
1702                   
1703                   _this.viewPanel.setContent("Nothing Selected");
1704                   
1705                   return;
1706                   
1707               }
1708               
1709               var id = this.getSelected().data.id;
1710               
1711               _this.viewPanel.load( { url : baseURL + "/Admin/EventView/" + id + ".html" });
1712               
1713           }
1714         },
1715         xns : Roo.bootstrap.Table,
1716         '|xns' : 'Roo.bootstrap.Table'
1717        },
1718        cm : [
1719         {
1720          xtype : 'ColumnModel',
1721          dataIndex : 'event_when',
1722          header : _this._strings['4e97aeeaa8b15ca1180fcd1f3ac478d1'] /* When */,
1723          md : 2,
1724          renderer : function(v) { return v ? v.dateFormat('Y/m/d H:i') : ''; },
1725          sm : 2,
1726          sortable : true,
1727          xs : 2,
1728          xns : Roo.grid,
1729          '|xns' : 'Roo.grid'
1730         },
1731         {
1732          xtype : 'ColumnModel',
1733          dataIndex : 'id',
1734          header : _this._strings['1b7f7d24575cdbfadb83b9587fa1bf97'] /* #id */,
1735          md : 1,
1736          renderer : function(v) { return String.format('{0}', v); },
1737          sm : 1,
1738          sortable : true,
1739          xs : 1,
1740          xns : Roo.grid,
1741          '|xns' : 'Roo.grid'
1742         },
1743         {
1744          xtype : 'ColumnModel',
1745          dataIndex : 'person_id_name',
1746          header : _this._strings['40bed7cf9b3d4bb3a3d7a7e3eb18c5eb'] /* Person */,
1747          md : 2,
1748          renderer : function(v) { return String.format('{0}', v); },
1749          sm : 2,
1750          sortable : true,
1751          xs : 2,
1752          xns : Roo.grid,
1753          '|xns' : 'Roo.grid'
1754         },
1755         {
1756          xtype : 'ColumnModel',
1757          dataIndex : 'action',
1758          header : _this._strings['004bf6c9a40003140292e97330236c53'] /* Action */,
1759          md : 1,
1760          renderer : function(v) { return String.format('{0}', v); },
1761          sm : 1,
1762          xs : 1,
1763          xns : Roo.grid,
1764          '|xns' : 'Roo.grid'
1765         },
1766         {
1767          xtype : 'ColumnModel',
1768          dataIndex : 'ipaddr',
1769          header : _this._strings['a12a3079e14ced46e69ba52b8a90b21a'] /* IP */,
1770          md : 1,
1771          renderer : function(v) { return String.format('{0}', v); },
1772          sm : 1,
1773          xs : 1,
1774          xns : Roo.grid,
1775          '|xns' : 'Roo.grid'
1776         },
1777         {
1778          xtype : 'ColumnModel',
1779          dataIndex : 'on_table',
1780          header : _this._strings['2c92a9a6a5dbf570825e62eabcdecd8d'] /* Affected */,
1781          md : 1,
1782          renderer : function(v, x, r) {
1783              
1784              return v ? String.format('{0}({1})', v,  r.data.on_id)  : '';
1785              
1786          },
1787          sm : 1,
1788          xs : 1,
1789          xns : Roo.grid,
1790          '|xns' : 'Roo.grid'
1791         },
1792         {
1793          xtype : 'ColumnModel',
1794          dataIndex : 'remarks',
1795          header : _this._strings['231bc72756b5e6de492aaaa1577f61b1'] /* Remarks */,
1796          md : 4,
1797          renderer : function(v) { return String.format('{0}', v); },
1798          sm : 4,
1799          xs : 4,
1800          xns : Roo.grid,
1801          '|xns' : 'Roo.grid'
1802         }
1803        ]
1804       }
1805      }
1806     ]
1807    }
1808   };  }
1809 });