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