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 rowclick : function (_self, rowIndex, e)
328 _this.detailgrid.footer.onClick('first');
331 autoExpandColumn : 'person_name',
337 beforeload : function (_self, o)
339 if (! _this.dategrid) {
343 var s = _this.dategrid.selModel.getSelected();
345 _this.tablegrid.view.el.mask("Select a person");
348 _this.tablegrid.view.el.unmask();
350 o.params = o.params || {};
353 act = _this.dateFrom.getValue();
355 o.params['query[from]'] = act.format('Y-m-d');
357 act = _this.dateTo.getValue();
359 o.params['query[to]'] = act.format('Y-m-d');
361 o.params.person_id = s.data.person_id;
362 o.params['query[table_sum]'] = 1;
363 o.params._columns = 'on_table,qty,uqty';
369 sortInfo : { field : 'on_table', direction: 'ASC' },
374 url : baseURL + '/Roo/Events.php'
379 totalProperty : 'total',
388 'name': 'person_name',
392 'name': 'event_when',
394 'dateFormat': 'Y-m-d'
421 'name': 'person_id_id',
425 'name': 'person_id_office_id',
429 'name': 'person_id_name',
433 'name': 'person_id_phone',
437 'name': 'person_id_fax',
441 'name': 'person_id_email',
445 'name': 'person_id_company_id',
449 'name': 'person_id_role',
453 'name': 'person_id_active',
457 'name': 'person_id_remarks',
461 'name': 'person_id_passwd',
465 'name': 'person_id_owner_id',
469 'name': 'person_id_lang',
473 'name': 'person_id_no_reset_sent',
477 'name': 'person_id_action_type',
481 'name': 'person_id_project_id',
485 'name': 'person_id_deleted_by',
489 'name': 'person_id_deleted_dt',
496 xtype: 'PagingToolbar',
500 displayMsg : "Displaying Events{0} - {1} of {2}",
501 emptyMsg : "No Events found"
511 select : function (combo, record, index)
513 _this.grid.footer.onClick('first');
515 render : function (_self)
517 _this.actionSel = _self;
521 displayField : 'action',
523 emptyText : "Select Action",
524 forceSelection : true,
526 loadingText : "Searching...",
530 qtip : "Select Action",
531 queryParam : 'query[action]',
532 selectOnFocus : true,
533 tpl : '<div class="x-grid-cell-text x-btn button"><b>{action}</b> </div>',
534 triggerAction : 'all',
536 valueField : 'action',
542 beforeload : function (_self, o)
544 o.params = o.params || {};
545 // staff can see all logs, other companies can only see their own.
546 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
547 o.params.company_id = Pman.Login.authUser.company_id;
549 o.params._distinct = 'action';
550 o.params._columns ='action';
554 sortInfo : { field : 'action' , direction : 'ASC' },
559 url : baseURL + '/Roo/Events.php'
564 totalProperty : 'total',
573 'name': 'person_name',
577 'name': 'event_when',
579 'dateFormat': 'Y-m-d'
606 'name': 'person_id_id',
610 'name': 'person_id_office_id',
614 'name': 'person_id_name',
618 'name': 'person_id_phone',
622 'name': 'person_id_fax',
626 'name': 'person_id_email',
630 'name': 'person_id_company_id',
634 'name': 'person_id_role',
638 'name': 'person_id_active',
642 'name': 'person_id_remarks',
646 'name': 'person_id_passwd',
650 'name': 'person_id_owner_id',
654 'name': 'person_id_lang',
658 'name': 'person_id_no_reset_sent',
662 'name': 'person_id_action_type',
666 'name': 'person_id_project_id',
670 'name': 'person_id_deleted_by',
674 'name': 'person_id_deleted_dt',
685 select : function (combo, record, index)
687 _this.grid.footer.onClick('first');
689 render : function (_self)
691 _this.affectSel = _self;
695 displayField : 'on_table',
697 emptyText : "Select Affects",
698 forceSelection : true,
700 loadingText : "Searching...",
704 qtip : "Select Action",
705 queryParam : 'query[on_table]',
706 selectOnFocus : true,
707 tpl : '<div class="x-grid-cell-text x-btn button"><b>{on_table}</b> </div>',
708 triggerAction : 'all',
710 valueField : 'action',
716 beforeload : function (_self, o)
718 o.params = o.params || {};
719 // staff can see all logs, other companies can only see their own.
720 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
721 o.params.company_id = Pman.Login.authUser.company_id;
723 o.params._distinct = 'on_table';
724 o.params._columns ='on_table';
728 sortInfo : { field : 'on_table' , direction : 'ASC' },
733 url : baseURL + '/Roo/Events.php'
738 totalProperty : 'total',
747 'name': 'person_name',
751 'name': 'event_when',
753 'dateFormat': 'Y-m-d'
780 'name': 'person_id_id',
784 'name': 'person_id_office_id',
788 'name': 'person_id_name',
792 'name': 'person_id_phone',
796 'name': 'person_id_fax',
800 'name': 'person_id_email',
804 'name': 'person_id_company_id',
808 'name': 'person_id_role',
812 'name': 'person_id_active',
816 'name': 'person_id_remarks',
820 'name': 'person_id_passwd',
824 'name': 'person_id_owner_id',
828 'name': 'person_id_lang',
832 'name': 'person_id_no_reset_sent',
836 'name': 'person_id_action_type',
840 'name': 'person_id_project_id',
844 'name': 'person_id_deleted_by',
848 'name': 'person_id_deleted_dt',
859 xtype: 'ColumnModel',
861 dataIndex : 'on_table',
865 renderer : function(v) { return String.format('{0}', v); }
868 xtype: 'ColumnModel',
871 header : '#Affected',
874 renderer : function(v) { return String.format('{0}', v); }
877 xtype: 'ColumnModel',
883 renderer : function(v) { return String.format('{0}', v); }
892 activate : function() {
893 _this.detailpanel = this;
894 if (_this.detailgrid) {
895 _this.detailgrid.footer.onClick('first');
903 tableName : 'Events',
911 _this.detailgrid = this;
912 //_this.dialog = Pman.Dialog.FILL_IN
913 if (_this.detailpanel.active) {
914 this.footer.onClick('first');
918 autoExpandColumn : 'person_name',
924 beforeload : function (_self, o)
926 if (! _this.dategrid) {
930 o.params = o.params || {};
932 var s = _this.dategrid.selModel.getSelected();
934 _this.detailgrid.view.el.mask("Select a person");
938 o.params.person_id = s.data.person_id;
940 var s = _this.tablegrid.selModel.getSelected();
942 _this.detailgrid.view.el.mask("Select a table");
945 o.params.on_table = s.data.on_table;
947 _this.detailgrid.view.el.unmask();
952 act = _this.dateFrom.getValue();
954 o.params['query[from]'] = act.format('Y-m-d');
956 act = _this.dateTo.getValue();
958 o.params['query[to]'] = act.format('Y-m-d');
961 //o.params['query[table_d]'] = 1;
962 //o.params._columns = 'on_table,qty,uqty';
968 sortInfo : { field : 'person_name', direction: 'ASC' },
973 url : baseURL + '/Roo/Events.php'
978 totalProperty : 'total',
987 'name': 'person_name',
991 'name': 'event_when',
993 'dateFormat': 'Y-m-d'
1012 'name': 'person_id',
1020 'name': 'person_id_id',
1024 'name': 'person_id_office_id',
1028 'name': 'person_id_name',
1032 'name': 'person_id_phone',
1036 'name': 'person_id_fax',
1040 'name': 'person_id_email',
1044 'name': 'person_id_company_id',
1048 'name': 'person_id_role',
1052 'name': 'person_id_active',
1056 'name': 'person_id_remarks',
1060 'name': 'person_id_passwd',
1064 'name': 'person_id_owner_id',
1068 'name': 'person_id_lang',
1072 'name': 'person_id_no_reset_sent',
1076 'name': 'person_id_action_type',
1080 'name': 'person_id_project_id',
1084 'name': 'person_id_deleted_by',
1088 'name': 'person_id_deleted_dt',
1095 xtype: 'PagingToolbar',
1099 displayMsg : "Displaying Events{0} - {1} of {2}",
1100 emptyMsg : "No Events found"
1110 cls : 'x-btn-text-icon',
1111 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
1115 if (!_this.dialog) return;
1116 _this.dialog.show( { id : 0 } , function() {
1117 _this.grid.footer.onClick('first');
1126 cls : 'x-btn-text-icon',
1127 icon : Roo.rootURL + 'images/default/tree/leaf.gif',
1131 var s = _this.grid.getSelectionModel().getSelections();
1132 if (!s.length || (s.length > 1)) {
1133 Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
1136 if (!_this.dialog) return;
1137 _this.dialog.show(s[0].data, function() {
1138 _this.grid.footer.onClick('first');
1148 cls : 'x-btn-text-icon',
1149 icon : rootURL + '/Pman/templates/images/trash.gif',
1153 Pman.genericDelete(_this, 'Events');
1161 xtype: 'ColumnModel',
1166 renderer : function(v) { return String.format('{0}', v); }
1169 xtype: 'ColumnModel',
1171 header : 'Event when',
1173 dataIndex : 'event_when',
1174 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }
1177 xtype: 'ColumnModel',
1179 dataIndex : 'action',
1182 renderer : function(v) { return String.format('{0}', v); }
1185 xtype: 'ColumnModel',
1187 dataIndex : 'ipaddr',
1190 renderer : function(v) { return String.format('{0}', v); }
1193 xtype: 'ColumnModel',
1195 dataIndex : 'on_id',
1198 renderer : function(v) { return String.format('{0}', v); }
1201 xtype: 'ColumnModel',
1205 dataIndex : 'remarks',
1206 renderer : function(v) { return String.format('{0}', v); }
1213 xtype: 'LayoutRegion',
1219 xtype: 'LayoutRegion',
1223 xtype: 'LayoutRegion',
1230 this.layout = this.panel.layout;