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, o)
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,person_id_email,qty';
102 sortInfo : { field : 'person_name', direction: 'ASC' },
107 url : baseURL + '/Roo/Events.php'
112 totalProperty : 'total',
121 'name': 'person_name',
125 'name': 'event_when',
127 'dateFormat': 'Y-m-d'
154 'name': 'person_id_id',
158 'name': 'person_id_office_id',
162 'name': 'person_id_name',
166 'name': 'person_id_phone',
170 'name': 'person_id_fax',
174 'name': 'person_id_email',
178 'name': 'person_id_company_id',
182 'name': 'person_id_role',
186 'name': 'person_id_active',
190 'name': 'person_id_remarks',
194 'name': 'person_id_passwd',
198 'name': 'person_id_owner_id',
202 'name': 'person_id_lang',
206 'name': 'person_id_no_reset_sent',
210 'name': 'person_id_action_type',
214 'name': 'person_id_project_id',
218 'name': 'person_id_deleted_by',
222 'name': 'person_id_deleted_dt',
241 render : function (_self)
243 _this.dateTo = _self;
245 change : function (_self, newValue, oldValue)
247 _this.grid.footer.onClick('first');
256 render : function (_self)
258 _this.dateFrom = _self;
260 change : function (_self, newValue, oldValue)
262 _this.grid.footer.onClick('first');
271 xtype: 'ColumnModel',
273 dataIndex : 'person_id_name',
274 header : 'Person name',
277 renderer : function(v,x,r) {
278 return String.format('{0} <<a href="mailto:{1}">{1}</a>>', v, r.data.person_id_email);
282 xtype: 'ColumnModel',
288 renderer : function(v) { return String.format('{0}', v); }
297 activate : function() {
298 _this.tablepanel = this;
299 if (_this.tablegrid) {
300 _this.tablegrid.footer.onClick('first');
308 tableName : 'Events',
316 _this.tablegrid = this;
317 //_this.dialog = Pman.Dialog.FILL_IN
318 if (_this.tablepanel.active) {
319 this.footer.onClick('first');
322 rowdblclick : function (_self, rowIndex, e)
324 if (!_this.dialog) return;
325 _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
326 _this.grid.footer.onClick('first');
330 autoExpandColumn : 'person_name',
336 sortInfo : { field : 'person_name', direction: 'ASC' },
341 url : baseURL + '/Roo/Events.php'
346 totalProperty : 'total',
355 'name': 'person_name',
359 'name': 'event_when',
361 'dateFormat': 'Y-m-d'
388 'name': 'person_id_id',
392 'name': 'person_id_office_id',
396 'name': 'person_id_name',
400 'name': 'person_id_phone',
404 'name': 'person_id_fax',
408 'name': 'person_id_email',
412 'name': 'person_id_company_id',
416 'name': 'person_id_role',
420 'name': 'person_id_active',
424 'name': 'person_id_remarks',
428 'name': 'person_id_passwd',
432 'name': 'person_id_owner_id',
436 'name': 'person_id_lang',
440 'name': 'person_id_no_reset_sent',
444 'name': 'person_id_action_type',
448 'name': 'person_id_project_id',
452 'name': 'person_id_deleted_by',
456 'name': 'person_id_deleted_dt',
463 xtype: 'PagingToolbar',
467 displayMsg : "Displaying Events{0} - {1} of {2}",
468 emptyMsg : "No Events found"
478 select : function (combo, record, index)
480 _this.grid.footer.onClick('first');
482 render : function (_self)
484 _this.actionSel = _self;
488 displayField : 'action',
490 emptyText : "Select Action",
491 forceSelection : true,
493 loadingText : "Searching...",
497 qtip : "Select Action",
498 queryParam : 'query[action]',
499 selectOnFocus : true,
500 tpl : '<div class="x-grid-cell-text x-btn button"><b>{action}</b> </div>',
501 triggerAction : 'all',
503 valueField : 'action',
509 beforeload : function (_self, o)
511 o.params = o.params || {};
512 // staff can see all logs, other companies can only see their own.
513 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
514 o.params.company_id = Pman.Login.authUser.company_id;
516 o.params._distinct = 'action';
517 o.params._columns ='action';
521 sortInfo : { field : 'action' , direction : 'ASC' },
526 url : baseURL + '/Roo/Events.php'
531 totalProperty : 'total',
540 'name': 'person_name',
544 'name': 'event_when',
546 'dateFormat': 'Y-m-d'
573 'name': 'person_id_id',
577 'name': 'person_id_office_id',
581 'name': 'person_id_name',
585 'name': 'person_id_phone',
589 'name': 'person_id_fax',
593 'name': 'person_id_email',
597 'name': 'person_id_company_id',
601 'name': 'person_id_role',
605 'name': 'person_id_active',
609 'name': 'person_id_remarks',
613 'name': 'person_id_passwd',
617 'name': 'person_id_owner_id',
621 'name': 'person_id_lang',
625 'name': 'person_id_no_reset_sent',
629 'name': 'person_id_action_type',
633 'name': 'person_id_project_id',
637 'name': 'person_id_deleted_by',
641 'name': 'person_id_deleted_dt',
652 select : function (combo, record, index)
654 _this.grid.footer.onClick('first');
656 render : function (_self)
658 _this.affectSel = _self;
662 displayField : 'on_table',
664 emptyText : "Select Affects",
665 forceSelection : true,
667 loadingText : "Searching...",
671 qtip : "Select Action",
672 queryParam : 'query[on_table]',
673 selectOnFocus : true,
674 tpl : '<div class="x-grid-cell-text x-btn button"><b>{on_table}</b> </div>',
675 triggerAction : 'all',
677 valueField : 'action',
683 beforeload : function (_self, o)
685 o.params = o.params || {};
686 // staff can see all logs, other companies can only see their own.
687 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
688 o.params.company_id = Pman.Login.authUser.company_id;
690 o.params._distinct = 'on_table';
691 o.params._columns ='on_table';
695 sortInfo : { field : 'on_table' , direction : 'ASC' },
700 url : baseURL + '/Roo/Events.php'
705 totalProperty : 'total',
714 'name': 'person_name',
718 'name': 'event_when',
720 'dateFormat': 'Y-m-d'
747 'name': 'person_id_id',
751 'name': 'person_id_office_id',
755 'name': 'person_id_name',
759 'name': 'person_id_phone',
763 'name': 'person_id_fax',
767 'name': 'person_id_email',
771 'name': 'person_id_company_id',
775 'name': 'person_id_role',
779 'name': 'person_id_active',
783 'name': 'person_id_remarks',
787 'name': 'person_id_passwd',
791 'name': 'person_id_owner_id',
795 'name': 'person_id_lang',
799 'name': 'person_id_no_reset_sent',
803 'name': 'person_id_action_type',
807 'name': 'person_id_project_id',
811 'name': 'person_id_deleted_by',
815 'name': 'person_id_deleted_dt',
826 xtype: 'ColumnModel',
828 dataIndex : 'table_action',
831 renderer : function(v) { return String.format('{0}', v); }
834 xtype: 'ColumnModel',
839 renderer : function(v) { return String.format('{0}', v); }
848 activate : function() {
849 _this.evpanel = this;
851 _this.evgrid.footer.onClick('first');
859 tableName : 'Events',
868 //_this.dialog = Pman.Dialog.FILL_IN
869 if (_this.evpanel.active) {
870 this.footer.onClick('first');
873 rowdblclick : function (_self, rowIndex, e)
875 if (!_this.dialog) return;
876 _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
877 _this.grid.footer.onClick('first');
881 autoExpandColumn : 'person_name',
887 sortInfo : { field : 'person_name', direction: 'ASC' },
892 url : baseURL + '/Roo/Events.php'
897 totalProperty : 'total',
906 'name': 'person_name',
910 'name': 'event_when',
912 'dateFormat': 'Y-m-d'
939 'name': 'person_id_id',
943 'name': 'person_id_office_id',
947 'name': 'person_id_name',
951 'name': 'person_id_phone',
955 'name': 'person_id_fax',
959 'name': 'person_id_email',
963 'name': 'person_id_company_id',
967 'name': 'person_id_role',
971 'name': 'person_id_active',
975 'name': 'person_id_remarks',
979 'name': 'person_id_passwd',
983 'name': 'person_id_owner_id',
987 'name': 'person_id_lang',
991 'name': 'person_id_no_reset_sent',
995 'name': 'person_id_action_type',
999 'name': 'person_id_project_id',
1003 'name': 'person_id_deleted_by',
1007 'name': 'person_id_deleted_dt',
1014 xtype: 'PagingToolbar',
1018 displayMsg : "Displaying Events{0} - {1} of {2}",
1019 emptyMsg : "No Events found"
1034 xtype: 'ColumnModel',
1036 dataIndex : 'table_action',
1039 renderer : function(v) { return String.format('{0}', v); }
1042 xtype: 'ColumnModel',
1047 renderer : function(v) { return String.format('{0}', v); }
1054 xtype: 'LayoutRegion',
1060 xtype: 'LayoutRegion',
1064 xtype: 'LayoutRegion',
1071 this.layout = this.panel.layout;