1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Pman.Tab.AdminLogEvents = new Roo.XComponent({
6 part : ["Admin","LogEvents"],
7 order : '001-Pman.Tab.AdminLogEvents',
9 parent : 'Pman.Tab.AdminLogs',
10 name : "Admin - Logs - Events",
12 permname : 'Admin.Logs',
18 xtype: 'NestedLayoutPanel',
23 xtype: 'BorderLayout',
27 xtype: 'ContentPanel',
30 render : function (_self)
32 _this.viewPanel = _self;
42 activate : function() {
45 _this.grid.footer.onClick('first');
61 //_this.dialog = Pman.Dialog.FILL_IN
62 if (_this.panel.active) {
63 this.footer.onClick('first');
67 autoExpandColumn : 'remarks',
70 xtype: 'RowSelectionModel',
73 afterselectionchange : function (_self)
75 // load detail log in _this.viewPanel;
76 if (!this.getSelected()) {
77 this.viewPanel.setContent("Nothing Selected");
80 var id = this.getSelected().data.id;
81 _this.viewPanel.load( { url : baseURL + "/Admin/EventView/" + id + ".html" });
91 beforeload : function (_self, o)
93 if (! _this.personSel) {
96 o.params = o.params || {};
97 o.params.person_id = _this.personSel.getValue();
98 var act = _this.actionSel.getValue();
100 o.params.action = act;
102 var tbl = _this.affectSel.getValue();
104 o.params.on_table = tbl;
106 act = _this.dateFrom.getValue();
108 o.params['query[from]'] = act.format('Y-m-d');
110 act = _this.dateTo.getValue();
112 o.params['query[to]'] = act.format('Y-m-d');
117 act = _this.groupedCombo.getValue();
118 o.params['query[grouped]'] = act;
119 if (o.params['query[grouped]'] == 'gr') {
122 Roo.MessageBox.alert("Error", "Select a table to group results on");
125 // o.params['_columns'] =
126 o.params['_distinct'] = 'on_id';
137 sortInfo : { field: 'event_when', direction: 'DESC'},
141 totalProperty : 'total',
150 'name': 'person_name',
154 'name': 'event_when',
156 'dateFormat': 'Y-m-d'
183 'name': 'person_id_id',
187 'name': 'person_id_office_id',
191 'name': 'person_id_name',
195 'name': 'person_id_phone',
199 'name': 'person_id_fax',
203 'name': 'person_id_email',
207 'name': 'person_id_company_id',
211 'name': 'person_id_role',
215 'name': 'person_id_active',
219 'name': 'person_id_remarks',
223 'name': 'person_id_passwd',
227 'name': 'person_id_owner_id',
231 'name': 'person_id_lang',
235 'name': 'person_id_no_reset_sent',
239 'name': 'person_id_action_type',
243 'name': 'person_id_project_id',
247 'name': 'person_id_deleted_by',
251 'name': 'person_id_deleted_dt',
260 url : baseURL + '/Roo/Events.php'
264 xtype: 'PagingToolbar',
268 displayMsg : "Displaying Events {0} - {1} of {2}",
269 emptyMsg : "No Events found",
275 click : function (_self, e)
279 'sort' : 'event_when',
283 person_id : _this.personSel.getValue(),
284 'csvTitles[0]' : 'When', 'csvCols[0]' : 'event_when',
285 'csvTitles[1]' : 'Staff', 'csvCols[1]' : 'person_id_name',
286 'csvTitles[2]' : 'Action', 'csvCols[2]' : 'action',
287 'csvTitles[3]' : 'Record ID', 'csvCols[3]' : 'on_id' ,
288 'csvTitles[4]' : 'Record Type', 'csvCols[4]' : 'on_table',
289 'csvTitles[5]' : 'Remarks', 'csvCols[5]' : 'remarks'
292 params.person_id = _this.personSel.getValue();
293 var act = _this.actionSel.getValue();
297 var tbl = _this.affectSel.getValue();
299 params.on_table = tbl;
301 act = _this.dateFrom.getValue();
303 params['query[from]'] = act.format('Y-m-d');
305 act = _this.dateTo.getValue();
307 params['query[to]'] = act.format('Y-m-d');
312 url : baseURL + '/Roo/Events.php',
319 text : "Download to Excel"
336 select : function (combo, record, index)
338 _this.grid.footer.onClick('first');
341 render : function (_self)
343 _this.personSel = _self;
347 displayField : 'name',
349 emptyText : "Select Person ",
350 fieldLabel : 'Person ',
351 forceSelection : true,
353 loadingText : "Searching...",
355 name : 'person_id_name',
357 qtip : "Select Person ",
358 queryParam : 'query[name]',
359 selectOnFocus : true,
360 tpl : '<div class="x-grid-cell-text x-btn button"><b>{name}</b> ({company_id_name}) <{email}> </div>',
361 triggerAction : 'all',
369 beforeload : function (_self, o)
371 o.params = o.params || {};
372 o.company_id = Pman.Login.authUser.company_id;
375 sortInfo : { field : 'name' , direction : 'ASC' },
379 url : baseURL + '/Roo/Person.php',
387 totalProperty : 'total',
414 'name': 'company_id',
442 'name': 'no_reset_sent',
446 'name': 'action_type',
450 'name': 'project_id',
454 'name': 'deleted_by',
458 'name': 'deleted_dt',
460 'dateFormat': 'Y-m-d'
463 'name': 'office_id_id',
467 'name': 'office_id_company_id',
471 'name': 'office_id_name',
475 'name': 'office_id_address',
479 'name': 'office_id_phone',
483 'name': 'office_id_fax',
487 'name': 'office_id_email',
491 'name': 'office_id_role',
495 'name': 'company_id_code',
499 'name': 'company_id_name',
503 'name': 'company_id_remarks',
507 'name': 'company_id_owner_id',
511 'name': 'company_id_address',
515 'name': 'company_id_tel',
519 'name': 'company_id_fax',
523 'name': 'company_id_email',
527 'name': 'company_id_id',
531 'name': 'company_id_isOwner',
535 'name': 'company_id_logo_id',
539 'name': 'company_id_background_color',
543 'name': 'company_id_comptype',
547 'name': 'company_id_url',
551 'name': 'company_id_main_office_id',
555 'name': 'company_id_created_by',
559 'name': 'company_id_created_dt',
563 'name': 'company_id_updated_by',
567 'name': 'company_id_updated_dt',
571 'name': 'company_id_passwd',
575 'name': 'company_id_dispatch_port',
579 'name': 'company_id_province',
583 'name': 'company_id_country',
587 'name': 'project_id_id',
591 'name': 'project_id_name',
595 'name': 'project_id_remarks',
599 'name': 'project_id_owner_id',
603 'name': 'project_id_code',
607 'name': 'project_id_active',
611 'name': 'project_id_type',
615 'name': 'project_id_client_id',
619 'name': 'project_id_team_id',
623 'name': 'project_id_file_location',
627 'name': 'project_id_open_date',
631 'name': 'project_id_open_by',
635 'name': 'project_id_close_date',
639 'name': 'project_id_countries',
643 'name': 'project_id_languages',
647 'name': 'project_id_agency_id',
651 'name': 'owner_id_id',
655 'name': 'owner_id_office_id',
659 'name': 'owner_id_name',
663 'name': 'owner_id_phone',
667 'name': 'owner_id_fax',
671 'name': 'owner_id_email',
675 'name': 'owner_id_company_id',
679 'name': 'owner_id_role',
683 'name': 'owner_id_active',
687 'name': 'owner_id_remarks',
691 'name': 'owner_id_passwd',
695 'name': 'owner_id_owner_id',
699 'name': 'owner_id_lang',
703 'name': 'owner_id_no_reset_sent',
707 'name': 'owner_id_action_type',
711 'name': 'owner_id_project_id',
715 'name': 'owner_id_deleted_by',
719 'name': 'owner_id_deleted_dt',
730 select : function (combo, record, index)
732 _this.grid.footer.onClick('first');
734 render : function (_self)
736 _this.actionSel = _self;
740 displayField : 'action',
742 emptyText : "Select Action",
743 forceSelection : true,
745 loadingText : "Searching...",
749 qtip : "Select Action",
750 queryParam : 'query[action]',
751 selectOnFocus : true,
752 tpl : '<div class="x-grid-cell-text x-btn button"><b>{action}</b> </div>',
753 triggerAction : 'all',
755 valueField : 'action',
761 beforeload : function (_self, o)
763 o.params = o.params || {};
764 // staff can see all logs, other companies can only see their own.
765 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
766 o.params.company_id = Pman.Login.authUser.company_id;
768 o.params._distinct = 'action';
769 o.params._columns ='action';
773 sortInfo : { field : 'action' , direction : 'ASC' },
778 url : baseURL + '/Roo/Events.php'
783 totalProperty : 'total',
792 'name': 'person_name',
796 'name': 'event_when',
798 'dateFormat': 'Y-m-d'
825 'name': 'person_id_id',
829 'name': 'person_id_office_id',
833 'name': 'person_id_name',
837 'name': 'person_id_phone',
841 'name': 'person_id_fax',
845 'name': 'person_id_email',
849 'name': 'person_id_company_id',
853 'name': 'person_id_role',
857 'name': 'person_id_active',
861 'name': 'person_id_remarks',
865 'name': 'person_id_passwd',
869 'name': 'person_id_owner_id',
873 'name': 'person_id_lang',
877 'name': 'person_id_no_reset_sent',
881 'name': 'person_id_action_type',
885 'name': 'person_id_project_id',
889 'name': 'person_id_deleted_by',
893 'name': 'person_id_deleted_dt',
904 select : function (combo, record, index)
906 _this.grid.footer.onClick('first');
908 render : function (_self)
910 _this.affectSel = _self;
914 displayField : 'on_table',
916 emptyText : "Select Affects",
917 forceSelection : true,
919 loadingText : "Searching...",
923 qtip : "Select Action",
924 queryParam : 'query[on_table]',
925 selectOnFocus : true,
926 tpl : '<div class="x-grid-cell-text x-btn button"><b>{on_table}</b> </div>',
927 triggerAction : 'all',
929 valueField : 'action',
935 beforeload : function (_self, o)
937 o.params = o.params || {};
938 // staff can see all logs, other companies can only see their own.
939 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
940 o.params.company_id = Pman.Login.authUser.company_id;
942 o.params._distinct = 'on_table';
943 o.params._columns ='on_table';
947 sortInfo : { field : 'on_table' , direction : 'ASC' },
952 url : baseURL + '/Roo/Events.php'
957 totalProperty : 'total',
966 'name': 'person_name',
970 'name': 'event_when',
972 'dateFormat': 'Y-m-d'
999 'name': 'person_id_id',
1003 'name': 'person_id_office_id',
1007 'name': 'person_id_name',
1011 'name': 'person_id_phone',
1015 'name': 'person_id_fax',
1019 'name': 'person_id_email',
1023 'name': 'person_id_company_id',
1027 'name': 'person_id_role',
1031 'name': 'person_id_active',
1035 'name': 'person_id_remarks',
1039 'name': 'person_id_passwd',
1043 'name': 'person_id_owner_id',
1047 'name': 'person_id_lang',
1051 'name': 'person_id_no_reset_sent',
1055 'name': 'person_id_action_type',
1059 'name': 'person_id_project_id',
1063 'name': 'person_id_deleted_by',
1067 'name': 'person_id_deleted_dt',
1083 render : function (_self)
1085 _this.dateFrom = _self;
1087 change : function (_self, newValue, oldValue)
1089 _this.grid.footer.onClick('first');
1098 render : function (_self)
1100 _this.dateTo = _self;
1102 change : function (_self, newValue, oldValue)
1104 _this.grid.footer.onClick('first');
1113 xtype: 'ColumnModel',
1115 dataIndex : 'event_when',
1118 renderer : function(v) { return v ? v.dateFormat('d/m/Y H:i') : ''; }
1121 xtype: 'ColumnModel',
1128 xtype: 'ColumnModel',
1130 dataIndex : 'person_table_name',
1133 renderer : function(v,x,r) {
1134 return String.format('{0} <<a href="mailto:{1}">{1}</a>>',
1135 v, r.data.person_table_email);
1139 xtype: 'ColumnModel',
1143 dataIndex : 'action',
1144 renderer : function(v) { return String.format('{0}', v); }
1147 xtype: 'ColumnModel',
1151 dataIndex : 'ipaddr',
1152 renderer : function(v) { return String.format('{0}', v); }
1155 xtype: 'ColumnModel',
1157 dataIndex : 'on_table',
1158 header : 'Affected',
1160 renderer : function(v, x, r) {
1161 return v ? String.format('{0}({1})', v, r.data.on_id) : '';
1165 xtype: 'ColumnModel',
1167 dataIndex : 'remarks',
1170 renderer : function(v) { return String.format('<span qtip="{1}">{0}</span>', v, Roo.util.Format.htmlEncode(v)); }
1177 xtype: 'LayoutRegion',
1181 xtype: 'LayoutRegion',