1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
7 // register the module first
8 Pman.on('beforeload', function()
11 part : ["Admin","LogDrill"],
12 modKey : '003-Pman.Tab.AdminLogDrill',
13 module : Pman.Tab.AdminLogDrill,
15 parent : Pman.Tab.AdminLogs,
16 name : "Pman.Tab.AdminLogDrill",
22 Pman.Tab.AdminLogDrill = new Roo.util.Observable({
28 add : function(parentLayout, region)
32 this.parentLayout = parentLayout;
34 this.panel = parentLayout.addxtype({
35 xtype: 'NestedLayoutPanel',
38 title : "Event Drilldown",
40 xtype: 'BorderLayout',
47 activate : function() {
48 _this.datepanel = this;
50 _this.dategrid.ds.load({});
66 _this.dategrid = this;
67 //_this.dialog = Pman.Dialog.FILL_IN
68 if (_this.panel.active) {
73 autoExpandColumn : 'person_name',
79 beforeload : function (_self, options)
81 if (! _this.dateFrom) {
84 o.params = o.params || {};
87 act = _this.dateFrom.getValue();
89 o.params['query[from]'] = act.format('Y-m-d');
91 act = _this.dateTo.getValue();
93 o.params['query[to]'] = act.format('Y-m-d');
95 o.params['query[person_sum]'] = 1;
96 o.params._columns = 'person_id_name,qty';
101 sortInfo : { field : 'person_name', direction: 'ASC' },
106 url : baseURL + '/Roo/Events.php'
111 totalProperty : 'total',
120 'name': 'person_name',
124 'name': 'event_when',
126 'dateFormat': 'Y-m-d'
153 'name': 'person_id_id',
157 'name': 'person_id_office_id',
161 'name': 'person_id_name',
165 'name': 'person_id_phone',
169 'name': 'person_id_fax',
173 'name': 'person_id_email',
177 'name': 'person_id_company_id',
181 'name': 'person_id_role',
185 'name': 'person_id_active',
189 'name': 'person_id_remarks',
193 'name': 'person_id_passwd',
197 'name': 'person_id_owner_id',
201 'name': 'person_id_lang',
205 'name': 'person_id_no_reset_sent',
209 'name': 'person_id_action_type',
213 'name': 'person_id_project_id',
217 'name': 'person_id_deleted_by',
221 'name': 'person_id_deleted_dt',
240 render : function (_self)
242 _this.dateTo = _self;
244 change : function (_self, newValue, oldValue)
246 _this.grid.footer.onClick('first');
255 render : function (_self)
257 _this.dateFrom = _self;
259 change : function (_self, newValue, oldValue)
261 _this.grid.footer.onClick('first');
270 xtype: 'ColumnModel',
272 header : 'Person name',
274 dataIndex : 'person_name',
275 renderer : function(v) { return String.format('{0}', v); }
278 xtype: 'ColumnModel',
283 renderer : function(v) { return String.format('{0}', v); }
292 activate : function() {
293 _this.tablepanel = this;
294 if (_this.tablegrid) {
295 _this.tablegrid.footer.onClick('first');
303 tableName : 'Events',
311 _this.tablegrid = this;
312 //_this.dialog = Pman.Dialog.FILL_IN
313 if (_this.tablepanel.active) {
314 this.footer.onClick('first');
317 rowdblclick : function (_self, rowIndex, e)
319 if (!_this.dialog) return;
320 _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
321 _this.grid.footer.onClick('first');
325 autoExpandColumn : 'person_name',
331 sortInfo : { field : 'person_name', direction: 'ASC' },
336 url : baseURL + '/Roo/Events.php'
341 totalProperty : 'total',
350 'name': 'person_name',
354 'name': 'event_when',
356 'dateFormat': 'Y-m-d'
383 'name': 'person_id_id',
387 'name': 'person_id_office_id',
391 'name': 'person_id_name',
395 'name': 'person_id_phone',
399 'name': 'person_id_fax',
403 'name': 'person_id_email',
407 'name': 'person_id_company_id',
411 'name': 'person_id_role',
415 'name': 'person_id_active',
419 'name': 'person_id_remarks',
423 'name': 'person_id_passwd',
427 'name': 'person_id_owner_id',
431 'name': 'person_id_lang',
435 'name': 'person_id_no_reset_sent',
439 'name': 'person_id_action_type',
443 'name': 'person_id_project_id',
447 'name': 'person_id_deleted_by',
451 'name': 'person_id_deleted_dt',
458 xtype: 'PagingToolbar',
462 displayMsg : "Displaying Events{0} - {1} of {2}",
463 emptyMsg : "No Events found"
473 select : function (combo, record, index)
475 _this.grid.footer.onClick('first');
477 render : function (_self)
479 _this.actionSel = _self;
483 displayField : 'action',
485 emptyText : "Select Action",
486 forceSelection : true,
488 loadingText : "Searching...",
492 qtip : "Select Action",
493 queryParam : 'query[action]',
494 selectOnFocus : true,
495 tpl : '<div class="x-grid-cell-text x-btn button"><b>{action}</b> </div>',
496 triggerAction : 'all',
498 valueField : 'action',
504 beforeload : function (_self, o)
506 o.params = o.params || {};
507 // staff can see all logs, other companies can only see their own.
508 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
509 o.params.company_id = Pman.Login.authUser.company_id;
511 o.params._distinct = 'action';
512 o.params._columns ='action';
516 sortInfo : { field : 'action' , direction : 'ASC' },
521 url : baseURL + '/Roo/Events.php'
526 totalProperty : 'total',
535 'name': 'person_name',
539 'name': 'event_when',
541 'dateFormat': 'Y-m-d'
568 'name': 'person_id_id',
572 'name': 'person_id_office_id',
576 'name': 'person_id_name',
580 'name': 'person_id_phone',
584 'name': 'person_id_fax',
588 'name': 'person_id_email',
592 'name': 'person_id_company_id',
596 'name': 'person_id_role',
600 'name': 'person_id_active',
604 'name': 'person_id_remarks',
608 'name': 'person_id_passwd',
612 'name': 'person_id_owner_id',
616 'name': 'person_id_lang',
620 'name': 'person_id_no_reset_sent',
624 'name': 'person_id_action_type',
628 'name': 'person_id_project_id',
632 'name': 'person_id_deleted_by',
636 'name': 'person_id_deleted_dt',
647 select : function (combo, record, index)
649 _this.grid.footer.onClick('first');
651 render : function (_self)
653 _this.affectSel = _self;
657 displayField : 'on_table',
659 emptyText : "Select Affects",
660 forceSelection : true,
662 loadingText : "Searching...",
666 qtip : "Select Action",
667 queryParam : 'query[on_table]',
668 selectOnFocus : true,
669 tpl : '<div class="x-grid-cell-text x-btn button"><b>{on_table}</b> </div>',
670 triggerAction : 'all',
672 valueField : 'action',
678 beforeload : function (_self, o)
680 o.params = o.params || {};
681 // staff can see all logs, other companies can only see their own.
682 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
683 o.params.company_id = Pman.Login.authUser.company_id;
685 o.params._distinct = 'on_table';
686 o.params._columns ='on_table';
690 sortInfo : { field : 'on_table' , direction : 'ASC' },
695 url : baseURL + '/Roo/Events.php'
700 totalProperty : 'total',
709 'name': 'person_name',
713 'name': 'event_when',
715 'dateFormat': 'Y-m-d'
742 'name': 'person_id_id',
746 'name': 'person_id_office_id',
750 'name': 'person_id_name',
754 'name': 'person_id_phone',
758 'name': 'person_id_fax',
762 'name': 'person_id_email',
766 'name': 'person_id_company_id',
770 'name': 'person_id_role',
774 'name': 'person_id_active',
778 'name': 'person_id_remarks',
782 'name': 'person_id_passwd',
786 'name': 'person_id_owner_id',
790 'name': 'person_id_lang',
794 'name': 'person_id_no_reset_sent',
798 'name': 'person_id_action_type',
802 'name': 'person_id_project_id',
806 'name': 'person_id_deleted_by',
810 'name': 'person_id_deleted_dt',
821 xtype: 'ColumnModel',
823 dataIndex : 'table_action',
826 renderer : function(v) { return String.format('{0}', v); }
829 xtype: 'ColumnModel',
834 renderer : function(v) { return String.format('{0}', v); }
843 activate : function() {
844 _this.evpanel = this;
846 _this.evgrid.footer.onClick('first');
854 tableName : 'Events',
863 //_this.dialog = Pman.Dialog.FILL_IN
864 if (_this.evpanel.active) {
865 this.footer.onClick('first');
868 rowdblclick : function (_self, rowIndex, e)
870 if (!_this.dialog) return;
871 _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
872 _this.grid.footer.onClick('first');
876 autoExpandColumn : 'person_name',
882 sortInfo : { field : 'person_name', direction: 'ASC' },
887 url : baseURL + '/Roo/Events.php'
892 totalProperty : 'total',
901 'name': 'person_name',
905 'name': 'event_when',
907 'dateFormat': 'Y-m-d'
934 'name': 'person_id_id',
938 'name': 'person_id_office_id',
942 'name': 'person_id_name',
946 'name': 'person_id_phone',
950 'name': 'person_id_fax',
954 'name': 'person_id_email',
958 'name': 'person_id_company_id',
962 'name': 'person_id_role',
966 'name': 'person_id_active',
970 'name': 'person_id_remarks',
974 'name': 'person_id_passwd',
978 'name': 'person_id_owner_id',
982 'name': 'person_id_lang',
986 'name': 'person_id_no_reset_sent',
990 'name': 'person_id_action_type',
994 'name': 'person_id_project_id',
998 'name': 'person_id_deleted_by',
1002 'name': 'person_id_deleted_dt',
1009 xtype: 'PagingToolbar',
1013 displayMsg : "Displaying Events{0} - {1} of {2}",
1014 emptyMsg : "No Events found"
1029 xtype: 'ColumnModel',
1031 dataIndex : 'table_action',
1034 renderer : function(v) { return String.format('{0}', v); }
1037 xtype: 'ColumnModel',
1042 renderer : function(v) { return String.format('{0}', v); }
1049 xtype: 'LayoutRegion',
1055 xtype: 'LayoutRegion',
1059 xtype: 'LayoutRegion',
1066 this.layout = this.panel.layout;