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',
175 text : _this._strings['01bd6a16732dfa2b760dc8566c58afae'] /* Download to Excel */,
177 '|xns' : 'Roo.Toolbar',
180 click : function (_self, e)
184 'sort' : 'event_when',
188 person_id : _this.personSel.getValue(),
189 'csvTitles[0]' : 'When', 'csvCols[0]' : 'event_when',
190 'csvTitles[1]' : 'Staff', 'csvCols[1]' : 'person_id_name',
191 'csvTitles[2]' : 'Action', 'csvCols[2]' : 'action',
192 'csvTitles[3]' : 'Record ID', 'csvCols[3]' : 'on_id' ,
193 'csvTitles[4]' : 'Record Type', 'csvCols[4]' : 'on_table',
194 'csvTitles[5]' : 'Remarks', 'csvCols[5]' : 'remarks'
197 params.person_id = _this.personSel.getValue();
198 var act = _this.actionSel.getValue();
202 var tbl = _this.affectSel.getValue();
204 params.on_table = tbl;
206 act = _this.dateFrom.getValue();
208 params['query[from]'] = act.format('Y-m-d');
210 act = _this.dateTo.getValue();
212 params['query[to]'] = act.format('Y-m-d');
218 url : baseURL + '/Roo/Events.php',
234 text : _this._strings['498f79c4c5bbde77f1bceb6c86fd0f6d'] /* Show */,
236 '|xns' : 'Roo.Toolbar',
242 displayField : 'value',
244 emptyText : _this._strings['037fd50b0e85bb65995ca7125d06c7cd'] /* Select Person Table */,
245 forceSelection : true,
247 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
249 name : 'person_table',
251 qtip : _this._strings['037fd50b0e85bb65995ca7125d06c7cd'] /* Select Person Table */,
252 selectOnFocus : true,
253 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{value}</b> </div>',
254 triggerAction : 'all',
256 valueField : 'value',
262 render : function (_self)
264 _this.tableSel = _self;
267 typeof(uiConfig) == 'undefined' ||
268 typeof(uiConfig.events_person_table) == 'undefined' ||
269 !uiConfig.events_person_table.length
275 select : function (combo, record, index)
277 _this.grid.footer.onClick('first');
283 if(typeof(uiConfig) == 'undefined' || typeof(uiConfig.events_person_table) == 'undefined' || !uiConfig.events_person_table.length){
288 return uiConfig.events_person_table;
291 fields : [ 'value' ],
295 xtype : 'SimpleStore'
300 displayField : 'name',
302 emptyText : _this._strings['fd7535ce3979bb8547e2c01689db0767'] /* Select Person */,
303 fieldLabel : _this._strings['42cf593b947cd3d591fa132742486f89'] /* Person */,
304 forceSelection : true,
306 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
308 name : 'person_id_name',
310 qtip : _this._strings['fd7535ce3979bb8547e2c01689db0767'] /* Select Person */,
311 queryParam : 'query[name]',
312 selectOnFocus : true,
313 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> ({company_id_name}) <{email}> </div>',
314 triggerAction : 'all',
322 render : function (_self)
324 _this.personSel = _self;
326 select : function (combo, record, index)
328 _this.grid.footer.onClick('first');
334 sortInfo : { field : 'name' , direction : 'ASC' },
339 beforeload : function (_self, o)
341 o.params = o.params || {};
342 o.params.company_id = Pman.Login.authUser.company_id;
347 url : baseURL + '/Roo/Person.php',
379 'name': 'company_id',
407 'name': 'no_reset_sent',
411 'name': 'action_type',
415 'name': 'project_id',
419 'name': 'deleted_by',
423 'name': 'deleted_dt',
425 'dateFormat': 'Y-m-d'
428 'name': 'office_id_id',
432 'name': 'office_id_company_id',
436 'name': 'office_id_name',
440 'name': 'office_id_address',
444 'name': 'office_id_phone',
448 'name': 'office_id_fax',
452 'name': 'office_id_email',
456 'name': 'office_id_role',
460 'name': 'company_id_code',
464 'name': 'company_id_name',
468 'name': 'company_id_remarks',
472 'name': 'company_id_owner_id',
476 'name': 'company_id_address',
480 'name': 'company_id_tel',
484 'name': 'company_id_fax',
488 'name': 'company_id_email',
492 'name': 'company_id_id',
496 'name': 'company_id_isOwner',
500 'name': 'company_id_logo_id',
504 'name': 'company_id_background_color',
508 'name': 'company_id_comptype',
512 'name': 'company_id_url',
516 'name': 'company_id_main_office_id',
520 'name': 'company_id_created_by',
524 'name': 'company_id_created_dt',
528 'name': 'company_id_updated_by',
532 'name': 'company_id_updated_dt',
536 'name': 'company_id_passwd',
540 'name': 'company_id_dispatch_port',
544 'name': 'company_id_province',
548 'name': 'company_id_country',
552 'name': 'project_id_id',
556 'name': 'project_id_name',
560 'name': 'project_id_remarks',
564 'name': 'project_id_owner_id',
568 'name': 'project_id_code',
572 'name': 'project_id_active',
576 'name': 'project_id_type',
580 'name': 'project_id_client_id',
584 'name': 'project_id_team_id',
588 'name': 'project_id_file_location',
592 'name': 'project_id_open_date',
596 'name': 'project_id_open_by',
600 'name': 'project_id_close_date',
604 'name': 'project_id_countries',
608 'name': 'project_id_languages',
612 'name': 'project_id_agency_id',
616 'name': 'owner_id_id',
620 'name': 'owner_id_office_id',
624 'name': 'owner_id_name',
628 'name': 'owner_id_phone',
632 'name': 'owner_id_fax',
636 'name': 'owner_id_email',
640 'name': 'owner_id_company_id',
644 'name': 'owner_id_role',
648 'name': 'owner_id_active',
652 'name': 'owner_id_remarks',
656 'name': 'owner_id_passwd',
660 'name': 'owner_id_owner_id',
664 'name': 'owner_id_lang',
668 'name': 'owner_id_no_reset_sent',
672 'name': 'owner_id_action_type',
676 'name': 'owner_id_project_id',
680 'name': 'owner_id_deleted_by',
684 'name': 'owner_id_deleted_dt',
690 totalProperty : 'total',
699 displayField : 'action',
701 emptyText : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
702 forceSelection : true,
704 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
708 qtip : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
709 queryParam : 'query[action]',
710 selectOnFocus : true,
711 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{action}</b> </div>',
712 triggerAction : 'all',
714 valueField : 'action',
720 render : function (_self)
722 _this.actionSel = _self;
724 select : function (combo, record, index)
726 _this.grid.footer.onClick('first');
731 sortInfo : { field : 'action' , direction : 'ASC' },
736 beforeload : function (_self, o)
738 o.params = o.params || {};
739 // staff can see all logs, other companies can only see their own.
740 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
741 o.params.company_id = Pman.Login.authUser.company_id;
743 o.params._distinct = 'action';
744 o.params._columns ='action';
749 url : baseURL + '/Roo/Events.php',
761 'name': 'person_name',
765 'name': 'event_when',
767 'dateFormat': 'Y-m-d'
794 'name': 'person_id_id',
798 'name': 'person_id_office_id',
802 'name': 'person_id_name',
806 'name': 'person_id_phone',
810 'name': 'person_id_fax',
814 'name': 'person_id_email',
818 'name': 'person_id_company_id',
822 'name': 'person_id_role',
826 'name': 'person_id_active',
830 'name': 'person_id_remarks',
834 'name': 'person_id_passwd',
838 'name': 'person_id_owner_id',
842 'name': 'person_id_lang',
846 'name': 'person_id_no_reset_sent',
850 'name': 'person_id_action_type',
854 'name': 'person_id_project_id',
858 'name': 'person_id_deleted_by',
862 'name': 'person_id_deleted_dt',
868 totalProperty : 'total',
877 displayField : 'on_table',
879 emptyText : _this._strings['679308a758de538c5f39c4c6cdba6593'] /* Select Affects */,
880 forceSelection : true,
882 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
886 qtip : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
887 queryParam : 'query[on_table]',
888 selectOnFocus : true,
889 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{on_table}</b> </div>',
890 triggerAction : 'all',
892 valueField : 'action',
898 render : function (_self)
900 _this.affectSel = _self;
902 if(!Pman.hasPerm('Admin.Logs_Affects', 'S')){
906 select : function (combo, record, index)
908 _this.grid.footer.onClick('first');
913 sortInfo : { field : 'on_table' , direction : 'ASC' },
918 beforeload : function (_self, o)
920 o.params = o.params || {};
921 // staff can see all logs, other companies can only see their own.
922 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
923 o.params.company_id = Pman.Login.authUser.company_id;
925 o.params._distinct = 'on_table';
926 o.params._columns ='on_table';
931 url : baseURL + '/Roo/Events.php',
943 'name': 'person_name',
947 'name': 'event_when',
949 'dateFormat': 'Y-m-d'
976 'name': 'person_id_id',
980 'name': 'person_id_office_id',
984 'name': 'person_id_name',
988 'name': 'person_id_phone',
992 'name': 'person_id_fax',
996 'name': 'person_id_email',
1000 'name': 'person_id_company_id',
1004 'name': 'person_id_role',
1008 'name': 'person_id_active',
1012 'name': 'person_id_remarks',
1016 'name': 'person_id_passwd',
1020 'name': 'person_id_owner_id',
1024 'name': 'person_id_lang',
1028 'name': 'person_id_no_reset_sent',
1032 'name': 'person_id_action_type',
1036 'name': 'person_id_project_id',
1040 'name': 'person_id_deleted_by',
1044 'name': 'person_id_deleted_dt',
1050 totalProperty : 'total',
1052 '|xns' : 'Roo.data',
1053 xtype : 'JsonReader'
1058 text : _this._strings['39b9e051f9fe75e65c7a330bb00499d4'] /* Date Range */,
1060 '|xns' : 'Roo.Toolbar',
1066 '|xns' : 'Roo.form',
1067 xtype : 'DateField',
1069 change : function (_self, newValue, oldValue)
1071 _this.grid.footer.onClick('first');
1073 render : function (_self)
1075 _this.dateFrom = _self;
1082 '|xns' : 'Roo.form',
1083 xtype : 'DateField',
1085 change : function (_self, newValue, oldValue)
1087 _this.grid.footer.onClick('first');
1089 render : function (_self)
1091 _this.dateTo = _self;
1099 sortInfo : { field: 'event_when', direction: 'DESC'},
1101 '|xns' : 'Roo.data',
1104 beforeload : function (_self, o)
1106 if (!Pman.buildCompleted) {
1111 if (! _this.personSel) {
1114 o.params = o.params || {};
1115 o.params.person_id = _this.personSel.getValue();
1116 o.params.person_table = _this.tableSel.getValue();
1117 var act = _this.actionSel.getValue();
1119 o.params.action = act;
1121 var tbl = _this.affectSel.getValue();
1123 o.params.on_table = tbl;
1125 act = _this.dateFrom.getValue();
1127 o.params['query[from]'] = act.format('Y-m-d');
1129 act = _this.dateTo.getValue();
1131 o.params['query[to]'] = act.format('Y-m-d');
1136 act = _this.groupedCombo.getValue();
1137 o.params['query[grouped]'] = act;
1138 if (o.params['query[grouped]'] == 'gr') {
1141 Roo.MessageBox.alert("Error", "Select a table to group results on");
1144 // o.params['_columns'] =
1145 o.params['_distinct'] = 'on_id';
1157 url : baseURL + '/Roo/Events.php',
1159 '|xns' : 'Roo.data',
1169 'name': 'person_name',
1173 'name': 'event_when',
1175 'dateFormat': 'Y-m-d'
1194 'name': 'person_id',
1202 'name': 'person_id_id',
1206 'name': 'person_id_office_id',
1210 'name': 'person_id_name',
1214 'name': 'person_id_phone',
1218 'name': 'person_id_fax',
1222 'name': 'person_id_email',
1226 'name': 'person_id_company_id',
1230 'name': 'person_id_role',
1234 'name': 'person_id_active',
1238 'name': 'person_id_remarks',
1242 'name': 'person_id_passwd',
1246 'name': 'person_id_owner_id',
1250 'name': 'person_id_lang',
1254 'name': 'person_id_no_reset_sent',
1258 'name': 'person_id_action_type',
1262 'name': 'person_id_project_id',
1266 'name': 'person_id_deleted_by',
1270 'name': 'person_id_deleted_dt',
1276 totalProperty : 'total',
1278 '|xns' : 'Roo.data',
1279 xtype : 'JsonReader'
1283 singleSelect : true,
1285 '|xns' : 'Roo.grid',
1286 xtype : 'RowSelectionModel',
1288 afterselectionchange : function (_self)
1290 // load detail log in _this.viewPanel;
1291 if (!this.getSelected()) {
1292 this.viewPanel.setContent("Nothing Selected");
1295 var id = this.getSelected().data.id;
1296 _this.viewPanel.load( { url : baseURL + "/Admin/EventView/" + id + ".html" });
1303 dataIndex : 'event_when',
1304 header : _this._strings['4e97aeeaa8b15ca1180fcd1f3ac478d1'] /* When */,
1305 renderer : function(v) { return v ? v.dateFormat('d/m/Y H:i') : ''; },
1308 '|xns' : 'Roo.grid',
1309 xtype : 'ColumnModel'
1313 header : _this._strings['1b7f7d24575cdbfadb83b9587fa1bf97'] /* #id */,
1316 '|xns' : 'Roo.grid',
1317 xtype : 'ColumnModel'
1320 dataIndex : 'person_id_name',
1321 header : _this._strings['40bed7cf9b3d4bb3a3d7a7e3eb18c5eb'] /* Person */,
1322 renderer : function(v,x,r) {
1324 var ptable = _this.tableSel.getValue();
1326 var efield = 'person_id_email';
1327 var nfield = 'person_id_name';
1331 ptable != 'Person' &&
1332 typeof(r.data[ptable + '_id_email']) != 'undefined' &&
1333 typeof(r.data[ptable + '_id_name']) != 'undefined'
1335 efield = ptable + '_id_email';
1336 nfield = ptable + '_id_name';
1339 var email = r.data[efield]; // ? r.data.person_id_email : r.data.person_id_email;
1340 var name = r.data[nfield]; // ? r.data.person_id_name : r.data.person_id_name;
1341 return String.format('{0} <<a href="mailto:{1}">{1}</a>>',
1348 '|xns' : 'Roo.grid',
1349 xtype : 'ColumnModel'
1352 dataIndex : 'action',
1353 header : _this._strings['004bf6c9a40003140292e97330236c53'] /* Action */,
1354 renderer : function(v) { return String.format('{0}', v); },
1357 '|xns' : 'Roo.grid',
1358 xtype : 'ColumnModel'
1361 dataIndex : 'ipaddr',
1362 header : _this._strings['a12a3079e14ced46e69ba52b8a90b21a'] /* IP */,
1363 renderer : function(v) { return String.format('{0}', v); },
1366 '|xns' : 'Roo.grid',
1367 xtype : 'ColumnModel'
1370 dataIndex : 'on_table',
1371 header : _this._strings['2c92a9a6a5dbf570825e62eabcdecd8d'] /* Affected */,
1372 renderer : function(v, x, r) {
1373 return v ? String.format('{0}({1})', v, r.data.on_id) : '';
1377 '|xns' : 'Roo.grid',
1378 xtype : 'ColumnModel'
1381 dataIndex : 'remarks',
1382 header : _this._strings['231bc72756b5e6de492aaaa1577f61b1'] /* Remarks */,
1383 renderer : function(v) { return String.format('<span qtip="{1}">{0}</span>', v, Roo.util.Format.htmlEncode(v)); },
1386 '|xns' : 'Roo.grid',
1387 xtype : 'ColumnModel'