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',
259 success : function(ret) {
260 _this.grid.footer.onClick('refresh');
261 Roo.MessageBox.alert('Notice', 'Restored person successfully');
275 text : _this._strings['498f79c4c5bbde77f1bceb6c86fd0f6d'] /* Show */,
277 '|xns' : 'Roo.Toolbar',
283 displayField : 'value',
285 emptyText : _this._strings['037fd50b0e85bb65995ca7125d06c7cd'] /* Select Person Table */,
286 forceSelection : true,
288 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
290 name : 'person_table',
292 qtip : _this._strings['037fd50b0e85bb65995ca7125d06c7cd'] /* Select Person Table */,
293 selectOnFocus : true,
294 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{value}</b> </div>',
295 triggerAction : 'all',
297 valueField : 'value',
303 render : function (_self)
305 _this.tableSel = _self;
308 typeof(uiConfig) == 'undefined' ||
309 typeof(uiConfig.events_person_table) == 'undefined' ||
310 !uiConfig.events_person_table.length
316 select : function (combo, record, index)
318 _this.grid.footer.onClick('first');
324 if(typeof(uiConfig) == 'undefined' || typeof(uiConfig.events_person_table) == 'undefined' || !uiConfig.events_person_table.length){
329 return uiConfig.events_person_table;
332 fields : [ 'value' ],
336 xtype : 'SimpleStore'
341 displayField : 'name',
343 emptyText : _this._strings['fd7535ce3979bb8547e2c01689db0767'] /* Select Person */,
344 fieldLabel : _this._strings['42cf593b947cd3d591fa132742486f89'] /* Person */,
345 forceSelection : true,
347 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
349 name : 'person_id_name',
351 qtip : _this._strings['fd7535ce3979bb8547e2c01689db0767'] /* Select Person */,
352 queryParam : 'query[name]',
353 selectOnFocus : true,
354 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> ({company_id_name}) <{email}> </div>',
355 triggerAction : 'all',
363 render : function (_self)
365 _this.personSel = _self;
367 select : function (combo, record, index)
369 _this.grid.footer.onClick('first');
375 sortInfo : { field : 'name' , direction : 'ASC' },
380 beforeload : function (_self, o)
382 o.params = o.params || {};
383 // this will show everyone... - for MO - that means they can see users.
384 //o.params.company_id = Pman.Login.authUser.company_id;
389 url : baseURL + '/Roo/Person.php',
421 'name': 'company_id',
449 'name': 'no_reset_sent',
453 'name': 'action_type',
457 'name': 'project_id',
461 'name': 'deleted_by',
465 'name': 'deleted_dt',
467 'dateFormat': 'Y-m-d'
470 'name': 'office_id_id',
474 'name': 'office_id_company_id',
478 'name': 'office_id_name',
482 'name': 'office_id_address',
486 'name': 'office_id_phone',
490 'name': 'office_id_fax',
494 'name': 'office_id_email',
498 'name': 'office_id_role',
502 'name': 'company_id_code',
506 'name': 'company_id_name',
510 'name': 'company_id_remarks',
514 'name': 'company_id_owner_id',
518 'name': 'company_id_address',
522 'name': 'company_id_tel',
526 'name': 'company_id_fax',
530 'name': 'company_id_email',
534 'name': 'company_id_id',
538 'name': 'company_id_isOwner',
542 'name': 'company_id_logo_id',
546 'name': 'company_id_background_color',
550 'name': 'company_id_comptype',
554 'name': 'company_id_url',
558 'name': 'company_id_main_office_id',
562 'name': 'company_id_created_by',
566 'name': 'company_id_created_dt',
570 'name': 'company_id_updated_by',
574 'name': 'company_id_updated_dt',
578 'name': 'company_id_passwd',
582 'name': 'company_id_dispatch_port',
586 'name': 'company_id_province',
590 'name': 'company_id_country',
594 'name': 'project_id_id',
598 'name': 'project_id_name',
602 'name': 'project_id_remarks',
606 'name': 'project_id_owner_id',
610 'name': 'project_id_code',
614 'name': 'project_id_active',
618 'name': 'project_id_type',
622 'name': 'project_id_client_id',
626 'name': 'project_id_team_id',
630 'name': 'project_id_file_location',
634 'name': 'project_id_open_date',
638 'name': 'project_id_open_by',
642 'name': 'project_id_close_date',
646 'name': 'project_id_countries',
650 'name': 'project_id_languages',
654 'name': 'project_id_agency_id',
658 'name': 'owner_id_id',
662 'name': 'owner_id_office_id',
666 'name': 'owner_id_name',
670 'name': 'owner_id_phone',
674 'name': 'owner_id_fax',
678 'name': 'owner_id_email',
682 'name': 'owner_id_company_id',
686 'name': 'owner_id_role',
690 'name': 'owner_id_active',
694 'name': 'owner_id_remarks',
698 'name': 'owner_id_passwd',
702 'name': 'owner_id_owner_id',
706 'name': 'owner_id_lang',
710 'name': 'owner_id_no_reset_sent',
714 'name': 'owner_id_action_type',
718 'name': 'owner_id_project_id',
722 'name': 'owner_id_deleted_by',
726 'name': 'owner_id_deleted_dt',
732 totalProperty : 'total',
741 displayField : 'action',
743 emptyText : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
744 forceSelection : true,
746 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
750 qtip : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
751 queryParam : 'query[action]',
752 selectOnFocus : true,
753 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{action}</b> </div>',
754 triggerAction : 'all',
756 valueField : 'action',
762 render : function (_self)
764 _this.actionSel = _self;
766 select : function (combo, record, index)
768 _this.grid.footer.onClick('first');
773 sortInfo : { field : 'action' , direction : 'ASC' },
778 beforeload : function (_self, o)
780 o.params = o.params || {};
781 // staff can see all logs, other companies can only see their own.
782 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
783 o.params.company_id = Pman.Login.authUser.company_id;
785 o.params._distinct = 'action';
786 o.params._columns ='action';
791 url : baseURL + '/Roo/Events.php',
803 'name': 'person_name',
807 'name': 'event_when',
809 'dateFormat': 'Y-m-d'
836 'name': 'person_id_id',
840 'name': 'person_id_office_id',
844 'name': 'person_id_name',
848 'name': 'person_id_phone',
852 'name': 'person_id_fax',
856 'name': 'person_id_email',
860 'name': 'person_id_company_id',
864 'name': 'person_id_role',
868 'name': 'person_id_active',
872 'name': 'person_id_remarks',
876 'name': 'person_id_passwd',
880 'name': 'person_id_owner_id',
884 'name': 'person_id_lang',
888 'name': 'person_id_no_reset_sent',
892 'name': 'person_id_action_type',
896 'name': 'person_id_project_id',
900 'name': 'person_id_deleted_by',
904 'name': 'person_id_deleted_dt',
910 totalProperty : 'total',
919 displayField : 'on_table',
921 emptyText : _this._strings['679308a758de538c5f39c4c6cdba6593'] /* Select Affects */,
922 forceSelection : true,
924 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
928 qtip : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* 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 render : function (_self)
942 _this.affectSel = _self;
944 if(!Pman.hasPerm('Admin.Logs_Affects', 'S')){
948 select : function (combo, record, index)
950 _this.grid.footer.onClick('first');
955 sortInfo : { field : 'on_table' , direction : 'ASC' },
960 beforeload : function (_self, o)
962 o.params = o.params || {};
963 // staff can see all logs, other companies can only see their own.
964 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
965 o.params.company_id = Pman.Login.authUser.company_id;
967 o.params._distinct = 'on_table';
968 o.params._columns ='on_table';
973 url : baseURL + '/Roo/Events.php',
985 'name': 'person_name',
989 'name': 'event_when',
991 'dateFormat': 'Y-m-d'
1010 'name': 'person_id',
1018 'name': 'person_id_id',
1022 'name': 'person_id_office_id',
1026 'name': 'person_id_name',
1030 'name': 'person_id_phone',
1034 'name': 'person_id_fax',
1038 'name': 'person_id_email',
1042 'name': 'person_id_company_id',
1046 'name': 'person_id_role',
1050 'name': 'person_id_active',
1054 'name': 'person_id_remarks',
1058 'name': 'person_id_passwd',
1062 'name': 'person_id_owner_id',
1066 'name': 'person_id_lang',
1070 'name': 'person_id_no_reset_sent',
1074 'name': 'person_id_action_type',
1078 'name': 'person_id_project_id',
1082 'name': 'person_id_deleted_by',
1086 'name': 'person_id_deleted_dt',
1092 totalProperty : 'total',
1094 '|xns' : 'Roo.data',
1095 xtype : 'JsonReader'
1100 text : _this._strings['39b9e051f9fe75e65c7a330bb00499d4'] /* Date Range */,
1102 '|xns' : 'Roo.Toolbar',
1108 '|xns' : 'Roo.form',
1109 xtype : 'DateField',
1111 change : function (_self, newValue, oldValue)
1113 _this.grid.footer.onClick('first');
1115 render : function (_self)
1117 _this.dateFrom = _self;
1124 '|xns' : 'Roo.form',
1125 xtype : 'DateField',
1127 change : function (_self, newValue, oldValue)
1129 _this.grid.footer.onClick('first');
1131 render : function (_self)
1133 _this.dateTo = _self;
1141 sortInfo : { field: 'event_when', direction: 'DESC'},
1143 '|xns' : 'Roo.data',
1146 beforeload : function (_self, o)
1148 if (!Pman.buildCompleted) {
1153 if (! _this.personSel) {
1156 o.params = o.params || {};
1157 o.params.person_id = _this.personSel.getValue();
1158 o.params.person_table = _this.tableSel.getValue();
1159 var act = _this.actionSel.getValue();
1161 o.params.action = act;
1163 var tbl = _this.affectSel.getValue();
1165 o.params.on_table = tbl;
1167 act = _this.dateFrom.getValue();
1169 o.params['query[from]'] = act.format('Y-m-d');
1171 act = _this.dateTo.getValue();
1173 o.params['query[to]'] = act.format('Y-m-d');
1178 act = _this.groupedCombo.getValue();
1179 o.params['query[grouped]'] = act;
1180 if (o.params['query[grouped]'] == 'gr') {
1183 Roo.MessageBox.alert("Error", "Select a table to group results on");
1186 // o.params['_columns'] =
1187 o.params['_distinct'] = 'on_id';
1199 url : baseURL + '/Roo/Events.php',
1201 '|xns' : 'Roo.data',
1211 'name': 'person_name',
1215 'name': 'event_when',
1217 'dateFormat': 'Y-m-d'
1236 'name': 'person_id',
1244 'name': 'person_id_id',
1248 'name': 'person_id_office_id',
1252 'name': 'person_id_name',
1256 'name': 'person_id_phone',
1260 'name': 'person_id_fax',
1264 'name': 'person_id_email',
1268 'name': 'person_id_company_id',
1272 'name': 'person_id_role',
1276 'name': 'person_id_active',
1280 'name': 'person_id_remarks',
1284 'name': 'person_id_passwd',
1288 'name': 'person_id_owner_id',
1292 'name': 'person_id_lang',
1296 'name': 'person_id_no_reset_sent',
1300 'name': 'person_id_action_type',
1304 'name': 'person_id_project_id',
1308 'name': 'person_id_deleted_by',
1312 'name': 'person_id_deleted_dt',
1318 totalProperty : 'total',
1320 '|xns' : 'Roo.data',
1321 xtype : 'JsonReader'
1325 singleSelect : true,
1327 '|xns' : 'Roo.grid',
1328 xtype : 'RowSelectionModel',
1330 afterselectionchange : function (_self)
1332 // load detail log in _this.viewPanel;
1333 if (!this.getSelected()) {
1334 this.viewPanel.setContent("Nothing Selected");
1337 var id = this.getSelected().data.id;
1338 _this.viewPanel.load( { url : baseURL + "/Admin/EventView/" + id + ".html" });
1345 dataIndex : 'event_when',
1346 header : _this._strings['4e97aeeaa8b15ca1180fcd1f3ac478d1'] /* When */,
1347 renderer : function(v) { return v ? v.dateFormat('d/m/Y H:i') : ''; },
1350 '|xns' : 'Roo.grid',
1351 xtype : 'ColumnModel'
1355 header : _this._strings['1b7f7d24575cdbfadb83b9587fa1bf97'] /* #id */,
1358 '|xns' : 'Roo.grid',
1359 xtype : 'ColumnModel'
1362 dataIndex : 'person_id_name',
1363 header : _this._strings['40bed7cf9b3d4bb3a3d7a7e3eb18c5eb'] /* Person */,
1364 renderer : function(v,x,r) {
1366 var ptable = _this.tableSel.getValue();
1368 var efield = 'person_id_email';
1369 var nfield = 'person_id_name';
1373 ptable != 'Person' &&
1374 typeof(r.data[ptable + '_id_email']) != 'undefined' &&
1375 typeof(r.data[ptable + '_id_name']) != 'undefined'
1377 efield = ptable + '_id_email';
1378 nfield = ptable + '_id_name';
1381 var email = r.data[efield]; // ? r.data.person_id_email : r.data.person_id_email;
1382 var name = r.data[nfield]; // ? r.data.person_id_name : r.data.person_id_name;
1383 return String.format('{0} <<a href="mailto:{1}">{1}</a>>',
1390 '|xns' : 'Roo.grid',
1391 xtype : 'ColumnModel'
1394 dataIndex : 'action',
1395 header : _this._strings['004bf6c9a40003140292e97330236c53'] /* Action */,
1396 renderer : function(v) { return String.format('{0}', v); },
1399 '|xns' : 'Roo.grid',
1400 xtype : 'ColumnModel'
1403 dataIndex : 'ipaddr',
1404 header : _this._strings['a12a3079e14ced46e69ba52b8a90b21a'] /* IP */,
1405 renderer : function(v) { return String.format('{0}', v); },
1408 '|xns' : 'Roo.grid',
1409 xtype : 'ColumnModel'
1412 dataIndex : 'on_table',
1413 header : _this._strings['2c92a9a6a5dbf570825e62eabcdecd8d'] /* Affected */,
1414 renderer : function(v, x, r) {
1415 return v ? String.format('{0}({1})', v, r.data.on_id) : '';
1419 '|xns' : 'Roo.grid',
1420 xtype : 'ColumnModel'
1423 dataIndex : 'remarks',
1424 header : _this._strings['231bc72756b5e6de492aaaa1577f61b1'] /* Remarks */,
1425 renderer : function(v) { return String.format('<span qtip="{1}">{0}</span>', v, Roo.util.Format.htmlEncode(v)); },
1428 '|xns' : 'Roo.grid',
1429 xtype : 'ColumnModel'