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