1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Roo.namespace('Pman.Tab');
7 Pman.Tab.AdminLogEvents = new Roo.XComponent({
10 '231bc72756b5e6de492aaaa1577f61b1' :"Remarks",
11 '2ea72778ebaacc973260c88837dd7a2f' :"Displaying Events {0} - {1} of {2}",
12 '87f9f735a1d36793ceaecd4e47124b63' :"Events",
13 '1b7f7d24575cdbfadb83b9587fa1bf97' :"#id",
14 'a12a3079e14ced46e69ba52b8a90b21a' :"IP",
15 '1243daf593fa297e07ab03bf06d925af' :"Searching...",
16 '01bd6a16732dfa2b760dc8566c58afae' :"Download to Excel",
17 '498f79c4c5bbde77f1bceb6c86fd0f6d' :"Show",
18 '037fd50b0e85bb65995ca7125d06c7cd' :"Select Person Table",
19 '42cf593b947cd3d591fa132742486f89' :"Person ",
20 'fd7535ce3979bb8547e2c01689db0767' :"Select Person ",
21 '679308a758de538c5f39c4c6cdba6593' :"Select Affects",
22 'a8929eb5c1553d3f70497f862d25d0ce' :"Select Action",
23 '39b9e051f9fe75e65c7a330bb00499d4' :"Date Range",
24 '4e97aeeaa8b15ca1180fcd1f3ac478d1' :"When",
25 '40bed7cf9b3d4bb3a3d7a7e3eb18c5eb' :"Person",
26 '004bf6c9a40003140292e97330236c53' :"Action",
27 '90e4ac2e5a22e53df63b6b186d8727ba' :"No Events found",
28 '2c92a9a6a5dbf570825e62eabcdecd8d' :"Affected"
31 part : ["Admin", "LogEvents" ],
32 order : '001-Pman.Tab.AdminLogEvents',
34 parent : 'Pman.Tab.AdminLogs',
35 name : "Admin - Logs - Events",
37 permname : 'Admin.Logs',
44 title : _this._strings['87f9f735a1d36793ceaecd4e47124b63'] /* Events */,
47 xtype : 'NestedLayoutPanel',
51 xtype : 'BorderLayout',
55 xtype : 'LayoutRegion'
63 xtype : 'LayoutRegion'
71 xtype : 'ContentPanel',
73 render : function (_self)
75 _this.viewPanel = _self;
85 title : _this._strings['87f9f735a1d36793ceaecd4e47124b63'] /* Events */,
90 activate : function() {
93 _this.grid.footer.onClick('first');
98 autoExpandColumn : 'remarks',
107 //_this.dialog = Pman.Dialog.FILL_IN
108 if (_this.panel.active) {
109 this.footer.onClick('first');
115 displayMsg : _this._strings['2ea72778ebaacc973260c88837dd7a2f'] /* Displaying Events {0} - {1} of {2} */,
116 emptyMsg : _this._strings['90e4ac2e5a22e53df63b6b186d8727ba'] /* No Events found */,
120 xtype : 'PagingToolbar',
123 text : _this._strings['01bd6a16732dfa2b760dc8566c58afae'] /* Download to Excel */,
125 '|xns' : 'Roo.Toolbar',
128 click : function (_self, e)
132 'sort' : 'event_when',
136 person_id : _this.personSel.getValue(),
137 'csvTitles[0]' : 'When', 'csvCols[0]' : 'event_when',
138 'csvTitles[1]' : 'Staff', 'csvCols[1]' : 'person_id_name',
139 'csvTitles[2]' : 'Action', 'csvCols[2]' : 'action',
140 'csvTitles[3]' : 'Record ID', 'csvCols[3]' : 'on_id' ,
141 'csvTitles[4]' : 'Record Type', 'csvCols[4]' : 'on_table',
142 'csvTitles[5]' : 'Remarks', 'csvCols[5]' : 'remarks'
145 params.person_id = _this.personSel.getValue();
146 var act = _this.actionSel.getValue();
150 var tbl = _this.affectSel.getValue();
152 params.on_table = tbl;
154 act = _this.dateFrom.getValue();
156 params['query[from]'] = act.format('Y-m-d');
158 act = _this.dateTo.getValue();
160 params['query[to]'] = act.format('Y-m-d');
166 url : baseURL + '/Roo/Events.php',
182 text : _this._strings['498f79c4c5bbde77f1bceb6c86fd0f6d'] /* Show */,
184 '|xns' : 'Roo.Toolbar',
190 displayField : 'value',
192 emptyText : _this._strings['037fd50b0e85bb65995ca7125d06c7cd'] /* Select Person Table */,
193 forceSelection : true,
195 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
197 name : 'person_table',
199 qtip : _this._strings['037fd50b0e85bb65995ca7125d06c7cd'] /* Select Person Table */,
200 selectOnFocus : true,
201 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{value}</b> </div>',
202 triggerAction : 'all',
204 valueField : 'value',
210 render : function (_self)
212 _this.tableSel = _self;
215 typeof(uiConfig) == 'undefined' ||
216 typeof(uiConfig.events_person_table) == 'undefined' ||
217 !uiConfig.events_person_table.length
223 select : function (combo, record, index)
225 _this.grid.footer.onClick('first');
231 if(typeof(uiConfig) == 'undefined' || typeof(uiConfig.events_person_table) == 'undefined' || !uiConfig.events_person_table.length){
236 return uiConfig.events_person_table;
239 fields : [ 'value' ],
243 xtype : 'SimpleStore'
248 displayField : 'name',
250 emptyText : _this._strings['fd7535ce3979bb8547e2c01689db0767'] /* Select Person */,
251 fieldLabel : _this._strings['42cf593b947cd3d591fa132742486f89'] /* Person */,
252 forceSelection : true,
254 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
256 name : 'person_id_name',
258 qtip : _this._strings['fd7535ce3979bb8547e2c01689db0767'] /* Select Person */,
259 queryParam : 'query[name]',
260 selectOnFocus : true,
261 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> ({company_id_name}) <{email}> </div>',
262 triggerAction : 'all',
270 render : function (_self)
272 _this.personSel = _self;
274 select : function (combo, record, index)
276 _this.grid.footer.onClick('first');
282 sortInfo : { field : 'name' , direction : 'ASC' },
287 beforeload : function (_self, o)
289 o.params = o.params || {};
290 o.params.company_id = Pman.Login.authUser.company_id;
295 url : baseURL + '/Roo/Person.php',
327 'name': 'company_id',
355 'name': 'no_reset_sent',
359 'name': 'action_type',
363 'name': 'project_id',
367 'name': 'deleted_by',
371 'name': 'deleted_dt',
373 'dateFormat': 'Y-m-d'
376 'name': 'office_id_id',
380 'name': 'office_id_company_id',
384 'name': 'office_id_name',
388 'name': 'office_id_address',
392 'name': 'office_id_phone',
396 'name': 'office_id_fax',
400 'name': 'office_id_email',
404 'name': 'office_id_role',
408 'name': 'company_id_code',
412 'name': 'company_id_name',
416 'name': 'company_id_remarks',
420 'name': 'company_id_owner_id',
424 'name': 'company_id_address',
428 'name': 'company_id_tel',
432 'name': 'company_id_fax',
436 'name': 'company_id_email',
440 'name': 'company_id_id',
444 'name': 'company_id_isOwner',
448 'name': 'company_id_logo_id',
452 'name': 'company_id_background_color',
456 'name': 'company_id_comptype',
460 'name': 'company_id_url',
464 'name': 'company_id_main_office_id',
468 'name': 'company_id_created_by',
472 'name': 'company_id_created_dt',
476 'name': 'company_id_updated_by',
480 'name': 'company_id_updated_dt',
484 'name': 'company_id_passwd',
488 'name': 'company_id_dispatch_port',
492 'name': 'company_id_province',
496 'name': 'company_id_country',
500 'name': 'project_id_id',
504 'name': 'project_id_name',
508 'name': 'project_id_remarks',
512 'name': 'project_id_owner_id',
516 'name': 'project_id_code',
520 'name': 'project_id_active',
524 'name': 'project_id_type',
528 'name': 'project_id_client_id',
532 'name': 'project_id_team_id',
536 'name': 'project_id_file_location',
540 'name': 'project_id_open_date',
544 'name': 'project_id_open_by',
548 'name': 'project_id_close_date',
552 'name': 'project_id_countries',
556 'name': 'project_id_languages',
560 'name': 'project_id_agency_id',
564 'name': 'owner_id_id',
568 'name': 'owner_id_office_id',
572 'name': 'owner_id_name',
576 'name': 'owner_id_phone',
580 'name': 'owner_id_fax',
584 'name': 'owner_id_email',
588 'name': 'owner_id_company_id',
592 'name': 'owner_id_role',
596 'name': 'owner_id_active',
600 'name': 'owner_id_remarks',
604 'name': 'owner_id_passwd',
608 'name': 'owner_id_owner_id',
612 'name': 'owner_id_lang',
616 'name': 'owner_id_no_reset_sent',
620 'name': 'owner_id_action_type',
624 'name': 'owner_id_project_id',
628 'name': 'owner_id_deleted_by',
632 'name': 'owner_id_deleted_dt',
638 totalProperty : 'total',
647 displayField : 'action',
649 emptyText : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
650 forceSelection : true,
652 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
656 qtip : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
657 queryParam : 'query[action]',
658 selectOnFocus : true,
659 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{action}</b> </div>',
660 triggerAction : 'all',
662 valueField : 'action',
668 render : function (_self)
670 _this.actionSel = _self;
672 select : function (combo, record, index)
674 _this.grid.footer.onClick('first');
679 sortInfo : { field : 'action' , direction : 'ASC' },
684 beforeload : function (_self, o)
686 o.params = o.params || {};
687 // staff can see all logs, other companies can only see their own.
688 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
689 o.params.company_id = Pman.Login.authUser.company_id;
691 o.params._distinct = 'action';
692 o.params._columns ='action';
697 url : baseURL + '/Roo/Events.php',
709 'name': 'person_name',
713 'name': 'event_when',
715 'dateFormat': 'Y-m-d'
742 'name': 'person_id_id',
746 'name': 'person_id_office_id',
750 'name': 'person_id_name',
754 'name': 'person_id_phone',
758 'name': 'person_id_fax',
762 'name': 'person_id_email',
766 'name': 'person_id_company_id',
770 'name': 'person_id_role',
774 'name': 'person_id_active',
778 'name': 'person_id_remarks',
782 'name': 'person_id_passwd',
786 'name': 'person_id_owner_id',
790 'name': 'person_id_lang',
794 'name': 'person_id_no_reset_sent',
798 'name': 'person_id_action_type',
802 'name': 'person_id_project_id',
806 'name': 'person_id_deleted_by',
810 'name': 'person_id_deleted_dt',
816 totalProperty : 'total',
825 displayField : 'on_table',
827 emptyText : _this._strings['679308a758de538c5f39c4c6cdba6593'] /* Select Affects */,
828 forceSelection : true,
830 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
834 qtip : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
835 queryParam : 'query[on_table]',
836 selectOnFocus : true,
837 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{on_table}</b> </div>',
838 triggerAction : 'all',
840 valueField : 'action',
846 render : function (_self)
848 _this.affectSel = _self;
850 if(!Pman.hasPerm('Admin.Logs_Affects', 'S')){
854 select : function (combo, record, index)
856 _this.grid.footer.onClick('first');
861 sortInfo : { field : 'on_table' , direction : 'ASC' },
866 beforeload : function (_self, o)
868 o.params = o.params || {};
869 // staff can see all logs, other companies can only see their own.
870 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
871 o.params.company_id = Pman.Login.authUser.company_id;
873 o.params._distinct = 'on_table';
874 o.params._columns ='on_table';
879 url : baseURL + '/Roo/Events.php',
891 'name': 'person_name',
895 'name': 'event_when',
897 'dateFormat': 'Y-m-d'
924 'name': 'person_id_id',
928 'name': 'person_id_office_id',
932 'name': 'person_id_name',
936 'name': 'person_id_phone',
940 'name': 'person_id_fax',
944 'name': 'person_id_email',
948 'name': 'person_id_company_id',
952 'name': 'person_id_role',
956 'name': 'person_id_active',
960 'name': 'person_id_remarks',
964 'name': 'person_id_passwd',
968 'name': 'person_id_owner_id',
972 'name': 'person_id_lang',
976 'name': 'person_id_no_reset_sent',
980 'name': 'person_id_action_type',
984 'name': 'person_id_project_id',
988 'name': 'person_id_deleted_by',
992 'name': 'person_id_deleted_dt',
998 totalProperty : 'total',
1000 '|xns' : 'Roo.data',
1001 xtype : 'JsonReader'
1006 text : _this._strings['39b9e051f9fe75e65c7a330bb00499d4'] /* Date Range */,
1008 '|xns' : 'Roo.Toolbar',
1014 '|xns' : 'Roo.form',
1015 xtype : 'DateField',
1017 change : function (_self, newValue, oldValue)
1019 _this.grid.footer.onClick('first');
1021 render : function (_self)
1023 _this.dateFrom = _self;
1030 '|xns' : 'Roo.form',
1031 xtype : 'DateField',
1033 change : function (_self, newValue, oldValue)
1035 _this.grid.footer.onClick('first');
1037 render : function (_self)
1039 _this.dateTo = _self;
1047 sortInfo : { field: 'event_when', direction: 'DESC'},
1049 '|xns' : 'Roo.data',
1052 beforeload : function (_self, o)
1054 if (!Pman.buildCompleted) {
1059 if (! _this.personSel) {
1062 o.params = o.params || {};
1063 o.params.person_id = _this.personSel.getValue();
1064 o.params.person_table = _this.tableSel.getValue();
1065 var act = _this.actionSel.getValue();
1067 o.params.action = act;
1069 var tbl = _this.affectSel.getValue();
1071 o.params.on_table = tbl;
1073 act = _this.dateFrom.getValue();
1075 o.params['query[from]'] = act.format('Y-m-d');
1077 act = _this.dateTo.getValue();
1079 o.params['query[to]'] = act.format('Y-m-d');
1084 act = _this.groupedCombo.getValue();
1085 o.params['query[grouped]'] = act;
1086 if (o.params['query[grouped]'] == 'gr') {
1089 Roo.MessageBox.alert("Error", "Select a table to group results on");
1092 // o.params['_columns'] =
1093 o.params['_distinct'] = 'on_id';
1105 url : baseURL + '/Roo/Events.php',
1107 '|xns' : 'Roo.data',
1117 'name': 'person_name',
1121 'name': 'event_when',
1123 'dateFormat': 'Y-m-d'
1142 'name': 'person_id',
1150 'name': 'person_id_id',
1154 'name': 'person_id_office_id',
1158 'name': 'person_id_name',
1162 'name': 'person_id_phone',
1166 'name': 'person_id_fax',
1170 'name': 'person_id_email',
1174 'name': 'person_id_company_id',
1178 'name': 'person_id_role',
1182 'name': 'person_id_active',
1186 'name': 'person_id_remarks',
1190 'name': 'person_id_passwd',
1194 'name': 'person_id_owner_id',
1198 'name': 'person_id_lang',
1202 'name': 'person_id_no_reset_sent',
1206 'name': 'person_id_action_type',
1210 'name': 'person_id_project_id',
1214 'name': 'person_id_deleted_by',
1218 'name': 'person_id_deleted_dt',
1224 totalProperty : 'total',
1226 '|xns' : 'Roo.data',
1227 xtype : 'JsonReader'
1231 singleSelect : true,
1233 '|xns' : 'Roo.grid',
1234 xtype : 'RowSelectionModel',
1236 afterselectionchange : function (_self)
1238 // load detail log in _this.viewPanel;
1239 if (!this.getSelected()) {
1240 this.viewPanel.setContent("Nothing Selected");
1243 var id = this.getSelected().data.id;
1244 _this.viewPanel.load( { url : baseURL + "/Admin/EventView/" + id + ".html" });
1251 dataIndex : 'event_when',
1252 header : _this._strings['4e97aeeaa8b15ca1180fcd1f3ac478d1'] /* When */,
1253 renderer : function(v) { return v ? v.dateFormat('d/m/Y H:i') : ''; },
1256 '|xns' : 'Roo.grid',
1257 xtype : 'ColumnModel'
1261 header : _this._strings['1b7f7d24575cdbfadb83b9587fa1bf97'] /* #id */,
1264 '|xns' : 'Roo.grid',
1265 xtype : 'ColumnModel'
1268 dataIndex : 'person_id_name',
1269 header : _this._strings['40bed7cf9b3d4bb3a3d7a7e3eb18c5eb'] /* Person */,
1270 renderer : function(v,x,r) {
1272 var ptable = _this.tableSel.getValue();
1274 var efield = 'person_id_email';
1275 var nfield = 'person_id_name';
1279 ptable != 'Person' &&
1280 typeof(r.data[ptable + '_id_email']) != 'undefined' &&
1281 typeof(r.data[ptable + '_id_name']) != 'undefined'
1283 efield = ptable + '_id_email';
1284 nfield = ptable + '_id_name';
1287 var email = r.data[efield]; // ? r.data.person_id_email : r.data.person_id_email;
1288 var name = r.data[nfield]; // ? r.data.person_id_name : r.data.person_id_name;
1289 return String.format('{0} <<a href="mailto:{1}">{1}</a>>',
1296 '|xns' : 'Roo.grid',
1297 xtype : 'ColumnModel'
1300 dataIndex : 'action',
1301 header : _this._strings['004bf6c9a40003140292e97330236c53'] /* Action */,
1302 renderer : function(v) { return String.format('{0}', v); },
1305 '|xns' : 'Roo.grid',
1306 xtype : 'ColumnModel'
1309 dataIndex : 'ipaddr',
1310 header : _this._strings['a12a3079e14ced46e69ba52b8a90b21a'] /* IP */,
1311 renderer : function(v) { return String.format('{0}', v); },
1314 '|xns' : 'Roo.grid',
1315 xtype : 'ColumnModel'
1318 dataIndex : 'on_table',
1319 header : _this._strings['2c92a9a6a5dbf570825e62eabcdecd8d'] /* Affected */,
1320 renderer : function(v, x, r) {
1321 return v ? String.format('{0}({1})', v, r.data.on_id) : '';
1325 '|xns' : 'Roo.grid',
1326 xtype : 'ColumnModel'
1329 dataIndex : 'remarks',
1330 header : _this._strings['231bc72756b5e6de492aaaa1577f61b1'] /* Remarks */,
1331 renderer : function(v) { return String.format('<span qtip="{1}">{0}</span>', v, Roo.util.Format.htmlEncode(v)); },
1334 '|xns' : 'Roo.grid',
1335 xtype : 'ColumnModel'