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                 }
1048                ]
1049               }
1050              ]
1051             }
1052            ]
1053           }
1054          ]
1055         }
1056        ]
1057       },
1058       grid : {
1059        xtype : 'Table',
1060        cls : 'table-fixed',
1061        hover : true,
1062        loadMask : true,
1063        responsive : true,
1064        rowSelection : true,
1065        striped : false,
1066        listeners : {
1067         render : function (_self)
1068          {
1069              
1070              _this.table = _self;
1071              
1072          },
1073         rowdblclick : function (_self, el, rowIndex, e)
1074          {
1075          /*
1076              if (!_this.dialog) {
1077                  return;
1078              }
1079              _this.dialog.show(_this.grid.grid.store.getAt(rowIndex).data, function() {
1080                  if (_this.table) {
1081                      _this.table.footer.onClick('first');
1082                  }
1083              });
1084          */
1085          }
1086        },
1087        xns : Roo.bootstrap,
1088        '|xns' : 'Roo.bootstrap',
1089        footer : {
1090         xtype : 'PagingToolbar',
1091         displayInfo : false,
1092         displayMsg : _this._strings['155ca6a755e25c15ad7ce45e2f638f10'] /* Displaying Companies{0} - {1} of {2} */,
1093         emptyMsg : _this._strings['fc6f97505d89fe9277965c126744647a'] /* No Companies found */,
1094         name : 'footer',
1095         pageSize : 25,
1096         listeners : {
1097          render : function (_self)
1098           {
1099               _this.footer = _self;
1100           }
1101         },
1102         xns : Roo.bootstrap,
1103         '|xns' : 'Roo.bootstrap'
1104        },
1105        store : {
1106         xtype : 'Store',
1107         hover : true,
1108         loadMask : true,
1109         remoteSort : true,
1110         rowSelection : true,
1111         sortInfo : { field: 'event_when', direction: 'DESC'},
1112         striped : true,
1113         listeners : {
1114          beforeload : function (_self, o)
1115           {
1116               if (!Pman.buildCompleted) {
1117                   return false;
1118               }
1119               
1120               o.params = o.params || {};
1121               
1122               o.params.person_id = _this.personSel.getValue();
1123               
1124               var act = _this.actionSel.getValue();
1125               
1126               if (act.length) {
1127                   
1128                   o.params.action = act;
1129                   
1130               }
1131               var tbl = _this.affectSel.getValue();
1132               
1133               if (tbl.length) {
1134               
1135                   o.params.on_table = tbl;
1136                   
1137               }
1138               
1139               var f = _this.dateFrom.getValue().split("/");
1140               
1141               var df_string = f[2]+"-"+f[0]+"-"+f[1];
1142               
1143               var df = new Date(Date.parse(f));
1144               
1145               var t = _this.dateTo.getValue().split("/");
1146                   
1147               var dt_string = t[2]+"-"+t[0]+"-"+t[1];
1148               
1149               var dt = new Date(Date.parse(t));
1150               
1151               if (
1152                   _this.dateFrom.format && 
1153                   
1154                   _this.dateTo.format &&
1155                   
1156                   (dt > df)
1157               ) {
1158                   o.params['query[from]'] = df_string;
1159                   
1160                   o.params['query[to]'] = dt_string;
1161                   
1162               }
1163               
1164           },
1165          load : function (_self, records, options)
1166           {
1167               //Roo.log(records);
1168           }
1169         },
1170         xns : Roo.data,
1171         '|xns' : 'Roo.data',
1172         proxy : {
1173          xtype : 'HttpProxy',
1174          method : 'GET',
1175          url : baseURL + '/Roo/Events',
1176          listeners : {
1177           load : function (This, o, arg)
1178            {
1179                //_this.table.footer.onClick('first');
1180            }
1181          },
1182          xns : Roo.data,
1183          '|xns' : 'Roo.data'
1184         },
1185         reader : {
1186          xtype : 'JsonReader',
1187          fields : [
1188              {
1189                  'name': 'id',
1190                  'type': 'int'
1191              },
1192              {
1193                  'name': 'person_name',
1194                  'type': 'string'
1195              },
1196              {
1197                  'name': 'event_when',
1198                  'type': 'date',
1199                  'dateFormat': 'Y-m-d'
1200              },
1201              {
1202                  'name': 'action',
1203                  'type': 'string'
1204              },
1205              {
1206                  'name': 'ipaddr',
1207                  'type': 'string'
1208              },
1209              {
1210                  'name': 'on_id',
1211                  'type': 'int'
1212              },
1213              {
1214                  'name': 'on_table',
1215                  'type': 'string'
1216              },
1217              {
1218                  'name': 'person_id',
1219                  'type': 'int'
1220              },
1221              {
1222                  'name': 'remarks',
1223                  'type': 'string'
1224              },
1225              {
1226                  'name': 'person_id_id',
1227                  'type': 'int'
1228              },
1229              {
1230                  'name': 'person_id_office_id',
1231                  'type': 'int'
1232              },
1233              {
1234                  'name': 'person_id_name',
1235                  'type': 'string'
1236              },
1237              {
1238                  'name': 'person_id_phone',
1239                  'type': 'string'
1240              },
1241              {
1242                  'name': 'person_id_fax',
1243                  'type': 'string'
1244              },
1245              {
1246                  'name': 'person_id_email',
1247                  'type': 'string'
1248              },
1249              {
1250                  'name': 'person_id_company_id',
1251                  'type': 'int'
1252              },
1253              {
1254                  'name': 'person_id_role',
1255                  'type': 'string'
1256              },
1257              {
1258                  'name': 'person_id_active',
1259                  'type': 'int'
1260              },
1261              {
1262                  'name': 'person_id_remarks',
1263                  'type': 'string'
1264              },
1265              {
1266                  'name': 'person_id_passwd',
1267                  'type': 'string'
1268              },
1269              {
1270                  'name': 'person_id_owner_id',
1271                  'type': 'int'
1272              },
1273              {
1274                  'name': 'person_id_lang',
1275                  'type': 'string'
1276              },
1277              {
1278                  'name': 'person_id_no_reset_sent',
1279                  'type': 'int'
1280              },
1281              {
1282                  'name': 'person_id_action_type',
1283                  'type': 'string'
1284              },
1285              {
1286                  'name': 'person_id_project_id',
1287                  'type': 'int'
1288              },
1289              {
1290                  'name': 'person_id_deleted_by',
1291                  'type': 'int'
1292              },
1293              {
1294                  'name': 'person_id_deleted_dt',
1295                  'type': 'date'
1296              }
1297          ],
1298          id : 'id',
1299          root : 'data',
1300          totalProperty : 'total',
1301          xns : Roo.data,
1302          '|xns' : 'Roo.data'
1303         }
1304        },
1305        sm : {
1306         xtype : 'RowSelectionModel',
1307         singleSelect : true,
1308         listeners : {
1309          afterselectionchange : function (_self)
1310           {
1311               
1312               if (!this.getSelected()) {
1313                   
1314                   _this.viewPanel.setContent("Nothing Selected");
1315                   
1316                   return;
1317                   
1318               }
1319               
1320               var id = this.getSelected().data.id;
1321               
1322               _this.viewPanel.load( { url : baseURL + "/Admin/EventView/" + id + ".html" });
1323               
1324           }
1325         },
1326         xns : Roo.bootstrap.Table,
1327         '|xns' : 'Roo.bootstrap.Table'
1328        },
1329        cm : [
1330         {
1331          xtype : 'ColumnModel',
1332          dataIndex : 'event_when',
1333          header : _this._strings['4e97aeeaa8b15ca1180fcd1f3ac478d1'] /* When */,
1334          md : 2,
1335          renderer : function(v) { return v ? v.dateFormat('Y/m/d H:i') : ''; },
1336          sm : 2,
1337          sortable : true,
1338          xs : 2,
1339          xns : Roo.grid,
1340          '|xns' : 'Roo.grid'
1341         },
1342         {
1343          xtype : 'ColumnModel',
1344          dataIndex : 'id',
1345          header : _this._strings['1b7f7d24575cdbfadb83b9587fa1bf97'] /* #id */,
1346          md : 1,
1347          renderer : function(v) { return String.format('{0}', v); },
1348          sm : 1,
1349          sortable : true,
1350          xs : 1,
1351          xns : Roo.grid,
1352          '|xns' : 'Roo.grid'
1353         },
1354         {
1355          xtype : 'ColumnModel',
1356          dataIndex : 'person_id_name',
1357          header : _this._strings['40bed7cf9b3d4bb3a3d7a7e3eb18c5eb'] /* Person */,
1358          md : 2,
1359          renderer : function(v) { return String.format('{0}', v); },
1360          sm : 2,
1361          sortable : true,
1362          xs : 2,
1363          xns : Roo.grid,
1364          '|xns' : 'Roo.grid'
1365         },
1366         {
1367          xtype : 'ColumnModel',
1368          dataIndex : 'action',
1369          header : _this._strings['004bf6c9a40003140292e97330236c53'] /* Action */,
1370          md : 1,
1371          renderer : function(v) { return String.format('{0}', v); },
1372          sm : 1,
1373          xs : 1,
1374          xns : Roo.grid,
1375          '|xns' : 'Roo.grid'
1376         },
1377         {
1378          xtype : 'ColumnModel',
1379          dataIndex : 'ipaddr',
1380          header : _this._strings['a12a3079e14ced46e69ba52b8a90b21a'] /* IP */,
1381          md : 1,
1382          renderer : function(v) { return String.format('{0}', v); },
1383          sm : 1,
1384          xs : 1,
1385          xns : Roo.grid,
1386          '|xns' : 'Roo.grid'
1387         },
1388         {
1389          xtype : 'ColumnModel',
1390          dataIndex : 'on_table',
1391          header : _this._strings['2c92a9a6a5dbf570825e62eabcdecd8d'] /* Affected */,
1392          md : 1,
1393          renderer : function(v, x, r) {
1394              
1395              return v ? String.format('{0}({1})', v,  r.data.on_id)  : '';
1396              
1397          },
1398          sm : 1,
1399          xs : 1,
1400          xns : Roo.grid,
1401          '|xns' : 'Roo.grid'
1402         },
1403         {
1404          xtype : 'ColumnModel',
1405          dataIndex : 'remarks',
1406          header : _this._strings['231bc72756b5e6de492aaaa1577f61b1'] /* Remarks */,
1407          md : 4,
1408          renderer : function(v) { return String.format('{0}', v); },
1409          sm : 4,
1410          xs : 4,
1411          xns : Roo.grid,
1412          '|xns' : 'Roo.grid'
1413         }
1414        ]
1415       }
1416      }
1417     ]
1418    }
1419   };  }
1420 });