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","LogEvents"],
12 modKey : '001-Pman.Tab.AdminLogEvents',
13 module : Pman.Tab.AdminLogEvents,
15 parent : Pman.Tab.AdminLogs,
16 name : "Admin - Logs - Events",
18 permname: 'Admin.Logs'
22 Pman.Tab.AdminLogEvents = new Roo.util.Observable({
28 add : function(parentLayout, region)
32 this.parentLayout = parentLayout;
34 this.panel = parentLayout.addxtype({
35 xtype: 'NestedLayoutPanel',
40 xtype: 'BorderLayout',
47 activate : function() {
50 _this.grid.footer.onClick('first');
63 autoExpandColumn : 'remarks',
68 //_this.dialog = Pman.Dialog.FILL_IN
69 if (_this.panel.active) {
70 this.footer.onClick('first');
78 beforeload : function (_self, o)
80 if (! _this.personSel) {
83 o.params = o.params || {};
84 o.params.person_id = _this.personSel.getValue();
85 var act = _this.actionSel.getValue();
87 o.params.action = act;
89 var tbl = _this.affectSel.getValue();
91 o.params.on_table = tbl;
93 act = _this.dateFrom.getValue();
95 o.params['query[from]'] = act.format('Y-m-d');
97 act = _this.dateTo.getValue();
99 o.params['query[to]'] = act.format('Y-m-d');
102 act = _this.groupedCombo.getValue();
103 o.params['query[grouped]'] = act;
104 if (o.params['query[grouped]'] == 'gr') {
107 Roo.MessageBox.alert("Error", "Select a table to group results on");
110 // o.params['_columns'] =
111 o.params['_distinct'] = 'on_id';
122 reader : Pman.Readers.Events,
123 sortInfo : { field: 'event_when', direction: 'DESC'},
127 totalProperty : 'total',
136 'name': 'person_name',
140 'name': 'event_when',
142 'dateFormat': 'Y-m-d'
169 'name': 'person_id_id',
173 'name': 'person_id_office_id',
177 'name': 'person_id_name',
181 'name': 'person_id_phone',
185 'name': 'person_id_fax',
189 'name': 'person_id_email',
193 'name': 'person_id_company_id',
197 'name': 'person_id_role',
201 'name': 'person_id_active',
205 'name': 'person_id_remarks',
209 'name': 'person_id_passwd',
213 'name': 'person_id_owner_id',
217 'name': 'person_id_lang',
221 'name': 'person_id_no_reset_sent',
225 'name': 'person_id_action_type',
229 'name': 'person_id_project_id',
233 'name': 'person_id_deleted_by',
237 'name': 'person_id_deleted_dt',
246 url : baseURL + '/Roo/Events.php'
250 xtype: 'PagingToolbar',
254 displayMsg : "Displaying Events {0} - {1} of {2}",
255 emptyMsg : "No Events found",
261 click : function (_self, e)
265 'sort' : 'event_when',
269 person_id : _this.personSel.getValue(),
270 'csvTitles[0]' : 'When', 'csvCols[0]' : 'event_when',
271 'csvTitles[1]' : 'Staff', 'csvCols[1]' : 'person_id_name',
272 'csvTitles[2]' : 'Action', 'csvCols[2]' : 'action',
273 'csvTitles[3]' : 'Record ID', 'csvCols[3]' : 'on_id' ,
274 'csvTitles[4]' : 'Record Type', 'csvCols[4]' : 'on_table',
275 'csvTitles[5]' : 'Remarks', 'csvCols[5]' : 'remarks'
278 o.params.person_id = _this.personSel.getValue();
279 var act = _this.actionSel.getValue();
281 o.params.action = act;
283 var tbl = _this.affectSel.getValue();
285 o.params.on_table = tbl;
287 act = _this.dateFrom.getValue();
289 o.params['query[from]'] = act.format('Y-m-d');
291 act = _this.dateTo.getValue();
293 o.params['query[to]'] = act.format('Y-m-d');
298 url : baseURL + '/Roo/Events.php',
305 text : "Download to Excel"
322 select : function (combo, record, index)
324 _this.grid.footer.onClick('first');
327 render : function (_self)
329 _this.personSel = _self;
333 displayField : 'name',
335 emptyText : "Select Person ",
336 fieldLabel : 'Person ',
337 forceSelection : true,
339 loadingText : "Searching...",
341 name : 'person_id_name',
343 qtip : "Select Person ",
344 queryParam : 'query[name]',
345 selectOnFocus : true,
346 tpl : '<div class="x-grid-cell-text x-btn button"><b>{name}</b> ({company_id_name}) <{email}> </div>',
347 triggerAction : 'all',
355 beforeload : function (_self, o)
357 o.params = o.params || {};
358 o.company_id = Pman.Login.authUser.company_id;
361 sortInfo : { field : 'name' , direction : 'ASC' },
365 url : baseURL + '/Roo/Person.php',
373 totalProperty : 'total',
400 'name': 'company_id',
428 'name': 'no_reset_sent',
432 'name': 'action_type',
436 'name': 'project_id',
440 'name': 'deleted_by',
444 'name': 'deleted_dt',
446 'dateFormat': 'Y-m-d'
449 'name': 'office_id_id',
453 'name': 'office_id_company_id',
457 'name': 'office_id_name',
461 'name': 'office_id_address',
465 'name': 'office_id_phone',
469 'name': 'office_id_fax',
473 'name': 'office_id_email',
477 'name': 'office_id_role',
481 'name': 'company_id_code',
485 'name': 'company_id_name',
489 'name': 'company_id_remarks',
493 'name': 'company_id_owner_id',
497 'name': 'company_id_address',
501 'name': 'company_id_tel',
505 'name': 'company_id_fax',
509 'name': 'company_id_email',
513 'name': 'company_id_id',
517 'name': 'company_id_isOwner',
521 'name': 'company_id_logo_id',
525 'name': 'company_id_background_color',
529 'name': 'company_id_comptype',
533 'name': 'company_id_url',
537 'name': 'company_id_main_office_id',
541 'name': 'company_id_created_by',
545 'name': 'company_id_created_dt',
549 'name': 'company_id_updated_by',
553 'name': 'company_id_updated_dt',
557 'name': 'company_id_passwd',
561 'name': 'company_id_dispatch_port',
565 'name': 'company_id_province',
569 'name': 'company_id_country',
573 'name': 'project_id_id',
577 'name': 'project_id_name',
581 'name': 'project_id_remarks',
585 'name': 'project_id_owner_id',
589 'name': 'project_id_code',
593 'name': 'project_id_active',
597 'name': 'project_id_type',
601 'name': 'project_id_client_id',
605 'name': 'project_id_team_id',
609 'name': 'project_id_file_location',
613 'name': 'project_id_open_date',
617 'name': 'project_id_open_by',
621 'name': 'project_id_close_date',
625 'name': 'project_id_countries',
629 'name': 'project_id_languages',
633 'name': 'project_id_agency_id',
637 'name': 'owner_id_id',
641 'name': 'owner_id_office_id',
645 'name': 'owner_id_name',
649 'name': 'owner_id_phone',
653 'name': 'owner_id_fax',
657 'name': 'owner_id_email',
661 'name': 'owner_id_company_id',
665 'name': 'owner_id_role',
669 'name': 'owner_id_active',
673 'name': 'owner_id_remarks',
677 'name': 'owner_id_passwd',
681 'name': 'owner_id_owner_id',
685 'name': 'owner_id_lang',
689 'name': 'owner_id_no_reset_sent',
693 'name': 'owner_id_action_type',
697 'name': 'owner_id_project_id',
701 'name': 'owner_id_deleted_by',
705 'name': 'owner_id_deleted_dt',
716 select : function (combo, record, index)
718 _this.grid.footer.onClick('first');
720 render : function (_self)
722 _this.actionSel = _self;
726 displayField : 'action',
728 emptyText : "Select Action",
729 forceSelection : true,
731 loadingText : "Searching...",
735 qtip : "Select Action",
736 queryParam : 'query[action]',
737 selectOnFocus : true,
738 tpl : '<div class="x-grid-cell-text x-btn button"><b>{action}</b> </div>',
739 triggerAction : 'all',
741 valueField : 'action',
747 beforeload : function (_self, o)
749 o.params = o.params || {};
750 // staff can see all logs, other companies can only see their own.
751 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
752 o.params.company_id = Pman.Login.authUser.company_id;
754 o.params._distinct = 'action';
755 o.params._columns ='action';
759 sortInfo : { field : 'action' , direction : 'ASC' },
764 url : baseURL + '/Roo/Events.php'
769 totalProperty : 'total',
778 'name': 'person_name',
782 'name': 'event_when',
784 'dateFormat': 'Y-m-d'
811 'name': 'person_id_id',
815 'name': 'person_id_office_id',
819 'name': 'person_id_name',
823 'name': 'person_id_phone',
827 'name': 'person_id_fax',
831 'name': 'person_id_email',
835 'name': 'person_id_company_id',
839 'name': 'person_id_role',
843 'name': 'person_id_active',
847 'name': 'person_id_remarks',
851 'name': 'person_id_passwd',
855 'name': 'person_id_owner_id',
859 'name': 'person_id_lang',
863 'name': 'person_id_no_reset_sent',
867 'name': 'person_id_action_type',
871 'name': 'person_id_project_id',
875 'name': 'person_id_deleted_by',
879 'name': 'person_id_deleted_dt',
890 select : function (combo, record, index)
892 _this.grid.footer.onClick('first');
894 render : function (_self)
896 _this.affectSel = _self;
900 displayField : 'on_table',
902 emptyText : "Select Affects",
903 forceSelection : true,
905 loadingText : "Searching...",
909 qtip : "Select Action",
910 queryParam : 'query[on_table]',
911 selectOnFocus : true,
912 tpl : '<div class="x-grid-cell-text x-btn button"><b>{on_table}</b> </div>',
913 triggerAction : 'all',
915 valueField : 'action',
921 beforeload : function (_self, o)
923 o.params = o.params || {};
924 // staff can see all logs, other companies can only see their own.
925 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
926 o.params.company_id = Pman.Login.authUser.company_id;
928 o.params._distinct = 'on_table';
929 o.params._columns ='on_table';
933 sortInfo : { field : 'on_table' , direction : 'ASC' },
938 url : baseURL + '/Roo/Events.php'
943 totalProperty : 'total',
952 'name': 'person_name',
956 'name': 'event_when',
958 'dateFormat': 'Y-m-d'
985 'name': 'person_id_id',
989 'name': 'person_id_office_id',
993 'name': 'person_id_name',
997 'name': 'person_id_phone',
1001 'name': 'person_id_fax',
1005 'name': 'person_id_email',
1009 'name': 'person_id_company_id',
1013 'name': 'person_id_role',
1017 'name': 'person_id_active',
1021 'name': 'person_id_remarks',
1025 'name': 'person_id_passwd',
1029 'name': 'person_id_owner_id',
1033 'name': 'person_id_lang',
1037 'name': 'person_id_no_reset_sent',
1041 'name': 'person_id_action_type',
1045 'name': 'person_id_project_id',
1049 'name': 'person_id_deleted_by',
1053 'name': 'person_id_deleted_dt',
1069 render : function (_self)
1071 _this.dateFrom = _self;
1073 change : function (_self, newValue, oldValue)
1075 _this.grid.footer.onClick('first');
1084 render : function (_self)
1086 _this.dateTo = _self;
1088 change : function (_self, newValue, oldValue)
1090 _this.grid.footer.onClick('first');
1099 select : function (combo, record, index)
1101 _this.grid.footer.onClick('first');
1103 render : function (_self)
1105 _this.viewType = _self;
1109 displayField : 'display',
1111 emptyText : "Select Action",
1112 forceSelection : true,
1114 loadingText : "Searching...",
1118 qtip : "Select Action",
1119 queryParam : 'query[action]',
1120 selectOnFocus : true,
1121 tpl : '<div class="x-grid-cell-text x-btn button"><b>{action}</b> </div>',
1122 triggerAction : 'all',
1127 xtype: 'SimpleStore',
1130 data : [ [ 'detailed', "Detailed" ] , 'summary', "Summary"] ],
1131 fields : [ 'val', 'disp']
1138 xtype: 'ColumnModel',
1142 dataIndex : 'event_when',
1143 renderer : function(v) { return v ? v.dateFormat('d/m/Y H:i') : ''; }
1146 xtype: 'ColumnModel',
1153 xtype: 'ColumnModel',
1155 dataIndex : 'person_name',
1158 renderer : function(v,x,r) {
1159 return String.format('{0} <<a href="mailto:{1}">{1}</a>>', v, r.data.person_id_email);
1163 xtype: 'ColumnModel',
1167 dataIndex : 'action',
1168 renderer : function(v) { return String.format('{0}', v); }
1171 xtype: 'ColumnModel',
1175 dataIndex : 'ipaddr',
1176 renderer : function(v) { return String.format('{0}', v); }
1179 xtype: 'ColumnModel',
1181 header : 'Affected',
1183 dataIndex : 'on_id',
1184 renderer : function(v, x, r) { return v ? String.format('{0}({1})', r.data.on_table, v) : ''; }
1187 xtype: 'ColumnModel',
1189 dataIndex : 'remarks',
1192 renderer : function(v) { return String.format('<span qtip="{1}">{0}</span>', v, Roo.util.Format.htmlEncode(v)); }
1199 xtype: 'LayoutRegion',
1204 this.layout = this.panel.layout;