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) {
72 rowclick : function (_self, rowIndex, e)
74 _this.tablegrid.footer.onClick('first');
77 autoExpandColumn : 'person_name',
83 beforeload : function (_self, o)
85 if (! _this.dateFrom) {
88 o.params = o.params || {};
91 act = _this.dateFrom.getValue();
93 o.params['query[from]'] = act.format('Y-m-d');
95 act = _this.dateTo.getValue();
97 o.params['query[to]'] = act.format('Y-m-d');
99 o.params['query[person_sum]'] = 1;
100 o.params._columns = 'person_id,person_id_name,person_id_email,qty';
101 o.params.limit = 999;
106 sortInfo : { field : 'person_name', direction: 'ASC' },
111 url : baseURL + '/Roo/Events.php'
116 totalProperty : 'total',
125 'name': 'person_name',
129 'name': 'event_when',
131 'dateFormat': 'Y-m-d'
158 'name': 'person_id_id',
162 'name': 'person_id_office_id',
166 'name': 'person_id_name',
170 'name': 'person_id_phone',
174 'name': 'person_id_fax',
178 'name': 'person_id_email',
182 'name': 'person_id_company_id',
186 'name': 'person_id_role',
190 'name': 'person_id_active',
194 'name': 'person_id_remarks',
198 'name': 'person_id_passwd',
202 'name': 'person_id_owner_id',
206 'name': 'person_id_lang',
210 'name': 'person_id_no_reset_sent',
214 'name': 'person_id_action_type',
218 'name': 'person_id_project_id',
222 'name': 'person_id_deleted_by',
226 'name': 'person_id_deleted_dt',
245 render : function (_self)
247 _this.dateTo = _self;
249 change : function (_self, newValue, oldValue)
251 _this.grid.footer.onClick('first');
260 render : function (_self)
262 _this.dateFrom = _self;
264 change : function (_self, newValue, oldValue)
266 _this.grid.footer.onClick('first');
275 xtype: 'ColumnModel',
277 dataIndex : 'person_id_name',
278 header : 'Person name',
281 renderer : function(v,x,r) {
282 return String.format('{0} <<a href="mailto:{1}">{1}</a>>', v, r.data.person_id_email);
286 xtype: 'ColumnModel',
292 renderer : function(v) { return String.format('{0}', v); }
301 activate : function() {
302 _this.tablepanel = this;
303 if (_this.tablegrid) {
304 _this.tablegrid.footer.onClick('first');
312 tableName : 'Events',
320 _this.tablegrid = this;
321 //_this.dialog = Pman.Dialog.FILL_IN
322 if (_this.tablepanel.active) {
323 this.footer.onClick('first');
326 rowdblclick : function (_self, rowIndex, e)
328 if (!_this.dialog) return;
329 _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
330 _this.grid.footer.onClick('first');
334 autoExpandColumn : 'person_name',
340 beforeload : function (_self, o)
342 if (! _this.dategrid) {
346 var s = _this.dategrid.selModel.getSelected();
348 _this.tablegrid.view.el.mask("Select a person");
351 _this.tablegrid.view.el.unmask();
353 o.params = o.params || {};
356 act = _this.dateFrom.getValue();
358 o.params['query[from]'] = act.format('Y-m-d');
360 act = _this.dateTo.getValue();
362 o.params['query[to]'] = act.format('Y-m-d');
364 o.params.person_id = s.data.person_id;
365 o.params['query[table_sum]'] = 1;
366 o.params._columns = 'on_table,qty,uqty';
372 sortInfo : { field : 'on_table', direction: 'ASC' },
377 url : baseURL + '/Roo/Events.php'
382 totalProperty : 'total',
391 'name': 'person_name',
395 'name': 'event_when',
397 'dateFormat': 'Y-m-d'
424 'name': 'person_id_id',
428 'name': 'person_id_office_id',
432 'name': 'person_id_name',
436 'name': 'person_id_phone',
440 'name': 'person_id_fax',
444 'name': 'person_id_email',
448 'name': 'person_id_company_id',
452 'name': 'person_id_role',
456 'name': 'person_id_active',
460 'name': 'person_id_remarks',
464 'name': 'person_id_passwd',
468 'name': 'person_id_owner_id',
472 'name': 'person_id_lang',
476 'name': 'person_id_no_reset_sent',
480 'name': 'person_id_action_type',
484 'name': 'person_id_project_id',
488 'name': 'person_id_deleted_by',
492 'name': 'person_id_deleted_dt',
499 xtype: 'PagingToolbar',
503 displayMsg : "Displaying Events{0} - {1} of {2}",
504 emptyMsg : "No Events found"
514 select : function (combo, record, index)
516 _this.grid.footer.onClick('first');
518 render : function (_self)
520 _this.actionSel = _self;
524 displayField : 'action',
526 emptyText : "Select Action",
527 forceSelection : true,
529 loadingText : "Searching...",
533 qtip : "Select Action",
534 queryParam : 'query[action]',
535 selectOnFocus : true,
536 tpl : '<div class="x-grid-cell-text x-btn button"><b>{action}</b> </div>',
537 triggerAction : 'all',
539 valueField : 'action',
545 beforeload : function (_self, o)
547 o.params = o.params || {};
548 // staff can see all logs, other companies can only see their own.
549 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
550 o.params.company_id = Pman.Login.authUser.company_id;
552 o.params._distinct = 'action';
553 o.params._columns ='action';
557 sortInfo : { field : 'action' , direction : 'ASC' },
562 url : baseURL + '/Roo/Events.php'
567 totalProperty : 'total',
576 'name': 'person_name',
580 'name': 'event_when',
582 'dateFormat': 'Y-m-d'
609 'name': 'person_id_id',
613 'name': 'person_id_office_id',
617 'name': 'person_id_name',
621 'name': 'person_id_phone',
625 'name': 'person_id_fax',
629 'name': 'person_id_email',
633 'name': 'person_id_company_id',
637 'name': 'person_id_role',
641 'name': 'person_id_active',
645 'name': 'person_id_remarks',
649 'name': 'person_id_passwd',
653 'name': 'person_id_owner_id',
657 'name': 'person_id_lang',
661 'name': 'person_id_no_reset_sent',
665 'name': 'person_id_action_type',
669 'name': 'person_id_project_id',
673 'name': 'person_id_deleted_by',
677 'name': 'person_id_deleted_dt',
688 select : function (combo, record, index)
690 _this.grid.footer.onClick('first');
692 render : function (_self)
694 _this.affectSel = _self;
698 displayField : 'on_table',
700 emptyText : "Select Affects",
701 forceSelection : true,
703 loadingText : "Searching...",
707 qtip : "Select Action",
708 queryParam : 'query[on_table]',
709 selectOnFocus : true,
710 tpl : '<div class="x-grid-cell-text x-btn button"><b>{on_table}</b> </div>',
711 triggerAction : 'all',
713 valueField : 'action',
719 beforeload : function (_self, o)
721 o.params = o.params || {};
722 // staff can see all logs, other companies can only see their own.
723 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
724 o.params.company_id = Pman.Login.authUser.company_id;
726 o.params._distinct = 'on_table';
727 o.params._columns ='on_table';
731 sortInfo : { field : 'on_table' , direction : 'ASC' },
736 url : baseURL + '/Roo/Events.php'
741 totalProperty : 'total',
750 'name': 'person_name',
754 'name': 'event_when',
756 'dateFormat': 'Y-m-d'
783 'name': 'person_id_id',
787 'name': 'person_id_office_id',
791 'name': 'person_id_name',
795 'name': 'person_id_phone',
799 'name': 'person_id_fax',
803 'name': 'person_id_email',
807 'name': 'person_id_company_id',
811 'name': 'person_id_role',
815 'name': 'person_id_active',
819 'name': 'person_id_remarks',
823 'name': 'person_id_passwd',
827 'name': 'person_id_owner_id',
831 'name': 'person_id_lang',
835 'name': 'person_id_no_reset_sent',
839 'name': 'person_id_action_type',
843 'name': 'person_id_project_id',
847 'name': 'person_id_deleted_by',
851 'name': 'person_id_deleted_dt',
862 xtype: 'ColumnModel',
864 dataIndex : 'on_table',
868 renderer : function(v) { return String.format('{0}', v); }
871 xtype: 'ColumnModel',
874 header : '#Affected',
877 renderer : function(v) { return String.format('{0}', v); }
880 xtype: 'ColumnModel',
886 renderer : function(v) { return String.format('{0}', v); }
895 activate : function() {
896 _this.evpanel = this;
898 _this.evgrid.footer.onClick('first');
906 tableName : 'Events',
915 //_this.dialog = Pman.Dialog.FILL_IN
916 if (_this.evpanel.active) {
917 this.footer.onClick('first');
920 rowdblclick : function (_self, rowIndex, e)
922 if (!_this.dialog) return;
923 _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
924 _this.grid.footer.onClick('first');
928 autoExpandColumn : 'person_name',
934 sortInfo : { field : 'person_name', direction: 'ASC' },
939 url : baseURL + '/Roo/Events.php'
944 totalProperty : 'total',
953 'name': 'person_name',
957 'name': 'event_when',
959 'dateFormat': 'Y-m-d'
986 'name': 'person_id_id',
990 'name': 'person_id_office_id',
994 'name': 'person_id_name',
998 'name': 'person_id_phone',
1002 'name': 'person_id_fax',
1006 'name': 'person_id_email',
1010 'name': 'person_id_company_id',
1014 'name': 'person_id_role',
1018 'name': 'person_id_active',
1022 'name': 'person_id_remarks',
1026 'name': 'person_id_passwd',
1030 'name': 'person_id_owner_id',
1034 'name': 'person_id_lang',
1038 'name': 'person_id_no_reset_sent',
1042 'name': 'person_id_action_type',
1046 'name': 'person_id_project_id',
1050 'name': 'person_id_deleted_by',
1054 'name': 'person_id_deleted_dt',
1061 xtype: 'PagingToolbar',
1065 displayMsg : "Displaying Events{0} - {1} of {2}",
1066 emptyMsg : "No Events found"
1081 xtype: 'ColumnModel',
1083 dataIndex : 'table_action',
1086 renderer : function(v) { return String.format('{0}', v); }
1089 xtype: 'ColumnModel',
1094 renderer : function(v) { return String.format('{0}', v); }
1101 xtype: 'LayoutRegion',
1107 xtype: 'LayoutRegion',
1111 xtype: 'LayoutRegion',
1118 this.layout = this.panel.layout;