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');
101 o.params['query[viewtype]'] = _this.viewtype.getValue();
104 act = _this.groupedCombo.getValue();
105 o.params['query[grouped]'] = act;
106 if (o.params['query[grouped]'] == 'gr') {
109 Roo.MessageBox.alert("Error", "Select a table to group results on");
112 // o.params['_columns'] =
113 o.params['_distinct'] = 'on_id';
124 reader : Pman.Readers.Events,
125 sortInfo : { field: 'event_when', direction: 'DESC'},
129 totalProperty : 'total',
138 'name': 'person_name',
142 'name': 'event_when',
144 'dateFormat': 'Y-m-d'
171 'name': 'person_id_id',
175 'name': 'person_id_office_id',
179 'name': 'person_id_name',
183 'name': 'person_id_phone',
187 'name': 'person_id_fax',
191 'name': 'person_id_email',
195 'name': 'person_id_company_id',
199 'name': 'person_id_role',
203 'name': 'person_id_active',
207 'name': 'person_id_remarks',
211 'name': 'person_id_passwd',
215 'name': 'person_id_owner_id',
219 'name': 'person_id_lang',
223 'name': 'person_id_no_reset_sent',
227 'name': 'person_id_action_type',
231 'name': 'person_id_project_id',
235 'name': 'person_id_deleted_by',
239 'name': 'person_id_deleted_dt',
248 url : baseURL + '/Roo/Events.php'
252 xtype: 'PagingToolbar',
256 displayMsg : "Displaying Events {0} - {1} of {2}",
257 emptyMsg : "No Events found",
263 click : function (_self, e)
267 'sort' : 'event_when',
271 person_id : _this.personSel.getValue(),
272 'csvTitles[0]' : 'When', 'csvCols[0]' : 'event_when',
273 'csvTitles[1]' : 'Staff', 'csvCols[1]' : 'person_id_name',
274 'csvTitles[2]' : 'Action', 'csvCols[2]' : 'action',
275 'csvTitles[3]' : 'Record ID', 'csvCols[3]' : 'on_id' ,
276 'csvTitles[4]' : 'Record Type', 'csvCols[4]' : 'on_table',
277 'csvTitles[5]' : 'Remarks', 'csvCols[5]' : 'remarks'
280 o.params.person_id = _this.personSel.getValue();
281 var act = _this.actionSel.getValue();
283 o.params.action = act;
285 var tbl = _this.affectSel.getValue();
287 o.params.on_table = tbl;
289 act = _this.dateFrom.getValue();
291 o.params['query[from]'] = act.format('Y-m-d');
293 act = _this.dateTo.getValue();
295 o.params['query[to]'] = act.format('Y-m-d');
300 url : baseURL + '/Roo/Events.php',
307 text : "Download to Excel"
324 select : function (combo, record, index)
326 _this.grid.footer.onClick('first');
329 render : function (_self)
331 _this.personSel = _self;
335 displayField : 'name',
337 emptyText : "Select Person ",
338 fieldLabel : 'Person ',
339 forceSelection : true,
341 loadingText : "Searching...",
343 name : 'person_id_name',
345 qtip : "Select Person ",
346 queryParam : 'query[name]',
347 selectOnFocus : true,
348 tpl : '<div class="x-grid-cell-text x-btn button"><b>{name}</b> ({company_id_name}) <{email}> </div>',
349 triggerAction : 'all',
357 beforeload : function (_self, o)
359 o.params = o.params || {};
360 o.company_id = Pman.Login.authUser.company_id;
363 sortInfo : { field : 'name' , direction : 'ASC' },
367 url : baseURL + '/Roo/Person.php',
375 totalProperty : 'total',
402 'name': 'company_id',
430 'name': 'no_reset_sent',
434 'name': 'action_type',
438 'name': 'project_id',
442 'name': 'deleted_by',
446 'name': 'deleted_dt',
448 'dateFormat': 'Y-m-d'
451 'name': 'office_id_id',
455 'name': 'office_id_company_id',
459 'name': 'office_id_name',
463 'name': 'office_id_address',
467 'name': 'office_id_phone',
471 'name': 'office_id_fax',
475 'name': 'office_id_email',
479 'name': 'office_id_role',
483 'name': 'company_id_code',
487 'name': 'company_id_name',
491 'name': 'company_id_remarks',
495 'name': 'company_id_owner_id',
499 'name': 'company_id_address',
503 'name': 'company_id_tel',
507 'name': 'company_id_fax',
511 'name': 'company_id_email',
515 'name': 'company_id_id',
519 'name': 'company_id_isOwner',
523 'name': 'company_id_logo_id',
527 'name': 'company_id_background_color',
531 'name': 'company_id_comptype',
535 'name': 'company_id_url',
539 'name': 'company_id_main_office_id',
543 'name': 'company_id_created_by',
547 'name': 'company_id_created_dt',
551 'name': 'company_id_updated_by',
555 'name': 'company_id_updated_dt',
559 'name': 'company_id_passwd',
563 'name': 'company_id_dispatch_port',
567 'name': 'company_id_province',
571 'name': 'company_id_country',
575 'name': 'project_id_id',
579 'name': 'project_id_name',
583 'name': 'project_id_remarks',
587 'name': 'project_id_owner_id',
591 'name': 'project_id_code',
595 'name': 'project_id_active',
599 'name': 'project_id_type',
603 'name': 'project_id_client_id',
607 'name': 'project_id_team_id',
611 'name': 'project_id_file_location',
615 'name': 'project_id_open_date',
619 'name': 'project_id_open_by',
623 'name': 'project_id_close_date',
627 'name': 'project_id_countries',
631 'name': 'project_id_languages',
635 'name': 'project_id_agency_id',
639 'name': 'owner_id_id',
643 'name': 'owner_id_office_id',
647 'name': 'owner_id_name',
651 'name': 'owner_id_phone',
655 'name': 'owner_id_fax',
659 'name': 'owner_id_email',
663 'name': 'owner_id_company_id',
667 'name': 'owner_id_role',
671 'name': 'owner_id_active',
675 'name': 'owner_id_remarks',
679 'name': 'owner_id_passwd',
683 'name': 'owner_id_owner_id',
687 'name': 'owner_id_lang',
691 'name': 'owner_id_no_reset_sent',
695 'name': 'owner_id_action_type',
699 'name': 'owner_id_project_id',
703 'name': 'owner_id_deleted_by',
707 'name': 'owner_id_deleted_dt',
718 select : function (combo, record, index)
720 _this.grid.footer.onClick('first');
722 render : function (_self)
724 _this.actionSel = _self;
728 displayField : 'action',
730 emptyText : "Select Action",
731 forceSelection : true,
733 loadingText : "Searching...",
737 qtip : "Select Action",
738 queryParam : 'query[action]',
739 selectOnFocus : true,
740 tpl : '<div class="x-grid-cell-text x-btn button"><b>{action}</b> </div>',
741 triggerAction : 'all',
743 valueField : 'action',
749 beforeload : function (_self, o)
751 o.params = o.params || {};
752 // staff can see all logs, other companies can only see their own.
753 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
754 o.params.company_id = Pman.Login.authUser.company_id;
756 o.params._distinct = 'action';
757 o.params._columns ='action';
761 sortInfo : { field : 'action' , direction : 'ASC' },
766 url : baseURL + '/Roo/Events.php'
771 totalProperty : 'total',
780 'name': 'person_name',
784 'name': 'event_when',
786 'dateFormat': 'Y-m-d'
813 'name': 'person_id_id',
817 'name': 'person_id_office_id',
821 'name': 'person_id_name',
825 'name': 'person_id_phone',
829 'name': 'person_id_fax',
833 'name': 'person_id_email',
837 'name': 'person_id_company_id',
841 'name': 'person_id_role',
845 'name': 'person_id_active',
849 'name': 'person_id_remarks',
853 'name': 'person_id_passwd',
857 'name': 'person_id_owner_id',
861 'name': 'person_id_lang',
865 'name': 'person_id_no_reset_sent',
869 'name': 'person_id_action_type',
873 'name': 'person_id_project_id',
877 'name': 'person_id_deleted_by',
881 'name': 'person_id_deleted_dt',
892 select : function (combo, record, index)
894 _this.grid.footer.onClick('first');
896 render : function (_self)
898 _this.affectSel = _self;
902 displayField : 'on_table',
904 emptyText : "Select Affects",
905 forceSelection : true,
907 loadingText : "Searching...",
911 qtip : "Select Action",
912 queryParam : 'query[on_table]',
913 selectOnFocus : true,
914 tpl : '<div class="x-grid-cell-text x-btn button"><b>{on_table}</b> </div>',
915 triggerAction : 'all',
917 valueField : 'action',
923 beforeload : function (_self, o)
925 o.params = o.params || {};
926 // staff can see all logs, other companies can only see their own.
927 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
928 o.params.company_id = Pman.Login.authUser.company_id;
930 o.params._distinct = 'on_table';
931 o.params._columns ='on_table';
935 sortInfo : { field : 'on_table' , direction : 'ASC' },
940 url : baseURL + '/Roo/Events.php'
945 totalProperty : 'total',
954 'name': 'person_name',
958 'name': 'event_when',
960 'dateFormat': 'Y-m-d'
987 'name': 'person_id_id',
991 'name': 'person_id_office_id',
995 'name': 'person_id_name',
999 'name': 'person_id_phone',
1003 'name': 'person_id_fax',
1007 'name': 'person_id_email',
1011 'name': 'person_id_company_id',
1015 'name': 'person_id_role',
1019 'name': 'person_id_active',
1023 'name': 'person_id_remarks',
1027 'name': 'person_id_passwd',
1031 'name': 'person_id_owner_id',
1035 'name': 'person_id_lang',
1039 'name': 'person_id_no_reset_sent',
1043 'name': 'person_id_action_type',
1047 'name': 'person_id_project_id',
1051 'name': 'person_id_deleted_by',
1055 'name': 'person_id_deleted_dt',
1071 render : function (_self)
1073 _this.dateFrom = _self;
1075 change : function (_self, newValue, oldValue)
1077 _this.grid.footer.onClick('first');
1086 render : function (_self)
1088 _this.dateTo = _self;
1090 change : function (_self, newValue, oldValue)
1092 _this.grid.footer.onClick('first');
1101 select : function (combo, record, index)
1103 _this.grid.footer.onClick('first');
1105 render : function (_self)
1107 _this.viewtype = _self;
1111 displayField : 'display',
1113 forceSelection : true,
1115 loadingText : "Searching...",
1117 qtip : "Select Action",
1118 queryParam : 'query[action]',
1119 selectOnFocus : true,
1120 tpl : '<div class="x-grid-cell-text x-btn button"><b>{display}</b> </div>',
1121 triggerAction : 'all',
1126 xtype: 'SimpleStore',
1129 data : [ [ 'detailed', "Detailed View" ] , [ 'summary', "Summary View"] ],
1130 fields : [ 'val', 'display']
1137 xtype: 'ColumnModel',
1141 dataIndex : 'event_when',
1142 renderer : function(v) { return v ? v.dateFormat('d/m/Y H:i') : ''; }
1145 xtype: 'ColumnModel',
1152 xtype: 'ColumnModel',
1154 dataIndex : 'person_name',
1157 renderer : function(v,x,r) {
1158 return String.format('{0} <<a href="mailto:{1}">{1}</a>>', v, r.data.person_id_email);
1162 xtype: 'ColumnModel',
1166 dataIndex : 'action',
1167 renderer : function(v) { return String.format('{0}', v); }
1170 xtype: 'ColumnModel',
1174 dataIndex : 'ipaddr',
1175 renderer : function(v) { return String.format('{0}', v); }
1178 xtype: 'ColumnModel',
1180 header : 'Affected',
1182 dataIndex : 'on_id',
1183 renderer : function(v, x, r) { return v ? String.format('{0}({1})', r.data.on_table, v) : ''; }
1186 xtype: 'ColumnModel',
1188 dataIndex : 'remarks',
1191 renderer : function(v) { return String.format('<span qtip="{1}">{0}</span>', v, Roo.util.Format.htmlEncode(v)); }
1198 xtype: 'LayoutRegion',
1203 this.layout = this.panel.layout;