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.detailpanel = this;
897 if (_this.detailgrid) {
898 _this.detailgrid.footer.onClick('first');
906 tableName : 'Events',
914 _this.detailgrid = this;
915 //_this.dialog = Pman.Dialog.FILL_IN
916 if (_this.detailpanel.active) {
917 this.footer.onClick('first');
921 autoExpandColumn : 'person_name',
927 beforeload : function (_self, o)
929 if (! _this.dategrid) {
933 o.params = o.params || {};
935 var s = _this.dategrid.selModel.getSelected();
937 _this.detailgrid.view.el.mask("Select a person");
941 o.params.person_id = s.data.person_id;
943 var s = _this.tablegrid.selModel.getSelected();
945 _this.detailgrid.view.el.mask("Select a table");
948 o.params.person_id = s.data.on_table;
950 _this.detailgrid.view.el.unmask();
955 act = _this.dateFrom.getValue();
957 o.params['query[from]'] = act.format('Y-m-d');
959 act = _this.dateTo.getValue();
961 o.params['query[to]'] = act.format('Y-m-d');
964 //o.params['query[table_d]'] = 1;
965 //o.params._columns = 'on_table,qty,uqty';
971 sortInfo : { field : 'person_name', direction: 'ASC' },
976 url : baseURL + '/Roo/Events.php'
981 totalProperty : 'total',
990 'name': 'person_name',
994 'name': 'event_when',
996 'dateFormat': 'Y-m-d'
1015 'name': 'person_id',
1023 'name': 'person_id_id',
1027 'name': 'person_id_office_id',
1031 'name': 'person_id_name',
1035 'name': 'person_id_phone',
1039 'name': 'person_id_fax',
1043 'name': 'person_id_email',
1047 'name': 'person_id_company_id',
1051 'name': 'person_id_role',
1055 'name': 'person_id_active',
1059 'name': 'person_id_remarks',
1063 'name': 'person_id_passwd',
1067 'name': 'person_id_owner_id',
1071 'name': 'person_id_lang',
1075 'name': 'person_id_no_reset_sent',
1079 'name': 'person_id_action_type',
1083 'name': 'person_id_project_id',
1087 'name': 'person_id_deleted_by',
1091 'name': 'person_id_deleted_dt',
1098 xtype: 'PagingToolbar',
1102 displayMsg : "Displaying Events{0} - {1} of {2}",
1103 emptyMsg : "No Events found"
1113 cls : 'x-btn-text-icon',
1114 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
1118 if (!_this.dialog) return;
1119 _this.dialog.show( { id : 0 } , function() {
1120 _this.grid.footer.onClick('first');
1129 cls : 'x-btn-text-icon',
1130 icon : Roo.rootURL + 'images/default/tree/leaf.gif',
1134 var s = _this.grid.getSelectionModel().getSelections();
1135 if (!s.length || (s.length > 1)) {
1136 Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
1139 if (!_this.dialog) return;
1140 _this.dialog.show(s[0].data, function() {
1141 _this.grid.footer.onClick('first');
1151 cls : 'x-btn-text-icon',
1152 icon : rootURL + '/Pman/templates/images/trash.gif',
1156 Pman.genericDelete(_this, 'Events');
1164 xtype: 'ColumnModel',
1169 renderer : function(v) { return String.format('{0}', v); }
1172 xtype: 'ColumnModel',
1174 header : 'Event when',
1176 dataIndex : 'event_when',
1177 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }
1180 xtype: 'ColumnModel',
1182 dataIndex : 'action',
1185 renderer : function(v) { return String.format('{0}', v); }
1188 xtype: 'ColumnModel',
1190 dataIndex : 'ipaddr',
1193 renderer : function(v) { return String.format('{0}', v); }
1196 xtype: 'ColumnModel',
1200 dataIndex : 'on_id',
1201 renderer : function(v) { return String.format('{0}', v); }
1204 xtype: 'ColumnModel',
1208 dataIndex : 'remarks',
1209 renderer : function(v) { return String.format('{0}', v); }
1216 xtype: 'LayoutRegion',
1222 xtype: 'LayoutRegion',
1226 xtype: 'LayoutRegion',
1233 this.layout = this.panel.layout;