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');
327 autoExpandColumn : 'person_name',
333 beforeload : function (_self, o)
335 if (! _this.dategrid) {
339 var s = _this.dategrid.selModel.getSelected();
341 _this.tablegrid.view.el.mask("Select a person");
344 _this.tablegrid.view.el.unmask();
346 o.params = o.params || {};
349 act = _this.dateFrom.getValue();
351 o.params['query[from]'] = act.format('Y-m-d');
353 act = _this.dateTo.getValue();
355 o.params['query[to]'] = act.format('Y-m-d');
357 o.params.person_id = s.data.person_id;
358 o.params['query[table_sum]'] = 1;
359 o.params._columns = 'on_table,qty,uqty';
365 sortInfo : { field : 'on_table', direction: 'ASC' },
370 url : baseURL + '/Roo/Events.php'
375 totalProperty : 'total',
384 'name': 'person_name',
388 'name': 'event_when',
390 'dateFormat': 'Y-m-d'
417 'name': 'person_id_id',
421 'name': 'person_id_office_id',
425 'name': 'person_id_name',
429 'name': 'person_id_phone',
433 'name': 'person_id_fax',
437 'name': 'person_id_email',
441 'name': 'person_id_company_id',
445 'name': 'person_id_role',
449 'name': 'person_id_active',
453 'name': 'person_id_remarks',
457 'name': 'person_id_passwd',
461 'name': 'person_id_owner_id',
465 'name': 'person_id_lang',
469 'name': 'person_id_no_reset_sent',
473 'name': 'person_id_action_type',
477 'name': 'person_id_project_id',
481 'name': 'person_id_deleted_by',
485 'name': 'person_id_deleted_dt',
492 xtype: 'PagingToolbar',
496 displayMsg : "Displaying Events{0} - {1} of {2}",
497 emptyMsg : "No Events found"
507 select : function (combo, record, index)
509 _this.grid.footer.onClick('first');
511 render : function (_self)
513 _this.actionSel = _self;
517 displayField : 'action',
519 emptyText : "Select Action",
520 forceSelection : true,
522 loadingText : "Searching...",
526 qtip : "Select Action",
527 queryParam : 'query[action]',
528 selectOnFocus : true,
529 tpl : '<div class="x-grid-cell-text x-btn button"><b>{action}</b> </div>',
530 triggerAction : 'all',
532 valueField : 'action',
538 beforeload : function (_self, o)
540 o.params = o.params || {};
541 // staff can see all logs, other companies can only see their own.
542 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
543 o.params.company_id = Pman.Login.authUser.company_id;
545 o.params._distinct = 'action';
546 o.params._columns ='action';
550 sortInfo : { field : 'action' , direction : 'ASC' },
555 url : baseURL + '/Roo/Events.php'
560 totalProperty : 'total',
569 'name': 'person_name',
573 'name': 'event_when',
575 'dateFormat': 'Y-m-d'
602 'name': 'person_id_id',
606 'name': 'person_id_office_id',
610 'name': 'person_id_name',
614 'name': 'person_id_phone',
618 'name': 'person_id_fax',
622 'name': 'person_id_email',
626 'name': 'person_id_company_id',
630 'name': 'person_id_role',
634 'name': 'person_id_active',
638 'name': 'person_id_remarks',
642 'name': 'person_id_passwd',
646 'name': 'person_id_owner_id',
650 'name': 'person_id_lang',
654 'name': 'person_id_no_reset_sent',
658 'name': 'person_id_action_type',
662 'name': 'person_id_project_id',
666 'name': 'person_id_deleted_by',
670 'name': 'person_id_deleted_dt',
681 select : function (combo, record, index)
683 _this.grid.footer.onClick('first');
685 render : function (_self)
687 _this.affectSel = _self;
691 displayField : 'on_table',
693 emptyText : "Select Affects",
694 forceSelection : true,
696 loadingText : "Searching...",
700 qtip : "Select Action",
701 queryParam : 'query[on_table]',
702 selectOnFocus : true,
703 tpl : '<div class="x-grid-cell-text x-btn button"><b>{on_table}</b> </div>',
704 triggerAction : 'all',
706 valueField : 'action',
712 beforeload : function (_self, o)
714 o.params = o.params || {};
715 // staff can see all logs, other companies can only see their own.
716 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
717 o.params.company_id = Pman.Login.authUser.company_id;
719 o.params._distinct = 'on_table';
720 o.params._columns ='on_table';
724 sortInfo : { field : 'on_table' , direction : 'ASC' },
729 url : baseURL + '/Roo/Events.php'
734 totalProperty : 'total',
743 'name': 'person_name',
747 'name': 'event_when',
749 'dateFormat': 'Y-m-d'
776 'name': 'person_id_id',
780 'name': 'person_id_office_id',
784 'name': 'person_id_name',
788 'name': 'person_id_phone',
792 'name': 'person_id_fax',
796 'name': 'person_id_email',
800 'name': 'person_id_company_id',
804 'name': 'person_id_role',
808 'name': 'person_id_active',
812 'name': 'person_id_remarks',
816 'name': 'person_id_passwd',
820 'name': 'person_id_owner_id',
824 'name': 'person_id_lang',
828 'name': 'person_id_no_reset_sent',
832 'name': 'person_id_action_type',
836 'name': 'person_id_project_id',
840 'name': 'person_id_deleted_by',
844 'name': 'person_id_deleted_dt',
855 xtype: 'ColumnModel',
857 dataIndex : 'on_table',
861 renderer : function(v) { return String.format('{0}', v); }
864 xtype: 'ColumnModel',
867 header : '#Affected',
870 renderer : function(v) { return String.format('{0}', v); }
873 xtype: 'ColumnModel',
879 renderer : function(v) { return String.format('{0}', v); }
888 activate : function() {
889 _this.detailpanel = this;
890 if (_this.detailgrid) {
891 _this.detailgrid.footer.onClick('first');
899 tableName : 'Events',
907 _this.detailgrid = this;
908 //_this.dialog = Pman.Dialog.FILL_IN
909 if (_this.detailpanel.active) {
910 this.footer.onClick('first');
914 autoExpandColumn : 'person_name',
920 beforeload : function (_self, o)
922 if (! _this.dategrid) {
926 o.params = o.params || {};
928 var s = _this.dategrid.selModel.getSelected();
930 _this.detailgrid.view.el.mask("Select a person");
934 o.params.person_id = s.data.person_id;
936 var s = _this.tablegrid.selModel.getSelected();
938 _this.detailgrid.view.el.mask("Select a table");
941 o.params.person_id = s.data.on_table;
943 _this.detailgrid.view.el.unmask();
948 act = _this.dateFrom.getValue();
950 o.params['query[from]'] = act.format('Y-m-d');
952 act = _this.dateTo.getValue();
954 o.params['query[to]'] = act.format('Y-m-d');
957 //o.params['query[table_d]'] = 1;
958 //o.params._columns = 'on_table,qty,uqty';
964 sortInfo : { field : 'person_name', direction: 'ASC' },
969 url : baseURL + '/Roo/Events.php'
974 totalProperty : 'total',
983 'name': 'person_name',
987 'name': 'event_when',
989 'dateFormat': 'Y-m-d'
1008 'name': 'person_id',
1016 'name': 'person_id_id',
1020 'name': 'person_id_office_id',
1024 'name': 'person_id_name',
1028 'name': 'person_id_phone',
1032 'name': 'person_id_fax',
1036 'name': 'person_id_email',
1040 'name': 'person_id_company_id',
1044 'name': 'person_id_role',
1048 'name': 'person_id_active',
1052 'name': 'person_id_remarks',
1056 'name': 'person_id_passwd',
1060 'name': 'person_id_owner_id',
1064 'name': 'person_id_lang',
1068 'name': 'person_id_no_reset_sent',
1072 'name': 'person_id_action_type',
1076 'name': 'person_id_project_id',
1080 'name': 'person_id_deleted_by',
1084 'name': 'person_id_deleted_dt',
1091 xtype: 'PagingToolbar',
1095 displayMsg : "Displaying Events{0} - {1} of {2}",
1096 emptyMsg : "No Events found"
1106 cls : 'x-btn-text-icon',
1107 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
1111 if (!_this.dialog) return;
1112 _this.dialog.show( { id : 0 } , function() {
1113 _this.grid.footer.onClick('first');
1122 cls : 'x-btn-text-icon',
1123 icon : Roo.rootURL + 'images/default/tree/leaf.gif',
1127 var s = _this.grid.getSelectionModel().getSelections();
1128 if (!s.length || (s.length > 1)) {
1129 Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
1132 if (!_this.dialog) return;
1133 _this.dialog.show(s[0].data, function() {
1134 _this.grid.footer.onClick('first');
1144 cls : 'x-btn-text-icon',
1145 icon : rootURL + '/Pman/templates/images/trash.gif',
1149 Pman.genericDelete(_this, 'Events');
1157 xtype: 'ColumnModel',
1162 renderer : function(v) { return String.format('{0}', v); }
1165 xtype: 'ColumnModel',
1167 header : 'Event when',
1169 dataIndex : 'event_when',
1170 renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }
1173 xtype: 'ColumnModel',
1175 dataIndex : 'action',
1178 renderer : function(v) { return String.format('{0}', v); }
1181 xtype: 'ColumnModel',
1183 dataIndex : 'ipaddr',
1186 renderer : function(v) { return String.format('{0}', v); }
1189 xtype: 'ColumnModel',
1191 dataIndex : 'on_id',
1194 renderer : function(v) { return String.format('{0}', v); }
1197 xtype: 'ColumnModel',
1201 dataIndex : 'remarks',
1202 renderer : function(v) { return String.format('{0}', v); }
1209 xtype: 'LayoutRegion',
1215 xtype: 'LayoutRegion',
1219 xtype: 'LayoutRegion',
1226 this.layout = this.panel.layout;