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 'e4ef97f584a9c8d2d686f84569307575' :"Download to Excel (with extra descriptions)",
11 '231bc72756b5e6de492aaaa1577f61b1' :"Remarks",
12 '2ea72778ebaacc973260c88837dd7a2f' :"Displaying Events {0} - {1} of {2}",
13 '87f9f735a1d36793ceaecd4e47124b63' :"Events",
14 '1b7f7d24575cdbfadb83b9587fa1bf97' :"#id",
15 'a12a3079e14ced46e69ba52b8a90b21a' :"IP",
16 '1243daf593fa297e07ab03bf06d925af' :"Searching...",
17 '01bd6a16732dfa2b760dc8566c58afae' :"Download to Excel",
18 '498f79c4c5bbde77f1bceb6c86fd0f6d' :"Show",
19 '037fd50b0e85bb65995ca7125d06c7cd' :"Select Person Table",
20 '42cf593b947cd3d591fa132742486f89' :"Person ",
21 'fd7535ce3979bb8547e2c01689db0767' :"Select Person ",
22 '679308a758de538c5f39c4c6cdba6593' :"Select Affects",
23 'a8929eb5c1553d3f70497f862d25d0ce' :"Select Action",
24 '39b9e051f9fe75e65c7a330bb00499d4' :"Date Range",
25 '4e97aeeaa8b15ca1180fcd1f3ac478d1' :"When",
26 '40bed7cf9b3d4bb3a3d7a7e3eb18c5eb' :"Person",
27 '004bf6c9a40003140292e97330236c53' :"Action",
28 '2bd339d85ee3b33e513359ce781b60cc' :"Restore",
29 '90e4ac2e5a22e53df63b6b186d8727ba' :"No Events found",
30 '2c92a9a6a5dbf570825e62eabcdecd8d' :"Affected"
33 part : ["Admin", "LogEvents" ],
34 order : '001-Pman.Tab.AdminLogEvents',
36 parent : 'Pman.Tab.AdminLogs',
37 name : "Admin - Logs - Events",
39 permname : 'Admin.Logs',
46 title : _this._strings['87f9f735a1d36793ceaecd4e47124b63'] /* Events */,
49 xtype : 'NestedLayoutPanel',
53 xtype : 'BorderLayout',
57 xtype : 'LayoutRegion'
65 xtype : 'LayoutRegion'
73 xtype : 'ContentPanel',
75 render : function (_self)
77 _this.viewPanel = _self;
87 title : _this._strings['87f9f735a1d36793ceaecd4e47124b63'] /* Events */,
92 activate : function() {
95 _this.grid.footer.onClick('first');
100 autoExpandColumn : 'remarks',
109 //_this.dialog = Pman.Dialog.FILL_IN
110 if (_this.panel.active) {
111 this.footer.onClick('first');
117 displayMsg : _this._strings['2ea72778ebaacc973260c88837dd7a2f'] /* Displaying Events {0} - {1} of {2} */,
118 emptyMsg : _this._strings['90e4ac2e5a22e53df63b6b186d8727ba'] /* No Events found */,
122 xtype : 'PagingToolbar',
125 text : _this._strings['01bd6a16732dfa2b760dc8566c58afae'] /* Download to Excel */,
127 '|xns' : 'Roo.Toolbar',
130 click : function (_self, e)
134 'sort' : 'event_when',
138 person_id : _this.personSel.getValue(),
139 'csvTitles[0]' : 'When', 'csvCols[0]' : 'event_when',
140 'csvTitles[1]' : 'Staff', 'csvCols[1]' : 'person_id_name',
141 'csvTitles[2]' : 'Action', 'csvCols[2]' : 'action',
142 'csvTitles[3]' : 'Record ID', 'csvCols[3]' : 'on_id' ,
143 'csvTitles[4]' : 'Record Type', 'csvCols[4]' : 'on_table',
144 'csvTitles[5]' : 'Remarks', 'csvCols[5]' : 'remarks'
147 params.person_id = _this.personSel.getValue();
148 var act = _this.actionSel.getValue();
152 var tbl = _this.affectSel.getValue();
154 params.on_table = tbl;
156 act = _this.dateFrom.getValue();
158 params['query[from]'] = act.format('Y-m-d');
160 act = _this.dateTo.getValue();
162 params['query[to]'] = act.format('Y-m-d');
168 url : baseURL + '/Roo/Events.php',
177 text : _this._strings['e4ef97f584a9c8d2d686f84569307575'] /* Download to Excel (with extra descriptions) */,
179 '|xns' : 'Roo.Toolbar',
182 click : function (_self, e)
186 'sort' : 'event_when',
190 person_id : _this.personSel.getValue(),
191 'csvTitles[0]' : 'ID#', 'csvCols[0]' : 'id',
192 'csvTitles[1]' : 'When', 'csvCols[1]' : 'event_when',
193 'csvTitles[2]' : 'Staff', 'csvCols[2]' : 'person_id_name',
194 'csvTitles[3]' : 'Action', 'csvCols[3]' : 'action',
195 'csvTitles[4]' : 'Record ID', 'csvCols[4]' : 'on_id' ,
196 'csvTitles[5]' : 'Record Type', 'csvCols[5]' : 'on_table',
197 'csvTitles[6]' : 'Remarks', 'csvCols[6]' : 'remarks'
199 params._with_obj_summary = 1;
200 params.person_id = _this.personSel.getValue();
201 var act = _this.actionSel.getValue();
205 var tbl = _this.affectSel.getValue();
207 params.on_table = tbl;
209 act = _this.dateFrom.getValue();
211 params['query[from]'] = act.format('Y-m-d');
213 act = _this.dateTo.getValue();
215 params['query[to]'] = act.format('Y-m-d');
221 url : baseURL + '/Roo/Events.php',
231 '|xns' : 'Roo.Toolbar',
235 cls : 'x-btn-text-icon',
236 icon : Roo.rootURL + 'images/default/tree/leaf.gif',
237 text : _this._strings['2bd339d85ee3b33e513359ce781b60cc'] /* Restore */,
239 '|xns' : 'Roo.Toolbar',
244 var s = _this.grid.getSelectionModel().getSelected();
246 if(!s || s.data.id * 1 < 1){
247 Roo.MessageBox.alert('Error', 'Please select a deleted person');
261 text : _this._strings['498f79c4c5bbde77f1bceb6c86fd0f6d'] /* Show */,
263 '|xns' : 'Roo.Toolbar',
269 displayField : 'value',
271 emptyText : _this._strings['037fd50b0e85bb65995ca7125d06c7cd'] /* Select Person Table */,
272 forceSelection : true,
274 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
276 name : 'person_table',
278 qtip : _this._strings['037fd50b0e85bb65995ca7125d06c7cd'] /* Select Person Table */,
279 selectOnFocus : true,
280 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{value}</b> </div>',
281 triggerAction : 'all',
283 valueField : 'value',
289 render : function (_self)
291 _this.tableSel = _self;
294 typeof(uiConfig) == 'undefined' ||
295 typeof(uiConfig.events_person_table) == 'undefined' ||
296 !uiConfig.events_person_table.length
302 select : function (combo, record, index)
304 _this.grid.footer.onClick('first');
310 if(typeof(uiConfig) == 'undefined' || typeof(uiConfig.events_person_table) == 'undefined' || !uiConfig.events_person_table.length){
315 return uiConfig.events_person_table;
318 fields : [ 'value' ],
322 xtype : 'SimpleStore'
327 displayField : 'name',
329 emptyText : _this._strings['fd7535ce3979bb8547e2c01689db0767'] /* Select Person */,
330 fieldLabel : _this._strings['42cf593b947cd3d591fa132742486f89'] /* Person */,
331 forceSelection : true,
333 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
335 name : 'person_id_name',
337 qtip : _this._strings['fd7535ce3979bb8547e2c01689db0767'] /* Select Person */,
338 queryParam : 'query[name]',
339 selectOnFocus : true,
340 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> ({company_id_name}) <{email}> </div>',
341 triggerAction : 'all',
349 render : function (_self)
351 _this.personSel = _self;
353 select : function (combo, record, index)
355 _this.grid.footer.onClick('first');
361 sortInfo : { field : 'name' , direction : 'ASC' },
366 beforeload : function (_self, o)
368 o.params = o.params || {};
369 o.params.company_id = Pman.Login.authUser.company_id;
374 url : baseURL + '/Roo/Person.php',
406 'name': 'company_id',
434 'name': 'no_reset_sent',
438 'name': 'action_type',
442 'name': 'project_id',
446 'name': 'deleted_by',
450 'name': 'deleted_dt',
452 'dateFormat': 'Y-m-d'
455 'name': 'office_id_id',
459 'name': 'office_id_company_id',
463 'name': 'office_id_name',
467 'name': 'office_id_address',
471 'name': 'office_id_phone',
475 'name': 'office_id_fax',
479 'name': 'office_id_email',
483 'name': 'office_id_role',
487 'name': 'company_id_code',
491 'name': 'company_id_name',
495 'name': 'company_id_remarks',
499 'name': 'company_id_owner_id',
503 'name': 'company_id_address',
507 'name': 'company_id_tel',
511 'name': 'company_id_fax',
515 'name': 'company_id_email',
519 'name': 'company_id_id',
523 'name': 'company_id_isOwner',
527 'name': 'company_id_logo_id',
531 'name': 'company_id_background_color',
535 'name': 'company_id_comptype',
539 'name': 'company_id_url',
543 'name': 'company_id_main_office_id',
547 'name': 'company_id_created_by',
551 'name': 'company_id_created_dt',
555 'name': 'company_id_updated_by',
559 'name': 'company_id_updated_dt',
563 'name': 'company_id_passwd',
567 'name': 'company_id_dispatch_port',
571 'name': 'company_id_province',
575 'name': 'company_id_country',
579 'name': 'project_id_id',
583 'name': 'project_id_name',
587 'name': 'project_id_remarks',
591 'name': 'project_id_owner_id',
595 'name': 'project_id_code',
599 'name': 'project_id_active',
603 'name': 'project_id_type',
607 'name': 'project_id_client_id',
611 'name': 'project_id_team_id',
615 'name': 'project_id_file_location',
619 'name': 'project_id_open_date',
623 'name': 'project_id_open_by',
627 'name': 'project_id_close_date',
631 'name': 'project_id_countries',
635 'name': 'project_id_languages',
639 'name': 'project_id_agency_id',
643 'name': 'owner_id_id',
647 'name': 'owner_id_office_id',
651 'name': 'owner_id_name',
655 'name': 'owner_id_phone',
659 'name': 'owner_id_fax',
663 'name': 'owner_id_email',
667 'name': 'owner_id_company_id',
671 'name': 'owner_id_role',
675 'name': 'owner_id_active',
679 'name': 'owner_id_remarks',
683 'name': 'owner_id_passwd',
687 'name': 'owner_id_owner_id',
691 'name': 'owner_id_lang',
695 'name': 'owner_id_no_reset_sent',
699 'name': 'owner_id_action_type',
703 'name': 'owner_id_project_id',
707 'name': 'owner_id_deleted_by',
711 'name': 'owner_id_deleted_dt',
717 totalProperty : 'total',
726 displayField : 'action',
728 emptyText : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
729 forceSelection : true,
731 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
735 qtip : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
736 queryParam : 'query[action]',
737 selectOnFocus : true,
738 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{action}</b> </div>',
739 triggerAction : 'all',
741 valueField : 'action',
747 render : function (_self)
749 _this.actionSel = _self;
751 select : function (combo, record, index)
753 _this.grid.footer.onClick('first');
758 sortInfo : { field : 'action' , direction : 'ASC' },
763 beforeload : function (_self, o)
765 o.params = o.params || {};
766 // staff can see all logs, other companies can only see their own.
767 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
768 o.params.company_id = Pman.Login.authUser.company_id;
770 o.params._distinct = 'action';
771 o.params._columns ='action';
776 url : baseURL + '/Roo/Events.php',
788 'name': 'person_name',
792 'name': 'event_when',
794 'dateFormat': 'Y-m-d'
821 'name': 'person_id_id',
825 'name': 'person_id_office_id',
829 'name': 'person_id_name',
833 'name': 'person_id_phone',
837 'name': 'person_id_fax',
841 'name': 'person_id_email',
845 'name': 'person_id_company_id',
849 'name': 'person_id_role',
853 'name': 'person_id_active',
857 'name': 'person_id_remarks',
861 'name': 'person_id_passwd',
865 'name': 'person_id_owner_id',
869 'name': 'person_id_lang',
873 'name': 'person_id_no_reset_sent',
877 'name': 'person_id_action_type',
881 'name': 'person_id_project_id',
885 'name': 'person_id_deleted_by',
889 'name': 'person_id_deleted_dt',
895 totalProperty : 'total',
904 displayField : 'on_table',
906 emptyText : _this._strings['679308a758de538c5f39c4c6cdba6593'] /* Select Affects */,
907 forceSelection : true,
909 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
913 qtip : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
914 queryParam : 'query[on_table]',
915 selectOnFocus : true,
916 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{on_table}</b> </div>',
917 triggerAction : 'all',
919 valueField : 'action',
925 render : function (_self)
927 _this.affectSel = _self;
929 if(!Pman.hasPerm('Admin.Logs_Affects', 'S')){
933 select : function (combo, record, index)
935 _this.grid.footer.onClick('first');
940 sortInfo : { field : 'on_table' , direction : 'ASC' },
945 beforeload : function (_self, o)
947 o.params = o.params || {};
948 // staff can see all logs, other companies can only see their own.
949 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
950 o.params.company_id = Pman.Login.authUser.company_id;
952 o.params._distinct = 'on_table';
953 o.params._columns ='on_table';
958 url : baseURL + '/Roo/Events.php',
970 'name': 'person_name',
974 'name': 'event_when',
976 'dateFormat': 'Y-m-d'
1003 'name': 'person_id_id',
1007 'name': 'person_id_office_id',
1011 'name': 'person_id_name',
1015 'name': 'person_id_phone',
1019 'name': 'person_id_fax',
1023 'name': 'person_id_email',
1027 'name': 'person_id_company_id',
1031 'name': 'person_id_role',
1035 'name': 'person_id_active',
1039 'name': 'person_id_remarks',
1043 'name': 'person_id_passwd',
1047 'name': 'person_id_owner_id',
1051 'name': 'person_id_lang',
1055 'name': 'person_id_no_reset_sent',
1059 'name': 'person_id_action_type',
1063 'name': 'person_id_project_id',
1067 'name': 'person_id_deleted_by',
1071 'name': 'person_id_deleted_dt',
1077 totalProperty : 'total',
1079 '|xns' : 'Roo.data',
1080 xtype : 'JsonReader'
1085 text : _this._strings['39b9e051f9fe75e65c7a330bb00499d4'] /* Date Range */,
1087 '|xns' : 'Roo.Toolbar',
1093 '|xns' : 'Roo.form',
1094 xtype : 'DateField',
1096 change : function (_self, newValue, oldValue)
1098 _this.grid.footer.onClick('first');
1100 render : function (_self)
1102 _this.dateFrom = _self;
1109 '|xns' : 'Roo.form',
1110 xtype : 'DateField',
1112 change : function (_self, newValue, oldValue)
1114 _this.grid.footer.onClick('first');
1116 render : function (_self)
1118 _this.dateTo = _self;
1126 sortInfo : { field: 'event_when', direction: 'DESC'},
1128 '|xns' : 'Roo.data',
1131 beforeload : function (_self, o)
1133 if (!Pman.buildCompleted) {
1138 if (! _this.personSel) {
1141 o.params = o.params || {};
1142 o.params.person_id = _this.personSel.getValue();
1143 o.params.person_table = _this.tableSel.getValue();
1144 var act = _this.actionSel.getValue();
1146 o.params.action = act;
1148 var tbl = _this.affectSel.getValue();
1150 o.params.on_table = tbl;
1152 act = _this.dateFrom.getValue();
1154 o.params['query[from]'] = act.format('Y-m-d');
1156 act = _this.dateTo.getValue();
1158 o.params['query[to]'] = act.format('Y-m-d');
1163 act = _this.groupedCombo.getValue();
1164 o.params['query[grouped]'] = act;
1165 if (o.params['query[grouped]'] == 'gr') {
1168 Roo.MessageBox.alert("Error", "Select a table to group results on");
1171 // o.params['_columns'] =
1172 o.params['_distinct'] = 'on_id';
1184 url : baseURL + '/Roo/Events.php',
1186 '|xns' : 'Roo.data',
1196 'name': 'person_name',
1200 'name': 'event_when',
1202 'dateFormat': 'Y-m-d'
1221 'name': 'person_id',
1229 'name': 'person_id_id',
1233 'name': 'person_id_office_id',
1237 'name': 'person_id_name',
1241 'name': 'person_id_phone',
1245 'name': 'person_id_fax',
1249 'name': 'person_id_email',
1253 'name': 'person_id_company_id',
1257 'name': 'person_id_role',
1261 'name': 'person_id_active',
1265 'name': 'person_id_remarks',
1269 'name': 'person_id_passwd',
1273 'name': 'person_id_owner_id',
1277 'name': 'person_id_lang',
1281 'name': 'person_id_no_reset_sent',
1285 'name': 'person_id_action_type',
1289 'name': 'person_id_project_id',
1293 'name': 'person_id_deleted_by',
1297 'name': 'person_id_deleted_dt',
1303 totalProperty : 'total',
1305 '|xns' : 'Roo.data',
1306 xtype : 'JsonReader'
1310 singleSelect : true,
1312 '|xns' : 'Roo.grid',
1313 xtype : 'RowSelectionModel',
1315 afterselectionchange : function (_self)
1317 // load detail log in _this.viewPanel;
1318 if (!this.getSelected()) {
1319 this.viewPanel.setContent("Nothing Selected");
1322 var id = this.getSelected().data.id;
1323 _this.viewPanel.load( { url : baseURL + "/Admin/EventView/" + id + ".html" });
1330 dataIndex : 'event_when',
1331 header : _this._strings['4e97aeeaa8b15ca1180fcd1f3ac478d1'] /* When */,
1332 renderer : function(v) { return v ? v.dateFormat('d/m/Y H:i') : ''; },
1335 '|xns' : 'Roo.grid',
1336 xtype : 'ColumnModel'
1340 header : _this._strings['1b7f7d24575cdbfadb83b9587fa1bf97'] /* #id */,
1343 '|xns' : 'Roo.grid',
1344 xtype : 'ColumnModel'
1347 dataIndex : 'person_id_name',
1348 header : _this._strings['40bed7cf9b3d4bb3a3d7a7e3eb18c5eb'] /* Person */,
1349 renderer : function(v,x,r) {
1351 var ptable = _this.tableSel.getValue();
1353 var efield = 'person_id_email';
1354 var nfield = 'person_id_name';
1358 ptable != 'Person' &&
1359 typeof(r.data[ptable + '_id_email']) != 'undefined' &&
1360 typeof(r.data[ptable + '_id_name']) != 'undefined'
1362 efield = ptable + '_id_email';
1363 nfield = ptable + '_id_name';
1366 var email = r.data[efield]; // ? r.data.person_id_email : r.data.person_id_email;
1367 var name = r.data[nfield]; // ? r.data.person_id_name : r.data.person_id_name;
1368 return String.format('{0} <<a href="mailto:{1}">{1}</a>>',
1375 '|xns' : 'Roo.grid',
1376 xtype : 'ColumnModel'
1379 dataIndex : 'action',
1380 header : _this._strings['004bf6c9a40003140292e97330236c53'] /* Action */,
1381 renderer : function(v) { return String.format('{0}', v); },
1384 '|xns' : 'Roo.grid',
1385 xtype : 'ColumnModel'
1388 dataIndex : 'ipaddr',
1389 header : _this._strings['a12a3079e14ced46e69ba52b8a90b21a'] /* IP */,
1390 renderer : function(v) { return String.format('{0}', v); },
1393 '|xns' : 'Roo.grid',
1394 xtype : 'ColumnModel'
1397 dataIndex : 'on_table',
1398 header : _this._strings['2c92a9a6a5dbf570825e62eabcdecd8d'] /* Affected */,
1399 renderer : function(v, x, r) {
1400 return v ? String.format('{0}({1})', v, r.data.on_id) : '';
1404 '|xns' : 'Roo.grid',
1405 xtype : 'ColumnModel'
1408 dataIndex : 'remarks',
1409 header : _this._strings['231bc72756b5e6de492aaaa1577f61b1'] /* Remarks */,
1410 renderer : function(v) { return String.format('<span qtip="{1}">{0}</span>', v, Roo.util.Format.htmlEncode(v)); },
1413 '|xns' : 'Roo.grid',
1414 xtype : 'ColumnModel'