sync
[Pman.Admin] / Pman.Tab.AdminLogDrill.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.AdminLogDrill = new Roo.XComponent({
8
9  _strings : {
10   '7a11042f53957727d8667732d7de1102' :"Ipaddr",
11   '231bc72756b5e6de492aaaa1577f61b1' :"Remarks",
12   '87f9f735a1d36793ceaecd4e47124b63' :"Events",
13   '490aa6e856ccf208a054389e47ce0d06' :"Id",
14   '739cea2b85156183f917f2ccaa10a50c' :"#ID",
15   '591933c26da312455c63b6bc1ec046bc' :"(function() { var d = new Date();d =  d.add(Date.MONTH, 1) ; return d.format('Y-m-01'); })()",
16   'd9578744f1d4b13d40a51fbb8b9d6ea5' :"Person name",
17   'e1edab2a061a49e21790204249b1aee9' :"(function() { var d = new Date(); return d.format('Y-m-01'); })()",
18   '1243daf593fa297e07ab03bf06d925af' :"Searching...",
19   '51c45b795d5d18a3e4e0c37e8b20a141' :"Table",
20   '6be4aa550791c310e098cd6c234af7d8' :"Event when",
21   '679308a758de538c5f39c4c6cdba6593' :"Select Affects",
22   'c112bb3542e98308d12d5ecb10a67abc' :"Changes",
23   'a254c25adc7d10d7e9c4889484f875a5' :"Detail",
24   '7205d42d6d975c911bc1147259d78935' :"Displaying Events{0} - {1} of {2}",
25   '39b9e051f9fe75e65c7a330bb00499d4' :"Date Range",
26   'a8929eb5c1553d3f70497f862d25d0ce' :"Select Action",
27   '004bf6c9a40003140292e97330236c53' :"Action",
28   'f971b3a2cc583b475332380649a4fa05' :"Daily summary",
29   '0668a37e3eb3480f0444f8da7bc446ba' :"Event Drilldown",
30   'b5fe0746885b906c8ed9b7cc06023c35' :"#Affected",
31   '90e4ac2e5a22e53df63b6b186d8727ba' :"No Events found"
32  },
33
34   part     :  ["Admin", "LogDrill" ],
35   order    : '003-Pman.Tab.AdminLogDrill',
36   region   : 'center',
37   parent   : 'Pman.Tab.AdminLogs',
38   name     : "Pman.Tab.AdminLogDrill",
39   disabled : false, 
40   permname : '', 
41   _tree : function(_data)
42   {
43    var _this = this;
44    var MODULE = this;
45    return {
46    xtype : 'NestedLayoutPanel',
47    background : true,
48    region : 'center',
49    title : _this._strings['0668a37e3eb3480f0444f8da7bc446ba'] /* Event Drilldown */,
50    xns : Roo,
51    '|xns' : 'Roo',
52    toolbar : {
53     xtype : 'Toolbar',
54     xns : Roo,
55     '|xns' : 'Roo',
56     items  : [
57      {
58       xtype : 'TextItem',
59       text : _this._strings['39b9e051f9fe75e65c7a330bb00499d4'] /* Date Range */,
60       xns : Roo.Toolbar,
61       '|xns' : 'Roo.Toolbar'
62      },
63      {
64       xtype : 'DateField',
65       format : 'Y-m-d',
66       value : (function() { var d = new Date(); return d.format('Y-m-01'); })(),
67       listeners : {
68        change : function (_self, newValue, oldValue)
69         {
70           _this.dategrid.ds.load({});
71         },
72        render : function (_self)
73         {
74           _this.dateFrom = _self;
75         }
76       },
77       xns : Roo.form,
78       '|xns' : 'Roo.form'
79      },
80      {
81       xtype : 'DateField',
82       format : 'Y-m-d',
83       value : (function() { var d = new Date();d =  d.add(Date.MONTH, 1) ; return d.format('Y-m-01'); })(),
84       listeners : {
85        change : function (_self, newValue, oldValue)
86         {
87           _this.dategrid.ds.load({});
88         },
89        render : function (_self)
90         {
91           _this.dateTo = _self;
92         }
93       },
94       xns : Roo.form,
95       '|xns' : 'Roo.form'
96      },
97      {
98       xtype : 'ComboBox',
99       allowBlank : true,
100       displayField : 'action',
101       editable : true,
102       emptyText : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
103       forceSelection : true,
104       listWidth : 300,
105       loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
106       minChars : 2,
107       name : 'action',
108       pageSize : 20,
109       qtip : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
110       queryParam : 'query[action]',
111       selectOnFocus : true,
112       tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{action}</b> </div>',
113       triggerAction : 'all',
114       typeAhead : true,
115       valueField : 'action',
116       width : 150,
117       listeners : {
118        render : function (_self)
119         {
120           _this.actionSel = _self;
121         },
122        select : function (combo, record, index)
123         {
124            _this.dategrid.ds.load({});
125         }
126       },
127       xns : Roo.form,
128       '|xns' : 'Roo.form',
129       store : {
130        xtype : 'Store',
131        remoteSort : true,
132        sortInfo : { field : 'action' , direction : 'ASC' },
133        listeners : {
134         beforeload : function (_self, o)
135          {
136              o.params = o.params || {};
137              // staff can see all logs, other companies can only see their own.
138              if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
139                  o.params.company_id = Pman.Login.authUser.company_id;
140              }
141              o.params._distinct = 'action';
142              o.params._columns ='action';
143          }
144        },
145        xns : Roo.data,
146        '|xns' : 'Roo.data',
147        proxy : {
148         xtype : 'HttpProxy',
149         method : 'GET',
150         timeout : 50000,
151         url : baseURL + '/Roo/Events.php',
152         xns : Roo.data,
153         '|xns' : 'Roo.data'
154        },
155        reader : {
156         xtype : 'JsonReader',
157         fields : [
158             {
159                 'name': 'id',
160                 'type': 'int'
161             },
162             {
163                 'name': 'person_name',
164                 'type': 'string'
165             },
166             {
167                 'name': 'event_when',
168                 'type': 'date',
169                 'dateFormat': 'Y-m-d'
170             },
171             {
172                 'name': 'action',
173                 'type': 'string'
174             },
175             {
176                 'name': 'ipaddr',
177                 'type': 'string'
178             },
179             {
180                 'name': 'on_id',
181                 'type': 'int'
182             },
183             {
184                 'name': 'on_table',
185                 'type': 'string'
186             },
187             {
188                 'name': 'person_id',
189                 'type': 'int'
190             },
191             {
192                 'name': 'remarks',
193                 'type': 'string'
194             },
195             {
196                 'name': 'person_id_id',
197                 'type': 'int'
198             },
199             {
200                 'name': 'person_id_office_id',
201                 'type': 'int'
202             },
203             {
204                 'name': 'person_id_name',
205                 'type': 'string'
206             },
207             {
208                 'name': 'person_id_phone',
209                 'type': 'string'
210             },
211             {
212                 'name': 'person_id_fax',
213                 'type': 'string'
214             },
215             {
216                 'name': 'person_id_email',
217                 'type': 'string'
218             },
219             {
220                 'name': 'person_id_company_id',
221                 'type': 'int'
222             },
223             {
224                 'name': 'person_id_role',
225                 'type': 'string'
226             },
227             {
228                 'name': 'person_id_active',
229                 'type': 'int'
230             },
231             {
232                 'name': 'person_id_remarks',
233                 'type': 'string'
234             },
235             {
236                 'name': 'person_id_passwd',
237                 'type': 'string'
238             },
239             {
240                 'name': 'person_id_owner_id',
241                 'type': 'int'
242             },
243             {
244                 'name': 'person_id_lang',
245                 'type': 'string'
246             },
247             {
248                 'name': 'person_id_no_reset_sent',
249                 'type': 'int'
250             },
251             {
252                 'name': 'person_id_action_type',
253                 'type': 'string'
254             },
255             {
256                 'name': 'person_id_project_id',
257                 'type': 'int'
258             },
259             {
260                 'name': 'person_id_deleted_by',
261                 'type': 'int'
262             },
263             {
264                 'name': 'person_id_deleted_dt',
265                 'type': 'date'
266             }
267         ],
268         id : 'id',
269         root : 'data',
270         totalProperty : 'total',
271         xns : Roo.data,
272         '|xns' : 'Roo.data'
273        }
274       }
275      },
276      {
277       xtype : 'ComboBox',
278       allowBlank : true,
279       displayField : 'on_table',
280       editable : true,
281       emptyText : _this._strings['679308a758de538c5f39c4c6cdba6593'] /* Select Affects */,
282       forceSelection : true,
283       listWidth : 300,
284       loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
285       minChars : 2,
286       name : 'on_table',
287       pageSize : 20,
288       qtip : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
289       queryParam : 'query[on_table]',
290       selectOnFocus : true,
291       tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{on_table}</b> </div>',
292       triggerAction : 'all',
293       typeAhead : true,
294       valueField : 'action',
295       width : 150,
296       listeners : {
297        render : function (_self)
298         {
299           _this.affectSel = _self;
300         },
301        select : function (combo, record, index)
302         {
303            _this.dategrid.ds.load({});
304         }
305       },
306       xns : Roo.form,
307       '|xns' : 'Roo.form',
308       store : {
309        xtype : 'Store',
310        remoteSort : true,
311        sortInfo : { field : 'on_table' , direction : 'ASC' },
312        listeners : {
313         beforeload : function (_self, o)
314          {
315              o.params = o.params || {};
316              // staff can see all logs, other companies can only see their own.
317              if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
318                  o.params.company_id = Pman.Login.authUser.company_id;
319              }
320              o.params._distinct = 'on_table';
321              o.params._columns ='on_table';
322          }
323        },
324        xns : Roo.data,
325        '|xns' : 'Roo.data',
326        proxy : {
327         xtype : 'HttpProxy',
328         method : 'GET',
329         timeout : 60000,
330         url : baseURL + '/Roo/Events.php',
331         xns : Roo.data,
332         '|xns' : 'Roo.data'
333        },
334        reader : {
335         xtype : 'JsonReader',
336         fields : [
337             {
338                 'name': 'id',
339                 'type': 'int'
340             },
341             {
342                 'name': 'person_name',
343                 'type': 'string'
344             },
345             {
346                 'name': 'event_when',
347                 'type': 'date',
348                 'dateFormat': 'Y-m-d'
349             },
350             {
351                 'name': 'action',
352                 'type': 'string'
353             },
354             {
355                 'name': 'ipaddr',
356                 'type': 'string'
357             },
358             {
359                 'name': 'on_id',
360                 'type': 'int'
361             },
362             {
363                 'name': 'on_table',
364                 'type': 'string'
365             },
366             {
367                 'name': 'person_id',
368                 'type': 'int'
369             },
370             {
371                 'name': 'remarks',
372                 'type': 'string'
373             },
374             {
375                 'name': 'person_id_id',
376                 'type': 'int'
377             },
378             {
379                 'name': 'person_id_office_id',
380                 'type': 'int'
381             },
382             {
383                 'name': 'person_id_name',
384                 'type': 'string'
385             },
386             {
387                 'name': 'person_id_phone',
388                 'type': 'string'
389             },
390             {
391                 'name': 'person_id_fax',
392                 'type': 'string'
393             },
394             {
395                 'name': 'person_id_email',
396                 'type': 'string'
397             },
398             {
399                 'name': 'person_id_company_id',
400                 'type': 'int'
401             },
402             {
403                 'name': 'person_id_role',
404                 'type': 'string'
405             },
406             {
407                 'name': 'person_id_active',
408                 'type': 'int'
409             },
410             {
411                 'name': 'person_id_remarks',
412                 'type': 'string'
413             },
414             {
415                 'name': 'person_id_passwd',
416                 'type': 'string'
417             },
418             {
419                 'name': 'person_id_owner_id',
420                 'type': 'int'
421             },
422             {
423                 'name': 'person_id_lang',
424                 'type': 'string'
425             },
426             {
427                 'name': 'person_id_no_reset_sent',
428                 'type': 'int'
429             },
430             {
431                 'name': 'person_id_action_type',
432                 'type': 'string'
433             },
434             {
435                 'name': 'person_id_project_id',
436                 'type': 'int'
437             },
438             {
439                 'name': 'person_id_deleted_by',
440                 'type': 'int'
441             },
442             {
443                 'name': 'person_id_deleted_dt',
444                 'type': 'date'
445             }
446         ],
447         id : 'id',
448         root : 'data',
449         totalProperty : 'total',
450         xns : Roo.data,
451         '|xns' : 'Roo.data'
452        }
453       }
454      }
455     ]
456    },
457    layout : {
458     xtype : 'BorderLayout',
459     xns : Roo,
460     '|xns' : 'Roo',
461     center : {
462      xtype : 'LayoutRegion',
463      xns : Roo,
464      '|xns' : 'Roo'
465     },
466     east : {
467      xtype : 'LayoutRegion',
468      split : true,
469      tabPosition : 'top',
470      width : 600,
471      xns : Roo,
472      '|xns' : 'Roo'
473     },
474     west : {
475      xtype : 'LayoutRegion',
476      split : true,
477      width : 300,
478      xns : Roo,
479      '|xns' : 'Roo'
480     },
481     items  : [
482      {
483       xtype : 'GridPanel',
484       background : false,
485       fitContainer : true,
486       fitToframe : true,
487       region : 'west',
488       tableName : 'Events',
489       title : _this._strings['87f9f735a1d36793ceaecd4e47124b63'] /* Events */,
490       listeners : {
491        activate : function() {
492             _this.datepanel = this;
493             if (_this.dategrid) {
494                 _this.dategrid.ds.load({});
495             }
496         }
497       },
498       xns : Roo,
499       '|xns' : 'Roo',
500       grid : {
501        xtype : 'Grid',
502        autoExpandColumn : 'person_name',
503        loadMask : true,
504        listeners : {
505         render : function() 
506          {
507              _this.dategrid = this; 
508              //_this.dialog = Pman.Dialog.FILL_IN
509              if (_this.panel.active) {
510                 this.ds.load({});
511              }
512          },
513         rowclick : function (_self, rowIndex, e)
514          {
515              _this.tablegrid.footer.onClick('first');
516          }
517        },
518        xns : Roo.grid,
519        '|xns' : 'Roo.grid',
520        dataSource : {
521         xtype : 'Store',
522         remoteSort : true,
523         sortInfo : { field : 'person_id_name', direction: 'ASC' },
524         listeners : {
525          beforeload : function (_self, o)
526           {
527               
528               
529               if (! _this.dateFrom) {
530                   return;
531               }
532           
533                try {
534                    _this.tablegrid.ds.removeAll();
535                    _this.panel.layout.getRegion('east').getActivePanel().grid.ds.removeAll();
536                    
537               } catch (e) {
538                   // do nothing..
539               }
540               o.params = o.params || {};
541                
542               var act = _this.actionSel ? _this.actionSel.getValue() : '';
543               if (act.length) {
544                   o.params.action = act;
545               }
546               var tbl = _this.affectSel ? _this.affectSel.getValue() : '';
547               if (tbl.length) {
548                   o.params.on_table = tbl;
549               }
550               act = _this.dateFrom.getValue();
551               if (act.format) {
552                   o.params['query[from]'] = act.format('Y-m-d');
553               }
554               act = _this.dateTo.getValue();
555               if (act.format) {
556                   o.params['query[to]'] = act.format('Y-m-d');
557               }
558               
559               
560               
561               o.params['query[person_sum]'] = 1;
562               o.params._columns = 'person_id,person_id_name,person_id_email,qty,uqty';
563               o.params.limit = 999;
564            
565           }
566         },
567         xns : Roo.data,
568         '|xns' : 'Roo.data',
569         proxy : {
570          xtype : 'HttpProxy',
571          method : 'GET',
572          url : baseURL + '/Roo/Events.php',
573          xns : Roo.data,
574          '|xns' : 'Roo.data'
575         },
576         reader : {
577          xtype : 'JsonReader',
578          fields : [
579              {
580                  'name': 'id',
581                  'type': 'int'
582              },
583              {
584                  'name': 'person_name',
585                  'type': 'string'
586              },
587              {
588                  'name': 'event_when',
589                  'type': 'date',
590                  'dateFormat': 'Y-m-d'
591              },
592              {
593                  'name': 'action',
594                  'type': 'string'
595              },
596              {
597                  'name': 'ipaddr',
598                  'type': 'string'
599              },
600              {
601                  'name': 'on_id',
602                  'type': 'int'
603              },
604              {
605                  'name': 'on_table',
606                  'type': 'string'
607              },
608              {
609                  'name': 'person_id',
610                  'type': 'int'
611              },
612              {
613                  'name': 'remarks',
614                  'type': 'string'
615              },
616              {
617                  'name': 'person_id_id',
618                  'type': 'int'
619              },
620              {
621                  'name': 'person_id_office_id',
622                  'type': 'int'
623              },
624              {
625                  'name': 'person_id_name',
626                  'type': 'string'
627              },
628              {
629                  'name': 'person_id_phone',
630                  'type': 'string'
631              },
632              {
633                  'name': 'person_id_fax',
634                  'type': 'string'
635              },
636              {
637                  'name': 'person_id_email',
638                  'type': 'string'
639              },
640              {
641                  'name': 'person_id_company_id',
642                  'type': 'int'
643              },
644              {
645                  'name': 'person_id_role',
646                  'type': 'string'
647              },
648              {
649                  'name': 'person_id_active',
650                  'type': 'int'
651              },
652              {
653                  'name': 'person_id_remarks',
654                  'type': 'string'
655              },
656              {
657                  'name': 'person_id_passwd',
658                  'type': 'string'
659              },
660              {
661                  'name': 'person_id_owner_id',
662                  'type': 'int'
663              },
664              {
665                  'name': 'person_id_lang',
666                  'type': 'string'
667              },
668              {
669                  'name': 'person_id_no_reset_sent',
670                  'type': 'int'
671              },
672              {
673                  'name': 'person_id_action_type',
674                  'type': 'string'
675              },
676              {
677                  'name': 'person_id_project_id',
678                  'type': 'int'
679              },
680              {
681                  'name': 'person_id_deleted_by',
682                  'type': 'int'
683              },
684              {
685                  'name': 'person_id_deleted_dt',
686                  'type': 'date'
687              }
688          ],
689          id : 'id',
690          root : 'data',
691          totalProperty : 'total',
692          xns : Roo.data,
693          '|xns' : 'Roo.data'
694         }
695        },
696        colModel : [
697         {
698          xtype : 'ColumnModel',
699          dataIndex : 'person_id_name',
700          header : _this._strings['d9578744f1d4b13d40a51fbb8b9d6ea5'] /* Person name */,
701          renderer : function(v,x,r) {
702               return String.format('{0} &lt;<a href="mailto:{1}">{1}</a>&gt;', v, r.data.person_id_email); 
703           },
704          sortable : true,
705          width : 200,
706          xns : Roo.grid,
707          '|xns' : 'Roo.grid'
708         },
709         {
710          xtype : 'ColumnModel',
711          dataIndex : 'uqty',
712          header : _this._strings['b5fe0746885b906c8ed9b7cc06023c35'] /* #Affected */,
713          renderer : function(v) { return String.format('{0}', v); },
714          sortable : true,
715          width : 70,
716          xns : Roo.grid,
717          '|xns' : 'Roo.grid'
718         },
719         {
720          xtype : 'ColumnModel',
721          dataIndex : 'qty',
722          header : _this._strings['c112bb3542e98308d12d5ecb10a67abc'] /* Changes */,
723          renderer : function(v) { return String.format('{0}', v); },
724          sortable : true,
725          width : 70,
726          xns : Roo.grid,
727          '|xns' : 'Roo.grid'
728         }
729        ]
730       }
731      },
732      {
733       xtype : 'GridPanel',
734       background : false,
735       fitContainer : true,
736       fitToframe : true,
737       region : 'center',
738       tableName : 'Events',
739       title : _this._strings['87f9f735a1d36793ceaecd4e47124b63'] /* Events */,
740       listeners : {
741        activate : function() {
742             _this.tablepanel = this;
743             if (_this.tablegrid) {
744                 _this.tablegrid.footer.onClick('first');
745             }
746         }
747       },
748       xns : Roo,
749       '|xns' : 'Roo',
750       grid : {
751        xtype : 'Grid',
752        autoExpandColumn : 'person_name',
753        loadMask : true,
754        listeners : {
755         render : function() 
756          {
757              _this.tablegrid = this; 
758              //_this.dialog = Pman.Dialog.FILL_IN
759              if (_this.tablepanel.active) {
760                 this.footer.onClick('first');
761              }
762          },
763         rowclick : function (_self, rowIndex, e)
764          {
765           
766              _this.panel.layout.getRegion('east').getActivePanel().grid.footer.onClick('first');
767          }
768        },
769        xns : Roo.grid,
770        '|xns' : 'Roo.grid',
771        footer : {
772         xtype : 'PagingToolbar',
773         displayInfo : true,
774         displayMsg : _this._strings['7205d42d6d975c911bc1147259d78935'] /* Displaying Events{0} - {1} of {2} */,
775         emptyMsg : _this._strings['90e4ac2e5a22e53df63b6b186d8727ba'] /* No Events found */,
776         pageSize : 25,
777         xns : Roo,
778         '|xns' : 'Roo'
779        },
780        dataSource : {
781         xtype : 'Store',
782         remoteSort : true,
783         sortInfo : { field : 'on_table', direction: 'ASC' },
784         listeners : {
785          beforeload : function (_self, o)
786           {
787                if (! _this.dategrid) {
788                return;
789               }
790               try {
791                    _this.panel.layout.getRegion('east').getActivePanel().grid.ds.removeAll();
792                    
793               } catch (e) {
794                   // do nothing..
795               }
796               
797               var s = _this.dategrid.selModel.getSelected();
798               if (!s) {
799                   _this.tablegrid.view.el.mask("Select a person");
800                   return false;
801               }
802               _this.tablegrid.view.el.unmask();
803            
804               o.params = o.params || {};
805               var act = _this.actionSel.getValue();
806               if (act.length) {
807                   o.params.action = act;
808               }
809               var tbl = _this.affectSel.getValue();
810               if (tbl.length) {
811                   o.params.on_table = tbl;
812               }
813            
814               act = _this.dateFrom.getValue();
815               if (act.format) {
816                   o.params['query[from]'] = act.format('Y-m-d');
817               }
818               act = _this.dateTo.getValue();
819               if (act.format) {
820                   o.params['query[to]'] = act.format('Y-m-d');
821               }
822               o.params.person_id = s.data.person_id;
823               o.params['query[table_sum]'] = 1;
824               o.params._columns = 'on_table,qty,uqty';
825           
826               
827           }
828         },
829         xns : Roo.data,
830         '|xns' : 'Roo.data',
831         proxy : {
832          xtype : 'HttpProxy',
833          method : 'GET',
834          url : baseURL + '/Roo/Events.php',
835          xns : Roo.data,
836          '|xns' : 'Roo.data'
837         },
838         reader : {
839          xtype : 'JsonReader',
840          fields : [
841              {
842                  'name': 'id',
843                  'type': 'int'
844              },
845              {
846                  'name': 'person_name',
847                  'type': 'string'
848              },
849              {
850                  'name': 'event_when',
851                  'type': 'date',
852                  'dateFormat': 'Y-m-d'
853              },
854              {
855                  'name': 'action',
856                  'type': 'string'
857              },
858              {
859                  'name': 'ipaddr',
860                  'type': 'string'
861              },
862              {
863                  'name': 'on_id',
864                  'type': 'int'
865              },
866              {
867                  'name': 'on_table',
868                  'type': 'string'
869              },
870              {
871                  'name': 'person_id',
872                  'type': 'int'
873              },
874              {
875                  'name': 'remarks',
876                  'type': 'string'
877              },
878              {
879                  'name': 'person_id_id',
880                  'type': 'int'
881              },
882              {
883                  'name': 'person_id_office_id',
884                  'type': 'int'
885              },
886              {
887                  'name': 'person_id_name',
888                  'type': 'string'
889              },
890              {
891                  'name': 'person_id_phone',
892                  'type': 'string'
893              },
894              {
895                  'name': 'person_id_fax',
896                  'type': 'string'
897              },
898              {
899                  'name': 'person_id_email',
900                  'type': 'string'
901              },
902              {
903                  'name': 'person_id_company_id',
904                  'type': 'int'
905              },
906              {
907                  'name': 'person_id_role',
908                  'type': 'string'
909              },
910              {
911                  'name': 'person_id_active',
912                  'type': 'int'
913              },
914              {
915                  'name': 'person_id_remarks',
916                  'type': 'string'
917              },
918              {
919                  'name': 'person_id_passwd',
920                  'type': 'string'
921              },
922              {
923                  'name': 'person_id_owner_id',
924                  'type': 'int'
925              },
926              {
927                  'name': 'person_id_lang',
928                  'type': 'string'
929              },
930              {
931                  'name': 'person_id_no_reset_sent',
932                  'type': 'int'
933              },
934              {
935                  'name': 'person_id_action_type',
936                  'type': 'string'
937              },
938              {
939                  'name': 'person_id_project_id',
940                  'type': 'int'
941              },
942              {
943                  'name': 'person_id_deleted_by',
944                  'type': 'int'
945              },
946              {
947                  'name': 'person_id_deleted_dt',
948                  'type': 'date'
949              }
950          ],
951          id : 'id',
952          root : 'data',
953          totalProperty : 'total',
954          xns : Roo.data,
955          '|xns' : 'Roo.data'
956         }
957        },
958        colModel : [
959         {
960          xtype : 'ColumnModel',
961          dataIndex : 'on_table',
962          header : _this._strings['51c45b795d5d18a3e4e0c37e8b20a141'] /* Table */,
963          renderer : function(v) { 
964              if (!v.length) {
965                  return "Login / Logout / Errors";
966              }
967              return String.format('{0}', v); 
968          },
969          sortable : true,
970          width : 200,
971          xns : Roo.grid,
972          '|xns' : 'Roo.grid'
973         },
974         {
975          xtype : 'ColumnModel',
976          dataIndex : 'uqty',
977          header : _this._strings['b5fe0746885b906c8ed9b7cc06023c35'] /* #Affected */,
978          renderer : function(v) { return String.format('{0}', v); },
979          sortable : true,
980          width : 70,
981          xns : Roo.grid,
982          '|xns' : 'Roo.grid'
983         },
984         {
985          xtype : 'ColumnModel',
986          dataIndex : 'qty',
987          header : _this._strings['c112bb3542e98308d12d5ecb10a67abc'] /* Changes */,
988          renderer : function(v) { return String.format('{0}', v); },
989          sortable : true,
990          width : 70,
991          xns : Roo.grid,
992          '|xns' : 'Roo.grid'
993         }
994        ]
995       }
996      },
997      {
998       xtype : 'GridPanel',
999       background : true,
1000       fitContainer : true,
1001       fitToframe : true,
1002       region : 'east',
1003       tableName : 'Events',
1004       title : _this._strings['a254c25adc7d10d7e9c4889484f875a5'] /* Detail */,
1005       listeners : {
1006        activate : function() {
1007             _this.detailpanel = this;
1008             if (_this.detailgrid) {
1009                 _this.detailgrid.footer.onClick('first');
1010             }
1011         }
1012       },
1013       xns : Roo,
1014       '|xns' : 'Roo',
1015       grid : {
1016        xtype : 'Grid',
1017        autoExpandColumn : 'person_name',
1018        loadMask : true,
1019        listeners : {
1020         render : function() 
1021          {
1022              _this.detailgrid = this; 
1023              //_this.dialog = Pman.Dialog.FILL_IN
1024              if (_this.detailpanel.active) {
1025                 this.footer.onClick('first');
1026              }
1027          }
1028        },
1029        xns : Roo.grid,
1030        '|xns' : 'Roo.grid',
1031        footer : {
1032         xtype : 'PagingToolbar',
1033         displayInfo : true,
1034         displayMsg : _this._strings['7205d42d6d975c911bc1147259d78935'] /* Displaying Events{0} - {1} of {2} */,
1035         emptyMsg : _this._strings['90e4ac2e5a22e53df63b6b186d8727ba'] /* No Events found */,
1036         pageSize : 25,
1037         xns : Roo,
1038         '|xns' : 'Roo'
1039        },
1040        dataSource : {
1041         xtype : 'Store',
1042         remoteSort : true,
1043         sortInfo : { field : 'event_when', direction: 'DESC' },
1044         listeners : {
1045          beforeload : function (_self, o)
1046           {
1047                if (! _this.dategrid) {
1048                    return false;
1049               }
1050               
1051               o.params = o.params || {};
1052               
1053               var s = _this.dategrid.selModel.getSelected();
1054               if (!s) {
1055                   _this.detailgrid.view.el.mask("Select a person");
1056                   return false;
1057               }
1058               
1059               o.params.person_id = s.data.person_id;    
1060               
1061               var s = _this.tablegrid.selModel.getSelected();
1062               if (!s) {
1063                   _this.detailgrid.view.el.mask("Select a table");
1064                   return false;
1065               }
1066               o.params.on_table = s.data.on_table;        
1067               
1068               _this.detailgrid.view.el.unmask();
1069            
1070               var act = _this.actionSel.getValue();
1071               if (act.length) {
1072                   o.params.action = act;
1073               }
1074               var tbl = _this.affectSel.getValue();
1075               if (tbl.length) {
1076                   o.params.on_table = tbl;
1077               }
1078                
1079            
1080               act = _this.dateFrom.getValue();
1081               if (act.format) {
1082                   o.params['query[from]'] = act.format('Y-m-d');
1083               }
1084               act = _this.dateTo.getValue();
1085               if (act.format) {
1086                   o.params['query[to]'] = act.format('Y-m-d');
1087               }
1088           
1089               //o.params['query[table_d]'] = 1;
1090               //o.params._columns = 'on_table,qty,uqty';
1091           
1092               
1093           }
1094         },
1095         xns : Roo.data,
1096         '|xns' : 'Roo.data',
1097         proxy : {
1098          xtype : 'HttpProxy',
1099          method : 'GET',
1100          url : baseURL + '/Roo/Events.php',
1101          xns : Roo.data,
1102          '|xns' : 'Roo.data'
1103         },
1104         reader : {
1105          xtype : 'JsonReader',
1106          fields : [
1107              {
1108                  'name': 'id',
1109                  'type': 'int'
1110              },
1111              {
1112                  'name': 'person_name',
1113                  'type': 'string'
1114              },
1115              {
1116                  'name': 'event_when',
1117                  'type': 'date',
1118                  'dateFormat': 'Y-m-d'
1119              },
1120              {
1121                  'name': 'action',
1122                  'type': 'string'
1123              },
1124              {
1125                  'name': 'ipaddr',
1126                  'type': 'string'
1127              },
1128              {
1129                  'name': 'on_id',
1130                  'type': 'int'
1131              },
1132              {
1133                  'name': 'on_table',
1134                  'type': 'string'
1135              },
1136              {
1137                  'name': 'person_id',
1138                  'type': 'int'
1139              },
1140              {
1141                  'name': 'remarks',
1142                  'type': 'string'
1143              },
1144              {
1145                  'name': 'person_id_id',
1146                  'type': 'int'
1147              },
1148              {
1149                  'name': 'person_id_office_id',
1150                  'type': 'int'
1151              },
1152              {
1153                  'name': 'person_id_name',
1154                  'type': 'string'
1155              },
1156              {
1157                  'name': 'person_id_phone',
1158                  'type': 'string'
1159              },
1160              {
1161                  'name': 'person_id_fax',
1162                  'type': 'string'
1163              },
1164              {
1165                  'name': 'person_id_email',
1166                  'type': 'string'
1167              },
1168              {
1169                  'name': 'person_id_company_id',
1170                  'type': 'int'
1171              },
1172              {
1173                  'name': 'person_id_role',
1174                  'type': 'string'
1175              },
1176              {
1177                  'name': 'person_id_active',
1178                  'type': 'int'
1179              },
1180              {
1181                  'name': 'person_id_remarks',
1182                  'type': 'string'
1183              },
1184              {
1185                  'name': 'person_id_passwd',
1186                  'type': 'string'
1187              },
1188              {
1189                  'name': 'person_id_owner_id',
1190                  'type': 'int'
1191              },
1192              {
1193                  'name': 'person_id_lang',
1194                  'type': 'string'
1195              },
1196              {
1197                  'name': 'person_id_no_reset_sent',
1198                  'type': 'int'
1199              },
1200              {
1201                  'name': 'person_id_action_type',
1202                  'type': 'string'
1203              },
1204              {
1205                  'name': 'person_id_project_id',
1206                  'type': 'int'
1207              },
1208              {
1209                  'name': 'person_id_deleted_by',
1210                  'type': 'int'
1211              },
1212              {
1213                  'name': 'person_id_deleted_dt',
1214                  'type': 'date'
1215              }
1216          ],
1217          id : 'id',
1218          root : 'data',
1219          totalProperty : 'total',
1220          xns : Roo.data,
1221          '|xns' : 'Roo.data'
1222         }
1223        },
1224        colModel : [
1225         {
1226          xtype : 'ColumnModel',
1227          dataIndex : 'id',
1228          header : _this._strings['490aa6e856ccf208a054389e47ce0d06'] /* Id */,
1229          renderer : function(v) { return String.format('{0}', v); },
1230          width : 50,
1231          xns : Roo.grid,
1232          '|xns' : 'Roo.grid'
1233         },
1234         {
1235          xtype : 'ColumnModel',
1236          dataIndex : 'event_when',
1237          header : _this._strings['6be4aa550791c310e098cd6c234af7d8'] /* Event when */,
1238          renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); },
1239          width : 75,
1240          xns : Roo.grid,
1241          '|xns' : 'Roo.grid'
1242         },
1243         {
1244          xtype : 'ColumnModel',
1245          dataIndex : 'action',
1246          header : _this._strings['004bf6c9a40003140292e97330236c53'] /* Action */,
1247          renderer : function(v) { return String.format('{0}', v); },
1248          width : 50,
1249          xns : Roo.grid,
1250          '|xns' : 'Roo.grid'
1251         },
1252         {
1253          xtype : 'ColumnModel',
1254          dataIndex : 'ipaddr',
1255          header : _this._strings['7a11042f53957727d8667732d7de1102'] /* Ipaddr */,
1256          renderer : function(v) { return String.format('{0}', v); },
1257          width : 100,
1258          xns : Roo.grid,
1259          '|xns' : 'Roo.grid'
1260         },
1261         {
1262          xtype : 'ColumnModel',
1263          dataIndex : 'on_id',
1264          header : _this._strings['739cea2b85156183f917f2ccaa10a50c'] /* #ID */,
1265          renderer : function(v) { return String.format('{0}', v); },
1266          width : 75,
1267          xns : Roo.grid,
1268          '|xns' : 'Roo.grid'
1269         },
1270         {
1271          xtype : 'ColumnModel',
1272          dataIndex : 'remarks',
1273          header : _this._strings['231bc72756b5e6de492aaaa1577f61b1'] /* Remarks */,
1274          renderer : function(v) { return String.format('{0}', v); },
1275          width : 200,
1276          xns : Roo.grid,
1277          '|xns' : 'Roo.grid'
1278         }
1279        ]
1280       }
1281      },
1282      {
1283       xtype : 'GridPanel',
1284       background : true,
1285       fitContainer : true,
1286       fitToframe : true,
1287       region : 'east',
1288       tableName : 'Events',
1289       title : _this._strings['f971b3a2cc583b475332380649a4fa05'] /* Daily summary */,
1290       listeners : {
1291        activate : function() {
1292             _this.daypanel = this;
1293             if (_this.daygrid) {
1294                 _this.daygrid.footer.onClick('first');
1295             }
1296         }
1297       },
1298       xns : Roo,
1299       '|xns' : 'Roo',
1300       grid : {
1301        xtype : 'Grid',
1302        autoExpandColumn : 'person_name',
1303        loadMask : true,
1304        listeners : {
1305         render : function() 
1306          {
1307              _this.daygrid = this; 
1308              //_this.dialog = Pman.Dialog.FILL_IN
1309              if (_this.daypanel.active) {
1310                 this.footer.onClick('first');
1311              }
1312          }
1313        },
1314        xns : Roo.grid,
1315        '|xns' : 'Roo.grid',
1316        footer : {
1317         xtype : 'PagingToolbar',
1318         displayInfo : true,
1319         displayMsg : _this._strings['7205d42d6d975c911bc1147259d78935'] /* Displaying Events{0} - {1} of {2} */,
1320         emptyMsg : _this._strings['90e4ac2e5a22e53df63b6b186d8727ba'] /* No Events found */,
1321         pageSize : 25,
1322         xns : Roo,
1323         '|xns' : 'Roo'
1324        },
1325        dataSource : {
1326         xtype : 'Store',
1327         remoteSort : true,
1328         sortInfo : { field : 'on_day', direction: 'ASC' },
1329         listeners : {
1330          beforeload : function (_self, o)
1331           {
1332                if (! _this.dategrid) {
1333                    return false;
1334               }
1335               
1336               o.params = o.params || {};
1337               
1338               var s = _this.dategrid.selModel.getSelected();
1339               if (!s) {
1340                   _this.detailgrid.view.el.mask("Select a person");
1341                   return false;
1342               }
1343               
1344               o.params.person_id = s.data.person_id;    
1345               
1346               var s = _this.tablegrid.selModel.getSelected();
1347               if (!s) {
1348                   _this.detailgrid.view.el.mask("Select a table");
1349                   return false;
1350               }
1351               o.params.on_table = s.data.on_table;        
1352               
1353               _this.detailgrid.view.el.unmask();
1354            
1355               var act = _this.actionSel.getValue();
1356               if (act.length) {
1357                   o.params.action = act;
1358               }
1359               var tbl = _this.affectSel.getValue();
1360               if (tbl.length) {
1361                   o.params.on_table = tbl;
1362               }
1363                
1364            
1365               act = _this.dateFrom.getValue();
1366               if (act.format) {
1367                   o.params['query[from]'] = act.format('Y-m-d');
1368               }
1369               act = _this.dateTo.getValue();
1370               if (act.format) {
1371                   o.params['query[to]'] = act.format('Y-m-d');
1372               }
1373           
1374               o.params['query[day_sum]'] = 1;
1375               o.params._columns = 'on_day,qty,uqty';
1376           
1377               
1378           }
1379         },
1380         xns : Roo.data,
1381         '|xns' : 'Roo.data',
1382         proxy : {
1383          xtype : 'HttpProxy',
1384          method : 'GET',
1385          url : baseURL + '/Roo/Events.php',
1386          xns : Roo.data,
1387          '|xns' : 'Roo.data'
1388         },
1389         reader : {
1390          xtype : 'JsonReader',
1391          fields : [
1392              {
1393                  'name': 'id',
1394                  'type': 'int'
1395              },
1396              {
1397                  'name': 'person_name',
1398                  'type': 'string'
1399              },
1400              {
1401                  'name': 'event_when',
1402                  'type': 'date',
1403                  'dateFormat': 'Y-m-d'
1404              },
1405              {
1406                  'name': 'action',
1407                  'type': 'string'
1408              },
1409              {
1410                  'name': 'ipaddr',
1411                  'type': 'string'
1412              },
1413              {
1414                  'name': 'on_id',
1415                  'type': 'int'
1416              },
1417              {
1418                  'name': 'on_table',
1419                  'type': 'string'
1420              },
1421              {
1422                  'name': 'person_id',
1423                  'type': 'int'
1424              },
1425              {
1426                  'name': 'remarks',
1427                  'type': 'string'
1428              },
1429              {
1430                  'name': 'person_id_id',
1431                  'type': 'int'
1432              },
1433              {
1434                  'name': 'person_id_office_id',
1435                  'type': 'int'
1436              },
1437              {
1438                  'name': 'person_id_name',
1439                  'type': 'string'
1440              },
1441              {
1442                  'name': 'person_id_phone',
1443                  'type': 'string'
1444              },
1445              {
1446                  'name': 'person_id_fax',
1447                  'type': 'string'
1448              },
1449              {
1450                  'name': 'person_id_email',
1451                  'type': 'string'
1452              },
1453              {
1454                  'name': 'person_id_company_id',
1455                  'type': 'int'
1456              },
1457              {
1458                  'name': 'person_id_role',
1459                  'type': 'string'
1460              },
1461              {
1462                  'name': 'person_id_active',
1463                  'type': 'int'
1464              },
1465              {
1466                  'name': 'person_id_remarks',
1467                  'type': 'string'
1468              },
1469              {
1470                  'name': 'person_id_passwd',
1471                  'type': 'string'
1472              },
1473              {
1474                  'name': 'person_id_owner_id',
1475                  'type': 'int'
1476              },
1477              {
1478                  'name': 'person_id_lang',
1479                  'type': 'string'
1480              },
1481              {
1482                  'name': 'person_id_no_reset_sent',
1483                  'type': 'int'
1484              },
1485              {
1486                  'name': 'person_id_action_type',
1487                  'type': 'string'
1488              },
1489              {
1490                  'name': 'person_id_project_id',
1491                  'type': 'int'
1492              },
1493              {
1494                  'name': 'person_id_deleted_by',
1495                  'type': 'int'
1496              },
1497              {
1498                  'name': 'person_id_deleted_dt',
1499                  'type': 'date'
1500              }
1501          ],
1502          id : 'id',
1503          root : 'data',
1504          totalProperty : 'total',
1505          xns : Roo.data,
1506          '|xns' : 'Roo.data'
1507         }
1508        },
1509        colModel : [
1510         {
1511          xtype : 'ColumnModel',
1512          dataIndex : 'on_day',
1513          header : _this._strings['6be4aa550791c310e098cd6c234af7d8'] /* Event when */,
1514          renderer : function(v) { return String.format('{0}', v  ); },
1515          sortable : true,
1516          width : 75,
1517          xns : Roo.grid,
1518          '|xns' : 'Roo.grid'
1519         },
1520         {
1521          xtype : 'ColumnModel',
1522          dataIndex : 'uqty',
1523          header : _this._strings['b5fe0746885b906c8ed9b7cc06023c35'] /* #Affected */,
1524          renderer : function(v) { return String.format('{0}', v); },
1525          sortable : true,
1526          width : 70,
1527          xns : Roo.grid,
1528          '|xns' : 'Roo.grid'
1529         },
1530         {
1531          xtype : 'ColumnModel',
1532          dataIndex : 'qty',
1533          header : _this._strings['c112bb3542e98308d12d5ecb10a67abc'] /* Changes */,
1534          renderer : function(v) { return String.format('{0}', v); },
1535          sortable : true,
1536          width : 70,
1537          xns : Roo.grid,
1538          '|xns' : 'Roo.grid'
1539         }
1540        ]
1541       }
1542      }
1543     ]
1544    }
1545   };  }
1546 });