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                    style : 'float: left; width: 250px;',
1058                    triggerAction : 'all',
1059                    typeAhead : true,
1060                    valueField : 'id',
1061                    listeners : {
1062                     render : function (_self)
1063                      {
1064                          _this.personSel = this;
1065                          
1066                      },
1067                     select : function (combo, record, index)
1068                      {
1069                          _this.table.footer.onClick('first');
1070                      }
1071                    },
1072                    xns : Roo.bootstrap,
1073                    '|xns' : 'Roo.bootstrap',
1074                    store : {
1075                     xtype : 'Store',
1076                     remoteSort : true,
1077                     sortInfo : {field : 'name' , direction : 'ASC'},
1078                     listeners : {
1079                      beforeload : function (_self, o)
1080                       {
1081                           o.params = o.params || {};
1082                               o.params.limit = 9999;
1083                       }
1084                     },
1085                     xns : Roo.data,
1086                     '|xns' : 'Roo.data',
1087                     proxy : {
1088                      xtype : 'HttpProxy',
1089                      method : 'GET',
1090                      url : baseURL+'/Roo/Core_person',
1091                      xns : Roo.data,
1092                      '|xns' : 'Roo.data'
1093                     },
1094                     reader : {
1095                      xtype : 'JsonReader',
1096                      fields : [
1097                          {
1098                              'name': 'id',
1099                              'type': 'int'
1100                          },
1101                          {
1102                              'name': 'office_id',
1103                              'type': 'int'
1104                          },
1105                          {
1106                              'name': 'name',
1107                              'type': 'string'
1108                          },
1109                          {
1110                              'name': 'phone',
1111                              'type': 'string'
1112                          },
1113                          {
1114                              'name': 'fax',
1115                              'type': 'string'
1116                          },
1117                          {
1118                              'name': 'email',
1119                              'type': 'string'
1120                          },
1121                          {
1122                              'name': 'company_id',
1123                              'type': 'int'
1124                          },
1125                          {
1126                              'name': 'role',
1127                              'type': 'string'
1128                          },
1129                          {
1130                              'name': 'active',
1131                              'type': 'int'
1132                          },
1133                          {
1134                              'name': 'remarks',
1135                              'type': 'string'
1136                          },
1137                          {
1138                              'name': 'passwd',
1139                              'type': 'string'
1140                          },
1141                          {
1142                              'name': 'owner_id',
1143                              'type': 'int'
1144                          },
1145                          {
1146                              'name': 'lang',
1147                              'type': 'string'
1148                          },
1149                          {
1150                              'name': 'no_reset_sent',
1151                              'type': 'int'
1152                          },
1153                          {
1154                              'name': 'action_type',
1155                              'type': 'string'
1156                          },
1157                          {
1158                              'name': 'project_id',
1159                              'type': 'int'
1160                          },
1161                          {
1162                              'name': 'deleted_by',
1163                              'type': 'int'
1164                          },
1165                          {
1166                              'name': 'deleted_dt',
1167                              'type': 'date',
1168                              'dateFormat': 'Y-m-d'
1169                          },
1170                          {
1171                              'name': 'office_id_id',
1172                              'type': 'int'
1173                          },
1174                          {
1175                              'name': 'office_id_company_id',
1176                              'type': 'int'
1177                          },
1178                          {
1179                              'name': 'office_id_name',
1180                              'type': 'string'
1181                          },
1182                          {
1183                              'name': 'office_id_address',
1184                              'type': 'string'
1185                          },
1186                          {
1187                              'name': 'office_id_phone',
1188                              'type': 'string'
1189                          },
1190                          {
1191                              'name': 'office_id_fax',
1192                              'type': 'string'
1193                          },
1194                          {
1195                              'name': 'office_id_email',
1196                              'type': 'string'
1197                          },
1198                          {
1199                              'name': 'office_id_role',
1200                              'type': 'string'
1201                          },
1202                          {
1203                              'name': 'company_id_code',
1204                              'type': 'string'
1205                          },
1206                          {
1207                              'name': 'company_id_name',
1208                              'type': 'string'
1209                          },
1210                          {
1211                              'name': 'company_id_remarks',
1212                              'type': 'string'
1213                          },
1214                          {
1215                              'name': 'company_id_owner_id',
1216                              'type': 'int'
1217                          },
1218                          {
1219                              'name': 'company_id_address',
1220                              'type': 'string'
1221                          },
1222                          {
1223                              'name': 'company_id_tel',
1224                              'type': 'string'
1225                          },
1226                          {
1227                              'name': 'company_id_fax',
1228                              'type': 'string'
1229                          },
1230                          {
1231                              'name': 'company_id_email',
1232                              'type': 'string'
1233                          },
1234                          {
1235                              'name': 'company_id_id',
1236                              'type': 'int'
1237                          },
1238                          {
1239                              'name': 'company_id_isOwner',
1240                              'type': 'int'
1241                          },
1242                          {
1243                              'name': 'company_id_logo_id',
1244                              'type': 'int'
1245                          },
1246                          {
1247                              'name': 'company_id_background_color',
1248                              'type': 'string'
1249                          },
1250                          {
1251                              'name': 'company_id_comptype',
1252                              'type': 'string'
1253                          },
1254                          {
1255                              'name': 'company_id_url',
1256                              'type': 'string'
1257                          },
1258                          {
1259                              'name': 'company_id_main_office_id',
1260                              'type': 'int'
1261                          },
1262                          {
1263                              'name': 'company_id_created_by',
1264                              'type': 'int'
1265                          },
1266                          {
1267                              'name': 'company_id_created_dt',
1268                              'type': 'date'
1269                          },
1270                          {
1271                              'name': 'company_id_updated_by',
1272                              'type': 'int'
1273                          },
1274                          {
1275                              'name': 'company_id_updated_dt',
1276                              'type': 'date'
1277                          },
1278                          {
1279                              'name': 'company_id_passwd',
1280                              'type': 'string'
1281                          },
1282                          {
1283                              'name': 'company_id_dispatch_port',
1284                              'type': 'string'
1285                          },
1286                          {
1287                              'name': 'company_id_province',
1288                              'type': 'string'
1289                          },
1290                          {
1291                              'name': 'company_id_country',
1292                              'type': 'string'
1293                          },
1294                          {
1295                              'name': 'project_id_id',
1296                              'type': 'int'
1297                          },
1298                          {
1299                              'name': 'project_id_name',
1300                              'type': 'string'
1301                          },
1302                          {
1303                              'name': 'project_id_remarks',
1304                              'type': 'string'
1305                          },
1306                          {
1307                              'name': 'project_id_owner_id',
1308                              'type': 'int'
1309                          },
1310                          {
1311                              'name': 'project_id_code',
1312                              'type': 'string'
1313                          },
1314                          {
1315                              'name': 'project_id_active',
1316                              'type': 'int'
1317                          },
1318                          {
1319                              'name': 'project_id_type',
1320                              'type': 'string'
1321                          },
1322                          {
1323                              'name': 'project_id_client_id',
1324                              'type': 'int'
1325                          },
1326                          {
1327                              'name': 'project_id_team_id',
1328                              'type': 'int'
1329                          },
1330                          {
1331                              'name': 'project_id_file_location',
1332                              'type': 'string'
1333                          },
1334                          {
1335                              'name': 'project_id_open_date',
1336                              'type': 'date'
1337                          },
1338                          {
1339                              'name': 'project_id_open_by',
1340                              'type': 'int'
1341                          },
1342                          {
1343                              'name': 'project_id_close_date',
1344                              'type': 'date'
1345                          },
1346                          {
1347                              'name': 'project_id_countries',
1348                              'type': 'string'
1349                          },
1350                          {
1351                              'name': 'project_id_languages',
1352                              'type': 'string'
1353                          },
1354                          {
1355                              'name': 'project_id_agency_id',
1356                              'type': 'int'
1357                          },
1358                          {
1359                              'name': 'owner_id_id',
1360                              'type': 'int'
1361                          },
1362                          {
1363                              'name': 'owner_id_office_id',
1364                              'type': 'int'
1365                          },
1366                          {
1367                              'name': 'owner_id_name',
1368                              'type': 'string'
1369                          },
1370                          {
1371                              'name': 'owner_id_phone',
1372                              'type': 'string'
1373                          },
1374                          {
1375                              'name': 'owner_id_fax',
1376                              'type': 'string'
1377                          },
1378                          {
1379                              'name': 'owner_id_email',
1380                              'type': 'string'
1381                          },
1382                          {
1383                              'name': 'owner_id_company_id',
1384                              'type': 'int'
1385                          },
1386                          {
1387                              'name': 'owner_id_role',
1388                              'type': 'string'
1389                          },
1390                          {
1391                              'name': 'owner_id_active',
1392                              'type': 'int'
1393                          },
1394                          {
1395                              'name': 'owner_id_remarks',
1396                              'type': 'string'
1397                          },
1398                          {
1399                              'name': 'owner_id_passwd',
1400                              'type': 'string'
1401                          },
1402                          {
1403                              'name': 'owner_id_owner_id',
1404                              'type': 'int'
1405                          },
1406                          {
1407                              'name': 'owner_id_lang',
1408                              'type': 'string'
1409                          },
1410                          {
1411                              'name': 'owner_id_no_reset_sent',
1412                              'type': 'int'
1413                          },
1414                          {
1415                              'name': 'owner_id_action_type',
1416                              'type': 'string'
1417                          },
1418                          {
1419                              'name': 'owner_id_project_id',
1420                              'type': 'int'
1421                          },
1422                          {
1423                              'name': 'owner_id_deleted_by',
1424                              'type': 'int'
1425                          },
1426                          {
1427                              'name': 'owner_id_deleted_dt',
1428                              'type': 'date'
1429                          }
1430                      ],
1431                      xns : Roo.data,
1432                      '|xns' : 'Roo.data'
1433                     }
1434                    }
1435                   }
1436                  ]
1437                 }
1438                ]
1439               }
1440              ]
1441             }
1442            ]
1443           }
1444          ]
1445         }
1446        ]
1447       },
1448       grid : {
1449        xtype : 'Table',
1450        cls : 'table-fixed',
1451        hover : true,
1452        loadMask : true,
1453        responsive : true,
1454        rowSelection : true,
1455        striped : false,
1456        listeners : {
1457         render : function (_self)
1458          {
1459              
1460              _this.table = _self;
1461              
1462          },
1463         rowdblclick : function (_self, el, rowIndex, e)
1464          {
1465          /*
1466              if (!_this.dialog) {
1467                  return;
1468              }
1469              _this.dialog.show(_this.grid.grid.store.getAt(rowIndex).data, function() {
1470                  if (_this.table) {
1471                      _this.table.footer.onClick('first');
1472                  }
1473              });
1474          */
1475          }
1476        },
1477        xns : Roo.bootstrap,
1478        '|xns' : 'Roo.bootstrap',
1479        footer : {
1480         xtype : 'PagingToolbar',
1481         displayInfo : false,
1482         displayMsg : _this._strings['155ca6a755e25c15ad7ce45e2f638f10'] /* Displaying Companies{0} - {1} of {2} */,
1483         emptyMsg : _this._strings['fc6f97505d89fe9277965c126744647a'] /* No Companies found */,
1484         name : 'footer',
1485         pageSize : 25,
1486         listeners : {
1487          render : function (_self)
1488           {
1489               _this.footer = _self;
1490           }
1491         },
1492         xns : Roo.bootstrap,
1493         '|xns' : 'Roo.bootstrap'
1494        },
1495        store : {
1496         xtype : 'Store',
1497         hover : true,
1498         loadMask : true,
1499         remoteSort : true,
1500         rowSelection : true,
1501         sortInfo : { field: 'event_when', direction: 'DESC'},
1502         striped : true,
1503         listeners : {
1504          beforeload : function (_self, o)
1505           {
1506               if (!Pman.buildCompleted) {
1507                   return false;
1508               }
1509               
1510               o.params = o.params || {};
1511               
1512               o.params.person_id = _this.personSel.getValue();
1513               
1514               var act = _this.actionSel.getValue();
1515               
1516               if (act.length) {
1517                   
1518                   o.params.action = act;
1519                   
1520               }
1521               var tbl = _this.affectSel.getValue();
1522               
1523               if (tbl.length) {
1524               
1525                   o.params.on_table = tbl;
1526                   
1527               }
1528               
1529               var f = _this.dateFrom.getValue().split("/");
1530               
1531               var df_string = f[2]+"-"+f[0]+"-"+f[1];
1532               
1533               var df = new Date(Date.parse(f));
1534               
1535               var t = _this.dateTo.getValue().split("/");
1536                   
1537               var dt_string = t[2]+"-"+t[0]+"-"+t[1];
1538               
1539               var dt = new Date(Date.parse(t));
1540               
1541               if (
1542                   _this.dateFrom.format && 
1543                   
1544                   _this.dateTo.format &&
1545                   
1546                   (dt > df)
1547               ) {
1548                   o.params['query[from]'] = df_string;
1549                   
1550                   o.params['query[to]'] = dt_string;
1551                   
1552               }
1553               
1554           },
1555          load : function (_self, records, options)
1556           {
1557               //Roo.log(records);
1558           }
1559         },
1560         xns : Roo.data,
1561         '|xns' : 'Roo.data',
1562         proxy : {
1563          xtype : 'HttpProxy',
1564          method : 'GET',
1565          url : baseURL + '/Roo/Events',
1566          listeners : {
1567           load : function (This, o, arg)
1568            {
1569                //_this.table.footer.onClick('first');
1570            }
1571          },
1572          xns : Roo.data,
1573          '|xns' : 'Roo.data'
1574         },
1575         reader : {
1576          xtype : 'JsonReader',
1577          fields : [
1578              {
1579                  'name': 'id',
1580                  'type': 'int'
1581              },
1582              {
1583                  'name': 'person_name',
1584                  'type': 'string'
1585              },
1586              {
1587                  'name': 'event_when',
1588                  'type': 'date',
1589                  'dateFormat': 'Y-m-d'
1590              },
1591              {
1592                  'name': 'action',
1593                  'type': 'string'
1594              },
1595              {
1596                  'name': 'ipaddr',
1597                  'type': 'string'
1598              },
1599              {
1600                  'name': 'on_id',
1601                  'type': 'int'
1602              },
1603              {
1604                  'name': 'on_table',
1605                  'type': 'string'
1606              },
1607              {
1608                  'name': 'person_id',
1609                  'type': 'int'
1610              },
1611              {
1612                  'name': 'remarks',
1613                  'type': 'string'
1614              },
1615              {
1616                  'name': 'person_id_id',
1617                  'type': 'int'
1618              },
1619              {
1620                  'name': 'person_id_office_id',
1621                  'type': 'int'
1622              },
1623              {
1624                  'name': 'person_id_name',
1625                  'type': 'string'
1626              },
1627              {
1628                  'name': 'person_id_phone',
1629                  'type': 'string'
1630              },
1631              {
1632                  'name': 'person_id_fax',
1633                  'type': 'string'
1634              },
1635              {
1636                  'name': 'person_id_email',
1637                  'type': 'string'
1638              },
1639              {
1640                  'name': 'person_id_company_id',
1641                  'type': 'int'
1642              },
1643              {
1644                  'name': 'person_id_role',
1645                  'type': 'string'
1646              },
1647              {
1648                  'name': 'person_id_active',
1649                  'type': 'int'
1650              },
1651              {
1652                  'name': 'person_id_remarks',
1653                  'type': 'string'
1654              },
1655              {
1656                  'name': 'person_id_passwd',
1657                  'type': 'string'
1658              },
1659              {
1660                  'name': 'person_id_owner_id',
1661                  'type': 'int'
1662              },
1663              {
1664                  'name': 'person_id_lang',
1665                  'type': 'string'
1666              },
1667              {
1668                  'name': 'person_id_no_reset_sent',
1669                  'type': 'int'
1670              },
1671              {
1672                  'name': 'person_id_action_type',
1673                  'type': 'string'
1674              },
1675              {
1676                  'name': 'person_id_project_id',
1677                  'type': 'int'
1678              },
1679              {
1680                  'name': 'person_id_deleted_by',
1681                  'type': 'int'
1682              },
1683              {
1684                  'name': 'person_id_deleted_dt',
1685                  'type': 'date'
1686              }
1687          ],
1688          id : 'id',
1689          root : 'data',
1690          totalProperty : 'total',
1691          xns : Roo.data,
1692          '|xns' : 'Roo.data'
1693         }
1694        },
1695        sm : {
1696         xtype : 'RowSelectionModel',
1697         singleSelect : true,
1698         listeners : {
1699          afterselectionchange : function (_self)
1700           {
1701               
1702               if (!this.getSelected()) {
1703                   
1704                   _this.viewPanel.setContent("Nothing Selected");
1705                   
1706                   return;
1707                   
1708               }
1709               
1710               var id = this.getSelected().data.id;
1711               
1712               _this.viewPanel.load( { url : baseURL + "/Admin/EventView/" + id + ".html" });
1713               
1714           }
1715         },
1716         xns : Roo.bootstrap.Table,
1717         '|xns' : 'Roo.bootstrap.Table'
1718        },
1719        cm : [
1720         {
1721          xtype : 'ColumnModel',
1722          dataIndex : 'event_when',
1723          header : _this._strings['4e97aeeaa8b15ca1180fcd1f3ac478d1'] /* When */,
1724          md : 2,
1725          renderer : function(v) { return v ? v.dateFormat('Y/m/d H:i') : ''; },
1726          sm : 2,
1727          sortable : true,
1728          xs : 2,
1729          xns : Roo.grid,
1730          '|xns' : 'Roo.grid'
1731         },
1732         {
1733          xtype : 'ColumnModel',
1734          dataIndex : 'id',
1735          header : _this._strings['1b7f7d24575cdbfadb83b9587fa1bf97'] /* #id */,
1736          md : 1,
1737          renderer : function(v) { return String.format('{0}', v); },
1738          sm : 1,
1739          sortable : true,
1740          xs : 1,
1741          xns : Roo.grid,
1742          '|xns' : 'Roo.grid'
1743         },
1744         {
1745          xtype : 'ColumnModel',
1746          dataIndex : 'person_id_name',
1747          header : _this._strings['40bed7cf9b3d4bb3a3d7a7e3eb18c5eb'] /* Person */,
1748          md : 2,
1749          renderer : function(v) { return String.format('{0}', v); },
1750          sm : 2,
1751          sortable : true,
1752          xs : 2,
1753          xns : Roo.grid,
1754          '|xns' : 'Roo.grid'
1755         },
1756         {
1757          xtype : 'ColumnModel',
1758          dataIndex : 'action',
1759          header : _this._strings['004bf6c9a40003140292e97330236c53'] /* Action */,
1760          md : 1,
1761          renderer : function(v) { return String.format('{0}', v); },
1762          sm : 1,
1763          xs : 1,
1764          xns : Roo.grid,
1765          '|xns' : 'Roo.grid'
1766         },
1767         {
1768          xtype : 'ColumnModel',
1769          dataIndex : 'ipaddr',
1770          header : _this._strings['a12a3079e14ced46e69ba52b8a90b21a'] /* IP */,
1771          md : 1,
1772          renderer : function(v) { return String.format('{0}', v); },
1773          sm : 1,
1774          xs : 1,
1775          xns : Roo.grid,
1776          '|xns' : 'Roo.grid'
1777         },
1778         {
1779          xtype : 'ColumnModel',
1780          dataIndex : 'on_table',
1781          header : _this._strings['2c92a9a6a5dbf570825e62eabcdecd8d'] /* Affected */,
1782          md : 1,
1783          renderer : function(v, x, r) {
1784              
1785              return v ? String.format('{0}({1})', v,  r.data.on_id)  : '';
1786              
1787          },
1788          sm : 1,
1789          xs : 1,
1790          xns : Roo.grid,
1791          '|xns' : 'Roo.grid'
1792         },
1793         {
1794          xtype : 'ColumnModel',
1795          dataIndex : 'remarks',
1796          header : _this._strings['231bc72756b5e6de492aaaa1577f61b1'] /* Remarks */,
1797          md : 4,
1798          renderer : function(v) { return String.format('{0}', v); },
1799          sm : 4,
1800          xs : 4,
1801          xns : Roo.grid,
1802          '|xns' : 'Roo.grid'
1803         }
1804        ]
1805       }
1806      }
1807     ]
1808    }
1809   };  }
1810 });