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 || s.data.action != 'DELETE'){
247 Roo.MessageBox.alert('Error', 'Please select a deleted person');
252 url: baseURL + '/Roo/Events',
258 success : function(ret) {
273 text : _this._strings['498f79c4c5bbde77f1bceb6c86fd0f6d'] /* Show */,
275 '|xns' : 'Roo.Toolbar',
281 displayField : 'value',
283 emptyText : _this._strings['037fd50b0e85bb65995ca7125d06c7cd'] /* Select Person Table */,
284 forceSelection : true,
286 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
288 name : 'person_table',
290 qtip : _this._strings['037fd50b0e85bb65995ca7125d06c7cd'] /* Select Person Table */,
291 selectOnFocus : true,
292 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{value}</b> </div>',
293 triggerAction : 'all',
295 valueField : 'value',
301 render : function (_self)
303 _this.tableSel = _self;
306 typeof(uiConfig) == 'undefined' ||
307 typeof(uiConfig.events_person_table) == 'undefined' ||
308 !uiConfig.events_person_table.length
314 select : function (combo, record, index)
316 _this.grid.footer.onClick('first');
322 if(typeof(uiConfig) == 'undefined' || typeof(uiConfig.events_person_table) == 'undefined' || !uiConfig.events_person_table.length){
327 return uiConfig.events_person_table;
330 fields : [ 'value' ],
334 xtype : 'SimpleStore'
339 displayField : 'name',
341 emptyText : _this._strings['fd7535ce3979bb8547e2c01689db0767'] /* Select Person */,
342 fieldLabel : _this._strings['42cf593b947cd3d591fa132742486f89'] /* Person */,
343 forceSelection : true,
345 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
347 name : 'person_id_name',
349 qtip : _this._strings['fd7535ce3979bb8547e2c01689db0767'] /* Select Person */,
350 queryParam : 'query[name]',
351 selectOnFocus : true,
352 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> ({company_id_name}) <{email}> </div>',
353 triggerAction : 'all',
361 render : function (_self)
363 _this.personSel = _self;
365 select : function (combo, record, index)
367 _this.grid.footer.onClick('first');
373 sortInfo : { field : 'name' , direction : 'ASC' },
378 beforeload : function (_self, o)
380 o.params = o.params || {};
381 o.params.company_id = Pman.Login.authUser.company_id;
386 url : baseURL + '/Roo/Person.php',
418 'name': 'company_id',
446 'name': 'no_reset_sent',
450 'name': 'action_type',
454 'name': 'project_id',
458 'name': 'deleted_by',
462 'name': 'deleted_dt',
464 'dateFormat': 'Y-m-d'
467 'name': 'office_id_id',
471 'name': 'office_id_company_id',
475 'name': 'office_id_name',
479 'name': 'office_id_address',
483 'name': 'office_id_phone',
487 'name': 'office_id_fax',
491 'name': 'office_id_email',
495 'name': 'office_id_role',
499 'name': 'company_id_code',
503 'name': 'company_id_name',
507 'name': 'company_id_remarks',
511 'name': 'company_id_owner_id',
515 'name': 'company_id_address',
519 'name': 'company_id_tel',
523 'name': 'company_id_fax',
527 'name': 'company_id_email',
531 'name': 'company_id_id',
535 'name': 'company_id_isOwner',
539 'name': 'company_id_logo_id',
543 'name': 'company_id_background_color',
547 'name': 'company_id_comptype',
551 'name': 'company_id_url',
555 'name': 'company_id_main_office_id',
559 'name': 'company_id_created_by',
563 'name': 'company_id_created_dt',
567 'name': 'company_id_updated_by',
571 'name': 'company_id_updated_dt',
575 'name': 'company_id_passwd',
579 'name': 'company_id_dispatch_port',
583 'name': 'company_id_province',
587 'name': 'company_id_country',
591 'name': 'project_id_id',
595 'name': 'project_id_name',
599 'name': 'project_id_remarks',
603 'name': 'project_id_owner_id',
607 'name': 'project_id_code',
611 'name': 'project_id_active',
615 'name': 'project_id_type',
619 'name': 'project_id_client_id',
623 'name': 'project_id_team_id',
627 'name': 'project_id_file_location',
631 'name': 'project_id_open_date',
635 'name': 'project_id_open_by',
639 'name': 'project_id_close_date',
643 'name': 'project_id_countries',
647 'name': 'project_id_languages',
651 'name': 'project_id_agency_id',
655 'name': 'owner_id_id',
659 'name': 'owner_id_office_id',
663 'name': 'owner_id_name',
667 'name': 'owner_id_phone',
671 'name': 'owner_id_fax',
675 'name': 'owner_id_email',
679 'name': 'owner_id_company_id',
683 'name': 'owner_id_role',
687 'name': 'owner_id_active',
691 'name': 'owner_id_remarks',
695 'name': 'owner_id_passwd',
699 'name': 'owner_id_owner_id',
703 'name': 'owner_id_lang',
707 'name': 'owner_id_no_reset_sent',
711 'name': 'owner_id_action_type',
715 'name': 'owner_id_project_id',
719 'name': 'owner_id_deleted_by',
723 'name': 'owner_id_deleted_dt',
729 totalProperty : 'total',
738 displayField : 'action',
740 emptyText : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
741 forceSelection : true,
743 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
747 qtip : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
748 queryParam : 'query[action]',
749 selectOnFocus : true,
750 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{action}</b> </div>',
751 triggerAction : 'all',
753 valueField : 'action',
759 render : function (_self)
761 _this.actionSel = _self;
763 select : function (combo, record, index)
765 _this.grid.footer.onClick('first');
770 sortInfo : { field : 'action' , direction : 'ASC' },
775 beforeload : function (_self, o)
777 o.params = o.params || {};
778 // staff can see all logs, other companies can only see their own.
779 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
780 o.params.company_id = Pman.Login.authUser.company_id;
782 o.params._distinct = 'action';
783 o.params._columns ='action';
788 url : baseURL + '/Roo/Events.php',
800 'name': 'person_name',
804 'name': 'event_when',
806 'dateFormat': 'Y-m-d'
833 'name': 'person_id_id',
837 'name': 'person_id_office_id',
841 'name': 'person_id_name',
845 'name': 'person_id_phone',
849 'name': 'person_id_fax',
853 'name': 'person_id_email',
857 'name': 'person_id_company_id',
861 'name': 'person_id_role',
865 'name': 'person_id_active',
869 'name': 'person_id_remarks',
873 'name': 'person_id_passwd',
877 'name': 'person_id_owner_id',
881 'name': 'person_id_lang',
885 'name': 'person_id_no_reset_sent',
889 'name': 'person_id_action_type',
893 'name': 'person_id_project_id',
897 'name': 'person_id_deleted_by',
901 'name': 'person_id_deleted_dt',
907 totalProperty : 'total',
916 displayField : 'on_table',
918 emptyText : _this._strings['679308a758de538c5f39c4c6cdba6593'] /* Select Affects */,
919 forceSelection : true,
921 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
925 qtip : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
926 queryParam : 'query[on_table]',
927 selectOnFocus : true,
928 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{on_table}</b> </div>',
929 triggerAction : 'all',
931 valueField : 'action',
937 render : function (_self)
939 _this.affectSel = _self;
941 if(!Pman.hasPerm('Admin.Logs_Affects', 'S')){
945 select : function (combo, record, index)
947 _this.grid.footer.onClick('first');
952 sortInfo : { field : 'on_table' , direction : 'ASC' },
957 beforeload : function (_self, o)
959 o.params = o.params || {};
960 // staff can see all logs, other companies can only see their own.
961 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
962 o.params.company_id = Pman.Login.authUser.company_id;
964 o.params._distinct = 'on_table';
965 o.params._columns ='on_table';
970 url : baseURL + '/Roo/Events.php',
982 'name': 'person_name',
986 'name': 'event_when',
988 'dateFormat': 'Y-m-d'
1007 'name': 'person_id',
1015 'name': 'person_id_id',
1019 'name': 'person_id_office_id',
1023 'name': 'person_id_name',
1027 'name': 'person_id_phone',
1031 'name': 'person_id_fax',
1035 'name': 'person_id_email',
1039 'name': 'person_id_company_id',
1043 'name': 'person_id_role',
1047 'name': 'person_id_active',
1051 'name': 'person_id_remarks',
1055 'name': 'person_id_passwd',
1059 'name': 'person_id_owner_id',
1063 'name': 'person_id_lang',
1067 'name': 'person_id_no_reset_sent',
1071 'name': 'person_id_action_type',
1075 'name': 'person_id_project_id',
1079 'name': 'person_id_deleted_by',
1083 'name': 'person_id_deleted_dt',
1089 totalProperty : 'total',
1091 '|xns' : 'Roo.data',
1092 xtype : 'JsonReader'
1097 text : _this._strings['39b9e051f9fe75e65c7a330bb00499d4'] /* Date Range */,
1099 '|xns' : 'Roo.Toolbar',
1105 '|xns' : 'Roo.form',
1106 xtype : 'DateField',
1108 change : function (_self, newValue, oldValue)
1110 _this.grid.footer.onClick('first');
1112 render : function (_self)
1114 _this.dateFrom = _self;
1121 '|xns' : 'Roo.form',
1122 xtype : 'DateField',
1124 change : function (_self, newValue, oldValue)
1126 _this.grid.footer.onClick('first');
1128 render : function (_self)
1130 _this.dateTo = _self;
1138 sortInfo : { field: 'event_when', direction: 'DESC'},
1140 '|xns' : 'Roo.data',
1143 beforeload : function (_self, o)
1145 if (!Pman.buildCompleted) {
1150 if (! _this.personSel) {
1153 o.params = o.params || {};
1154 o.params.person_id = _this.personSel.getValue();
1155 o.params.person_table = _this.tableSel.getValue();
1156 var act = _this.actionSel.getValue();
1158 o.params.action = act;
1160 var tbl = _this.affectSel.getValue();
1162 o.params.on_table = tbl;
1164 act = _this.dateFrom.getValue();
1166 o.params['query[from]'] = act.format('Y-m-d');
1168 act = _this.dateTo.getValue();
1170 o.params['query[to]'] = act.format('Y-m-d');
1175 act = _this.groupedCombo.getValue();
1176 o.params['query[grouped]'] = act;
1177 if (o.params['query[grouped]'] == 'gr') {
1180 Roo.MessageBox.alert("Error", "Select a table to group results on");
1183 // o.params['_columns'] =
1184 o.params['_distinct'] = 'on_id';
1196 url : baseURL + '/Roo/Events.php',
1198 '|xns' : 'Roo.data',
1208 'name': 'person_name',
1212 'name': 'event_when',
1214 'dateFormat': 'Y-m-d'
1233 'name': 'person_id',
1241 'name': 'person_id_id',
1245 'name': 'person_id_office_id',
1249 'name': 'person_id_name',
1253 'name': 'person_id_phone',
1257 'name': 'person_id_fax',
1261 'name': 'person_id_email',
1265 'name': 'person_id_company_id',
1269 'name': 'person_id_role',
1273 'name': 'person_id_active',
1277 'name': 'person_id_remarks',
1281 'name': 'person_id_passwd',
1285 'name': 'person_id_owner_id',
1289 'name': 'person_id_lang',
1293 'name': 'person_id_no_reset_sent',
1297 'name': 'person_id_action_type',
1301 'name': 'person_id_project_id',
1305 'name': 'person_id_deleted_by',
1309 'name': 'person_id_deleted_dt',
1315 totalProperty : 'total',
1317 '|xns' : 'Roo.data',
1318 xtype : 'JsonReader'
1322 singleSelect : true,
1324 '|xns' : 'Roo.grid',
1325 xtype : 'RowSelectionModel',
1327 afterselectionchange : function (_self)
1329 // load detail log in _this.viewPanel;
1330 if (!this.getSelected()) {
1331 this.viewPanel.setContent("Nothing Selected");
1334 var id = this.getSelected().data.id;
1335 _this.viewPanel.load( { url : baseURL + "/Admin/EventView/" + id + ".html" });
1342 dataIndex : 'event_when',
1343 header : _this._strings['4e97aeeaa8b15ca1180fcd1f3ac478d1'] /* When */,
1344 renderer : function(v) { return v ? v.dateFormat('d/m/Y H:i') : ''; },
1347 '|xns' : 'Roo.grid',
1348 xtype : 'ColumnModel'
1352 header : _this._strings['1b7f7d24575cdbfadb83b9587fa1bf97'] /* #id */,
1355 '|xns' : 'Roo.grid',
1356 xtype : 'ColumnModel'
1359 dataIndex : 'person_id_name',
1360 header : _this._strings['40bed7cf9b3d4bb3a3d7a7e3eb18c5eb'] /* Person */,
1361 renderer : function(v,x,r) {
1363 var ptable = _this.tableSel.getValue();
1365 var efield = 'person_id_email';
1366 var nfield = 'person_id_name';
1370 ptable != 'Person' &&
1371 typeof(r.data[ptable + '_id_email']) != 'undefined' &&
1372 typeof(r.data[ptable + '_id_name']) != 'undefined'
1374 efield = ptable + '_id_email';
1375 nfield = ptable + '_id_name';
1378 var email = r.data[efield]; // ? r.data.person_id_email : r.data.person_id_email;
1379 var name = r.data[nfield]; // ? r.data.person_id_name : r.data.person_id_name;
1380 return String.format('{0} <<a href="mailto:{1}">{1}</a>>',
1387 '|xns' : 'Roo.grid',
1388 xtype : 'ColumnModel'
1391 dataIndex : 'action',
1392 header : _this._strings['004bf6c9a40003140292e97330236c53'] /* Action */,
1393 renderer : function(v) { return String.format('{0}', v); },
1396 '|xns' : 'Roo.grid',
1397 xtype : 'ColumnModel'
1400 dataIndex : 'ipaddr',
1401 header : _this._strings['a12a3079e14ced46e69ba52b8a90b21a'] /* IP */,
1402 renderer : function(v) { return String.format('{0}', v); },
1405 '|xns' : 'Roo.grid',
1406 xtype : 'ColumnModel'
1409 dataIndex : 'on_table',
1410 header : _this._strings['2c92a9a6a5dbf570825e62eabcdecd8d'] /* Affected */,
1411 renderer : function(v, x, r) {
1412 return v ? String.format('{0}({1})', v, r.data.on_id) : '';
1416 '|xns' : 'Roo.grid',
1417 xtype : 'ColumnModel'
1420 dataIndex : 'remarks',
1421 header : _this._strings['231bc72756b5e6de492aaaa1577f61b1'] /* Remarks */,
1422 renderer : function(v) { return String.format('<span qtip="{1}">{0}</span>', v, Roo.util.Format.htmlEncode(v)); },
1425 '|xns' : 'Roo.grid',
1426 xtype : 'ColumnModel'