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 (!Pman.buildCompleted) {
98 if (! _this.personSel) {
101 o.params = o.params || {};
102 o.params.person_id = _this.personSel.getValue();
103 var act = _this.actionSel.getValue();
105 o.params.action = act;
107 var tbl = _this.affectSel.getValue();
109 o.params.on_table = tbl;
111 act = _this.dateFrom.getValue();
113 o.params['query[from]'] = act.format('Y-m-d');
115 act = _this.dateTo.getValue();
117 o.params['query[to]'] = act.format('Y-m-d');
122 act = _this.groupedCombo.getValue();
123 o.params['query[grouped]'] = act;
124 if (o.params['query[grouped]'] == 'gr') {
127 Roo.MessageBox.alert("Error", "Select a table to group results on");
130 // o.params['_columns'] =
131 o.params['_distinct'] = 'on_id';
142 sortInfo : { field: 'event_when', direction: 'DESC'},
146 totalProperty : 'total',
155 'name': 'person_name',
159 'name': 'event_when',
161 'dateFormat': 'Y-m-d'
188 'name': 'person_id_id',
192 'name': 'person_id_office_id',
196 'name': 'person_id_name',
200 'name': 'person_id_phone',
204 'name': 'person_id_fax',
208 'name': 'person_id_email',
212 'name': 'person_id_company_id',
216 'name': 'person_id_role',
220 'name': 'person_id_active',
224 'name': 'person_id_remarks',
228 'name': 'person_id_passwd',
232 'name': 'person_id_owner_id',
236 'name': 'person_id_lang',
240 'name': 'person_id_no_reset_sent',
244 'name': 'person_id_action_type',
248 'name': 'person_id_project_id',
252 'name': 'person_id_deleted_by',
256 'name': 'person_id_deleted_dt',
265 url : baseURL + '/Roo/Events.php'
269 xtype: 'PagingToolbar',
273 displayMsg : "Displaying Events {0} - {1} of {2}",
274 emptyMsg : "No Events found",
280 click : function (_self, e)
284 'sort' : 'event_when',
288 person_id : _this.personSel.getValue(),
289 'csvTitles[0]' : 'When', 'csvCols[0]' : 'event_when',
290 'csvTitles[1]' : 'Staff', 'csvCols[1]' : 'person_id_name',
291 'csvTitles[2]' : 'Action', 'csvCols[2]' : 'action',
292 'csvTitles[3]' : 'Record ID', 'csvCols[3]' : 'on_id' ,
293 'csvTitles[4]' : 'Record Type', 'csvCols[4]' : 'on_table',
294 'csvTitles[5]' : 'Remarks', 'csvCols[5]' : 'remarks'
297 params.person_id = _this.personSel.getValue();
298 var act = _this.actionSel.getValue();
302 var tbl = _this.affectSel.getValue();
304 params.on_table = tbl;
306 act = _this.dateFrom.getValue();
308 params['query[from]'] = act.format('Y-m-d');
310 act = _this.dateTo.getValue();
312 params['query[to]'] = act.format('Y-m-d');
317 url : baseURL + '/Roo/Events.php',
324 text : "Download to Excel"
341 select : function (combo, record, index)
343 _this.grid.footer.onClick('first');
346 render : function (_self)
348 _this.personSel = _self;
352 displayField : 'name',
354 emptyText : "Select Person ",
355 fieldLabel : 'Person ',
356 forceSelection : true,
358 loadingText : "Searching...",
360 name : 'person_id_name',
362 qtip : "Select Person ",
363 queryParam : 'query[name]',
364 selectOnFocus : true,
365 tpl : '<div class="x-grid-cell-text x-btn button"><b>{name}</b> ({company_id_name}) <{email}> </div>',
366 triggerAction : 'all',
374 beforeload : function (_self, o)
376 o.params = o.params || {};
377 o.company_id = Pman.Login.authUser.company_id;
380 sortInfo : { field : 'name' , direction : 'ASC' },
384 url : baseURL + '/Roo/Person.php',
392 totalProperty : 'total',
419 'name': 'company_id',
447 'name': 'no_reset_sent',
451 'name': 'action_type',
455 'name': 'project_id',
459 'name': 'deleted_by',
463 'name': 'deleted_dt',
465 'dateFormat': 'Y-m-d'
468 'name': 'office_id_id',
472 'name': 'office_id_company_id',
476 'name': 'office_id_name',
480 'name': 'office_id_address',
484 'name': 'office_id_phone',
488 'name': 'office_id_fax',
492 'name': 'office_id_email',
496 'name': 'office_id_role',
500 'name': 'company_id_code',
504 'name': 'company_id_name',
508 'name': 'company_id_remarks',
512 'name': 'company_id_owner_id',
516 'name': 'company_id_address',
520 'name': 'company_id_tel',
524 'name': 'company_id_fax',
528 'name': 'company_id_email',
532 'name': 'company_id_id',
536 'name': 'company_id_isOwner',
540 'name': 'company_id_logo_id',
544 'name': 'company_id_background_color',
548 'name': 'company_id_comptype',
552 'name': 'company_id_url',
556 'name': 'company_id_main_office_id',
560 'name': 'company_id_created_by',
564 'name': 'company_id_created_dt',
568 'name': 'company_id_updated_by',
572 'name': 'company_id_updated_dt',
576 'name': 'company_id_passwd',
580 'name': 'company_id_dispatch_port',
584 'name': 'company_id_province',
588 'name': 'company_id_country',
592 'name': 'project_id_id',
596 'name': 'project_id_name',
600 'name': 'project_id_remarks',
604 'name': 'project_id_owner_id',
608 'name': 'project_id_code',
612 'name': 'project_id_active',
616 'name': 'project_id_type',
620 'name': 'project_id_client_id',
624 'name': 'project_id_team_id',
628 'name': 'project_id_file_location',
632 'name': 'project_id_open_date',
636 'name': 'project_id_open_by',
640 'name': 'project_id_close_date',
644 'name': 'project_id_countries',
648 'name': 'project_id_languages',
652 'name': 'project_id_agency_id',
656 'name': 'owner_id_id',
660 'name': 'owner_id_office_id',
664 'name': 'owner_id_name',
668 'name': 'owner_id_phone',
672 'name': 'owner_id_fax',
676 'name': 'owner_id_email',
680 'name': 'owner_id_company_id',
684 'name': 'owner_id_role',
688 'name': 'owner_id_active',
692 'name': 'owner_id_remarks',
696 'name': 'owner_id_passwd',
700 'name': 'owner_id_owner_id',
704 'name': 'owner_id_lang',
708 'name': 'owner_id_no_reset_sent',
712 'name': 'owner_id_action_type',
716 'name': 'owner_id_project_id',
720 'name': 'owner_id_deleted_by',
724 'name': 'owner_id_deleted_dt',
735 select : function (combo, record, index)
737 _this.grid.footer.onClick('first');
739 render : function (_self)
741 _this.actionSel = _self;
745 displayField : 'action',
747 emptyText : "Select Action",
748 forceSelection : true,
750 loadingText : "Searching...",
754 qtip : "Select Action",
755 queryParam : 'query[action]',
756 selectOnFocus : true,
757 tpl : '<div class="x-grid-cell-text x-btn button"><b>{action}</b> </div>',
758 triggerAction : 'all',
760 valueField : 'action',
766 beforeload : function (_self, o)
768 o.params = o.params || {};
769 // staff can see all logs, other companies can only see their own.
770 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
771 o.params.company_id = Pman.Login.authUser.company_id;
773 o.params._distinct = 'action';
774 o.params._columns ='action';
778 sortInfo : { field : 'action' , direction : 'ASC' },
783 url : baseURL + '/Roo/Events.php'
788 totalProperty : 'total',
797 'name': 'person_name',
801 'name': 'event_when',
803 'dateFormat': 'Y-m-d'
830 'name': 'person_id_id',
834 'name': 'person_id_office_id',
838 'name': 'person_id_name',
842 'name': 'person_id_phone',
846 'name': 'person_id_fax',
850 'name': 'person_id_email',
854 'name': 'person_id_company_id',
858 'name': 'person_id_role',
862 'name': 'person_id_active',
866 'name': 'person_id_remarks',
870 'name': 'person_id_passwd',
874 'name': 'person_id_owner_id',
878 'name': 'person_id_lang',
882 'name': 'person_id_no_reset_sent',
886 'name': 'person_id_action_type',
890 'name': 'person_id_project_id',
894 'name': 'person_id_deleted_by',
898 'name': 'person_id_deleted_dt',
909 select : function (combo, record, index)
911 _this.grid.footer.onClick('first');
913 render : function (_self)
915 _this.affectSel = _self;
919 displayField : 'on_table',
921 emptyText : "Select Affects",
922 forceSelection : true,
924 loadingText : "Searching...",
928 qtip : "Select Action",
929 queryParam : 'query[on_table]',
930 selectOnFocus : true,
931 tpl : '<div class="x-grid-cell-text x-btn button"><b>{on_table}</b> </div>',
932 triggerAction : 'all',
934 valueField : 'action',
940 beforeload : function (_self, o)
942 o.params = o.params || {};
943 // staff can see all logs, other companies can only see their own.
944 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
945 o.params.company_id = Pman.Login.authUser.company_id;
947 o.params._distinct = 'on_table';
948 o.params._columns ='on_table';
952 sortInfo : { field : 'on_table' , direction : 'ASC' },
957 url : baseURL + '/Roo/Events.php'
962 totalProperty : 'total',
971 'name': 'person_name',
975 'name': 'event_when',
977 'dateFormat': 'Y-m-d'
1004 'name': 'person_id_id',
1008 'name': 'person_id_office_id',
1012 'name': 'person_id_name',
1016 'name': 'person_id_phone',
1020 'name': 'person_id_fax',
1024 'name': 'person_id_email',
1028 'name': 'person_id_company_id',
1032 'name': 'person_id_role',
1036 'name': 'person_id_active',
1040 'name': 'person_id_remarks',
1044 'name': 'person_id_passwd',
1048 'name': 'person_id_owner_id',
1052 'name': 'person_id_lang',
1056 'name': 'person_id_no_reset_sent',
1060 'name': 'person_id_action_type',
1064 'name': 'person_id_project_id',
1068 'name': 'person_id_deleted_by',
1072 'name': 'person_id_deleted_dt',
1088 render : function (_self)
1090 _this.dateFrom = _self;
1092 change : function (_self, newValue, oldValue)
1094 _this.grid.footer.onClick('first');
1103 render : function (_self)
1105 _this.dateTo = _self;
1107 change : function (_self, newValue, oldValue)
1109 _this.grid.footer.onClick('first');
1118 xtype: 'ColumnModel',
1120 dataIndex : 'event_when',
1123 renderer : function(v) { return v ? v.dateFormat('d/m/Y H:i') : ''; }
1126 xtype: 'ColumnModel',
1133 xtype: 'ColumnModel',
1135 dataIndex : 'person_table_name',
1138 renderer : function(v,x,r) {
1140 var email = r.data.person_table_email ? r.data.person_table_email : r.data.person_id_email;
1141 var name = r.data.person_table_name ? r.data.person_table_name : r.data.person_id_name;
1142 return String.format('{0} <<a href="mailto:{1}">{1}</a>>',
1147 xtype: 'ColumnModel',
1151 dataIndex : 'action',
1152 renderer : function(v) { return String.format('{0}', v); }
1155 xtype: 'ColumnModel',
1159 dataIndex : 'ipaddr',
1160 renderer : function(v) { return String.format('{0}', v); }
1163 xtype: 'ColumnModel',
1165 dataIndex : 'on_table',
1166 header : 'Affected',
1168 renderer : function(v, x, r) {
1169 return v ? String.format('{0}({1})', v, r.data.on_id) : '';
1173 xtype: 'ColumnModel',
1175 dataIndex : 'remarks',
1178 renderer : function(v) { return String.format('<span qtip="{1}">{0}</span>', v, Roo.util.Format.htmlEncode(v)); }
1185 xtype: 'LayoutRegion',
1189 xtype: 'LayoutRegion',