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 '40bed7cf9b3d4bb3a3d7a7e3eb18c5eb' :"Person ",
21 '340c2ee497b85d5954b01c64de7f44f6' :"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 'person_table_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
34 'person_id_name_qtip' : '340c2ee497b85d5954b01c64de7f44f6' /* Select Person */ ,
35 'person_table_qtip' : '037fd50b0e85bb65995ca7125d06c7cd' /* Select Person Table */ ,
36 'person_table_emptyText' : '037fd50b0e85bb65995ca7125d06c7cd' /* Select Person Table */ ,
37 'person_id_name_emptyText' : '340c2ee497b85d5954b01c64de7f44f6' /* Select Person */ ,
38 'person_id_name_fieldLabel' : '40bed7cf9b3d4bb3a3d7a7e3eb18c5eb' /* Person */ ,
39 'on_table_qtip' : 'a8929eb5c1553d3f70497f862d25d0ce' /* Select Action */ ,
40 'on_table_emptyText' : '679308a758de538c5f39c4c6cdba6593' /* Select Affects */ ,
41 'action_emptyText' : 'a8929eb5c1553d3f70497f862d25d0ce' /* Select Action */ ,
42 'action_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
43 'action_qtip' : 'a8929eb5c1553d3f70497f862d25d0ce' /* Select Action */ ,
44 'on_table_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
45 'person_id_name_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */
48 part : ["Admin", "LogEvents" ],
49 order : '001-Pman.Tab.AdminLogEvents',
51 parent : 'Pman.Tab.AdminLogs',
52 name : "Admin - Logs - Events",
54 permname : 'Admin.Logs',
55 _tree : function(_data)
60 xtype : 'NestedLayoutPanel',
62 title : _this._strings['87f9f735a1d36793ceaecd4e47124b63'] /* Events */,
66 xtype : 'BorderLayout',
70 xtype : 'LayoutRegion',
75 xtype : 'LayoutRegion',
84 xtype : 'ContentPanel',
88 render : function (_self)
90 _this.viewPanel = _self;
102 tableName : 'Events',
103 title : _this._strings['87f9f735a1d36793ceaecd4e47124b63'] /* Events */,
105 activate : function() {
108 _this.grid.footer.onClick('first');
116 autoExpandColumn : 'remarks',
122 //_this.dialog = Pman.Dialog.FILL_IN
123 if (_this.panel.active) {
124 this.footer.onClick('first');
131 xtype : 'PagingToolbar',
133 displayMsg : _this._strings['2ea72778ebaacc973260c88837dd7a2f'] /* Displaying Events {0} - {1} of {2} */,
134 emptyMsg : _this._strings['90e4ac2e5a22e53df63b6b186d8727ba'] /* No Events found */,
141 text : _this._strings['01bd6a16732dfa2b760dc8566c58afae'] /* Download to Excel */,
143 click : function (_self, e)
147 'sort' : 'event_when',
151 person_id : _this.personSel.getValue(),
152 'csvTitles[0]' : 'When', 'csvCols[0]' : 'event_when',
153 'csvTitles[1]' : 'Staff', 'csvCols[1]' : 'person_id_name',
154 'csvTitles[2]' : 'Action', 'csvCols[2]' : 'action',
155 'csvTitles[3]' : 'Record ID', 'csvCols[3]' : 'on_id' ,
156 'csvTitles[4]' : 'Record Type', 'csvCols[4]' : 'on_table',
157 'csvTitles[5]' : 'Remarks', 'csvCols[5]' : 'remarks'
160 params.person_id = _this.personSel.getValue();
161 var act = _this.actionSel.getValue();
165 var tbl = _this.affectSel.getValue();
167 params.on_table = tbl;
169 act = _this.dateFrom.getValue();
171 params['query[from]'] = act.format('Y-m-d');
173 act = _this.dateTo.getValue();
175 params['query[to]'] = act.format('Y-m-d');
181 url : baseURL + '/Roo/Events.php',
189 '|xns' : 'Roo.Toolbar'
193 text : _this._strings['e4ef97f584a9c8d2d686f84569307575'] /* Download to Excel (with extra descriptions) */,
195 click : function (_self, e)
199 'sort' : 'event_when',
203 person_id : _this.personSel.getValue(),
204 'csvTitles[0]' : 'ID#', 'csvCols[0]' : 'id',
205 'csvTitles[1]' : 'When', 'csvCols[1]' : 'event_when',
206 'csvTitles[2]' : 'Staff', 'csvCols[2]' : 'person_id_name',
207 'csvTitles[3]' : 'Action', 'csvCols[3]' : 'action',
208 'csvTitles[4]' : 'Record ID', 'csvCols[4]' : 'on_id' ,
209 'csvTitles[5]' : 'Record Type', 'csvCols[5]' : 'on_table',
210 'csvTitles[6]' : 'Remarks', 'csvCols[6]' : 'remarks'
212 params._with_obj_summary = 1;
213 params.person_id = _this.personSel.getValue();
214 var act = _this.actionSel.getValue();
218 var tbl = _this.affectSel.getValue();
220 params.on_table = tbl;
222 act = _this.dateFrom.getValue();
224 params['query[from]'] = act.format('Y-m-d');
226 act = _this.dateTo.getValue();
228 params['query[to]'] = act.format('Y-m-d');
234 url : baseURL + '/Roo/Events.php',
242 '|xns' : 'Roo.Toolbar'
247 '|xns' : 'Roo.Toolbar'
251 cls : 'x-btn-text-icon',
252 icon : Roo.rootURL + 'images/default/tree/leaf.gif',
253 text : _this._strings['2bd339d85ee3b33e513359ce781b60cc'] /* Restore */,
257 var s = _this.grid.getSelectionModel().getSelected();
259 if(!s || s.data.id * 1 < 1 || s.data.action != 'DELETE'){
260 Roo.MessageBox.alert('Error', 'Please select a deleted person');
265 url: baseURL + '/Roo/Events',
272 success : function(ret) {
273 _this.grid.footer.onClick('refresh');
274 Roo.MessageBox.alert('Notice', 'Restored person successfully');
280 '|xns' : 'Roo.Toolbar'
291 text : _this._strings['498f79c4c5bbde77f1bceb6c86fd0f6d'] /* Show */,
293 '|xns' : 'Roo.Toolbar'
299 displayField : 'value',
301 emptyText : _this._strings['037fd50b0e85bb65995ca7125d06c7cd'] /* Select Person Table */,
302 forceSelection : true,
304 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
306 name : 'person_table',
308 qtip : _this._strings['037fd50b0e85bb65995ca7125d06c7cd'] /* Select Person Table */,
309 selectOnFocus : true,
310 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{value}</b> </div>',
311 triggerAction : 'all',
313 valueField : 'value',
316 render : function (_self)
318 _this.tableSel = _self;
321 typeof(uiConfig) == 'undefined' ||
322 typeof(uiConfig.events_person_table) == 'undefined' ||
323 !uiConfig.events_person_table.length
329 select : function (combo, record, index)
331 _this.grid.footer.onClick('first');
337 xtype : 'SimpleStore',
340 if(typeof(uiConfig) == 'undefined' || typeof(uiConfig.events_person_table) == 'undefined' || !uiConfig.events_person_table.length){
345 return uiConfig.events_person_table;
348 fields : [ 'value' ],
357 displayField : 'name',
359 emptyText : _this._strings['340c2ee497b85d5954b01c64de7f44f6'] /* Select Person */,
360 fieldLabel : _this._strings['40bed7cf9b3d4bb3a3d7a7e3eb18c5eb'] /* Person */,
361 forceSelection : true,
363 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
365 name : 'person_id_name',
367 qtip : _this._strings['340c2ee497b85d5954b01c64de7f44f6'] /* Select Person */,
368 queryParam : 'query[name]',
369 selectOnFocus : true,
370 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> ({company_id_name}) <{email}> </div>',
371 triggerAction : 'all',
376 render : function (_self)
378 _this.personSel = _self;
380 select : function (combo, record, index)
382 _this.grid.footer.onClick('first');
391 sortInfo : { field : 'name' , direction : 'ASC' },
393 beforeload : function (_self, o)
395 o.params = o.params || {};
396 // this will show everyone... - for MO - that means they can see users.
397 //o.params.company_id = Pman.Login.authUser.company_id;
405 url : baseURL + '/Roo/core_person',
410 xtype : 'JsonReader',
437 'name': 'company_id',
465 'name': 'no_reset_sent',
469 'name': 'action_type',
473 'name': 'project_id',
477 'name': 'deleted_by',
481 'name': 'deleted_dt',
483 'dateFormat': 'Y-m-d'
486 'name': 'office_id_id',
490 'name': 'office_id_company_id',
494 'name': 'office_id_name',
498 'name': 'office_id_address',
502 'name': 'office_id_phone',
506 'name': 'office_id_fax',
510 'name': 'office_id_email',
514 'name': 'office_id_role',
518 'name': 'company_id_code',
522 'name': 'company_id_name',
526 'name': 'company_id_remarks',
530 'name': 'company_id_owner_id',
534 'name': 'company_id_address',
538 'name': 'company_id_tel',
542 'name': 'company_id_fax',
546 'name': 'company_id_email',
550 'name': 'company_id_id',
554 'name': 'company_id_isOwner',
558 'name': 'company_id_logo_id',
562 'name': 'company_id_background_color',
566 'name': 'company_id_comptype',
570 'name': 'company_id_url',
574 'name': 'company_id_main_office_id',
578 'name': 'company_id_created_by',
582 'name': 'company_id_created_dt',
586 'name': 'company_id_updated_by',
590 'name': 'company_id_updated_dt',
594 'name': 'company_id_passwd',
598 'name': 'company_id_dispatch_port',
602 'name': 'company_id_province',
606 'name': 'company_id_country',
610 'name': 'project_id_id',
614 'name': 'project_id_name',
618 'name': 'project_id_remarks',
622 'name': 'project_id_owner_id',
626 'name': 'project_id_code',
630 'name': 'project_id_active',
634 'name': 'project_id_type',
638 'name': 'project_id_client_id',
642 'name': 'project_id_team_id',
646 'name': 'project_id_file_location',
650 'name': 'project_id_open_date',
654 'name': 'project_id_open_by',
658 'name': 'project_id_close_date',
662 'name': 'project_id_countries',
666 'name': 'project_id_languages',
670 'name': 'project_id_agency_id',
674 'name': 'owner_id_id',
678 'name': 'owner_id_office_id',
682 'name': 'owner_id_name',
686 'name': 'owner_id_phone',
690 'name': 'owner_id_fax',
694 'name': 'owner_id_email',
698 'name': 'owner_id_company_id',
702 'name': 'owner_id_role',
706 'name': 'owner_id_active',
710 'name': 'owner_id_remarks',
714 'name': 'owner_id_passwd',
718 'name': 'owner_id_owner_id',
722 'name': 'owner_id_lang',
726 'name': 'owner_id_no_reset_sent',
730 'name': 'owner_id_action_type',
734 'name': 'owner_id_project_id',
738 'name': 'owner_id_deleted_by',
742 'name': 'owner_id_deleted_dt',
748 totalProperty : 'total',
757 displayField : 'action',
759 emptyText : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
760 forceSelection : true,
762 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
766 qtip : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
767 queryParam : 'query[action]',
768 selectOnFocus : true,
769 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{action}</b> </div>',
770 triggerAction : 'all',
772 valueField : 'action',
775 render : function (_self)
777 _this.actionSel = _self;
779 select : function (combo, record, index)
781 _this.grid.footer.onClick('first');
789 sortInfo : { field : 'action' , direction : 'ASC' },
791 beforeload : function (_self, o)
793 o.params = o.params || {};
794 // staff can see all logs, other companies can only see their own.
795 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
796 o.params.company_id = Pman.Login.authUser.company_id;
798 o.params._distinct = 'action';
799 o.params._columns ='action';
807 url : baseURL + '/Roo/Events.php',
812 xtype : 'JsonReader',
819 'name': 'person_name',
823 'name': 'event_when',
825 'dateFormat': 'Y-m-d'
852 'name': 'person_id_id',
856 'name': 'person_id_office_id',
860 'name': 'person_id_name',
864 'name': 'person_id_phone',
868 'name': 'person_id_fax',
872 'name': 'person_id_email',
876 'name': 'person_id_company_id',
880 'name': 'person_id_role',
884 'name': 'person_id_active',
888 'name': 'person_id_remarks',
892 'name': 'person_id_passwd',
896 'name': 'person_id_owner_id',
900 'name': 'person_id_lang',
904 'name': 'person_id_no_reset_sent',
908 'name': 'person_id_action_type',
912 'name': 'person_id_project_id',
916 'name': 'person_id_deleted_by',
920 'name': 'person_id_deleted_dt',
926 totalProperty : 'total',
935 displayField : 'on_table',
937 emptyText : _this._strings['679308a758de538c5f39c4c6cdba6593'] /* Select Affects */,
938 forceSelection : true,
940 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
944 qtip : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
945 queryParam : 'query[on_table]',
946 selectOnFocus : true,
947 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{on_table}</b> </div>',
948 triggerAction : 'all',
950 valueField : 'action',
953 render : function (_self)
955 _this.affectSel = _self;
957 if(!Pman.hasPerm('Admin.Logs_Affects', 'S')){
961 select : function (combo, record, index)
963 _this.grid.footer.onClick('first');
971 sortInfo : { field : 'on_table' , direction : 'ASC' },
973 beforeload : function (_self, o)
975 o.params = o.params || {};
976 // staff can see all logs, other companies can only see their own.
977 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
978 o.params.company_id = Pman.Login.authUser.company_id;
980 o.params._distinct = 'on_table';
981 o.params._columns ='on_table';
989 url : baseURL + '/Roo/Events.php',
994 xtype : 'JsonReader',
1001 'name': 'person_name',
1005 'name': 'event_when',
1007 'dateFormat': 'Y-m-d'
1026 'name': 'person_id',
1034 'name': 'person_id_id',
1038 'name': 'person_id_office_id',
1042 'name': 'person_id_name',
1046 'name': 'person_id_phone',
1050 'name': 'person_id_fax',
1054 'name': 'person_id_email',
1058 'name': 'person_id_company_id',
1062 'name': 'person_id_role',
1066 'name': 'person_id_active',
1070 'name': 'person_id_remarks',
1074 'name': 'person_id_passwd',
1078 'name': 'person_id_owner_id',
1082 'name': 'person_id_lang',
1086 'name': 'person_id_no_reset_sent',
1090 'name': 'person_id_action_type',
1094 'name': 'person_id_project_id',
1098 'name': 'person_id_deleted_by',
1102 'name': 'person_id_deleted_dt',
1108 totalProperty : 'total',
1116 text : _this._strings['39b9e051f9fe75e65c7a330bb00499d4'] /* Date Range */,
1118 '|xns' : 'Roo.Toolbar'
1121 xtype : 'DateField',
1124 change : function (_self, newValue, oldValue)
1126 _this.grid.footer.onClick('first');
1128 render : function (_self)
1130 _this.dateFrom = _self;
1137 xtype : 'DateField',
1140 change : function (_self, newValue, oldValue)
1142 _this.grid.footer.onClick('first');
1144 render : function (_self)
1146 _this.dateTo = _self;
1157 sortInfo : { field: 'event_when', direction: 'DESC'},
1159 beforeload : function (_self, o)
1161 if (!Pman.buildCompleted) {
1166 if (! _this.personSel) {
1169 o.params = o.params || {};
1170 o.params.person_id = _this.personSel.getValue();
1171 o.params.person_table = _this.tableSel.getValue();
1172 var act = _this.actionSel.getValue();
1174 o.params.action = act;
1176 var tbl = _this.affectSel.getValue();
1178 o.params.on_table = tbl;
1180 act = _this.dateFrom.getValue();
1182 o.params['query[from]'] = act.format('Y-m-d');
1184 act = _this.dateTo.getValue();
1186 o.params['query[to]'] = act.format('Y-m-d');
1191 act = _this.groupedCombo.getValue();
1192 o.params['query[grouped]'] = act;
1193 if (o.params['query[grouped]'] == 'gr') {
1196 Roo.MessageBox.alert("Error", "Select a table to group results on");
1199 // o.params['_columns'] =
1200 o.params['_distinct'] = 'on_id';
1211 '|xns' : 'Roo.data',
1213 xtype : 'HttpProxy',
1215 url : baseURL + '/Roo/Events.php',
1220 xtype : 'JsonReader',
1227 'name': 'person_name',
1231 'name': 'event_when',
1233 'dateFormat': 'Y-m-d'
1252 'name': 'person_id',
1260 'name': 'person_id_id',
1264 'name': 'person_id_office_id',
1268 'name': 'person_id_name',
1272 'name': 'person_id_phone',
1276 'name': 'person_id_fax',
1280 'name': 'person_id_email',
1284 'name': 'person_id_company_id',
1288 'name': 'person_id_role',
1292 'name': 'person_id_active',
1296 'name': 'person_id_remarks',
1300 'name': 'person_id_passwd',
1304 'name': 'person_id_owner_id',
1308 'name': 'person_id_lang',
1312 'name': 'person_id_no_reset_sent',
1316 'name': 'person_id_action_type',
1320 'name': 'person_id_project_id',
1324 'name': 'person_id_deleted_by',
1328 'name': 'person_id_deleted_dt',
1334 totalProperty : 'total',
1340 xtype : 'RowSelectionModel',
1341 singleSelect : true,
1343 afterselectionchange : function (_self)
1345 // load detail log in _this.viewPanel;
1346 if (!this.getSelected()) {
1347 this.viewPanel.setContent("Nothing Selected");
1350 var id = this.getSelected().data.id;
1351 _this.viewPanel.load( { url : baseURL + "/Admin/EventView/" + id + ".html" });
1360 xtype : 'ColumnModel',
1361 dataIndex : 'event_when',
1362 header : _this._strings['4e97aeeaa8b15ca1180fcd1f3ac478d1'] /* When */,
1363 renderer : function(v) { return v ? v.dateFormat('d/m/Y H:i') : ''; },
1369 xtype : 'ColumnModel',
1371 header : _this._strings['1b7f7d24575cdbfadb83b9587fa1bf97'] /* #id */,
1372 hidden : (function() {
1373 return typeof(Pman.Tab.AdminLogEvents.hide_cols) == 'undefined' ?
1375 ((Pman.Tab.AdminLogEvents.hide_cols.indexOf('id') > -1) ? true : false);
1382 xtype : 'ColumnModel',
1383 dataIndex : 'person_id_name',
1384 header : _this._strings['40bed7cf9b3d4bb3a3d7a7e3eb18c5eb'] /* Person */,
1385 renderer : function(v,x,r) {
1387 var ptable = _this.tableSel.getValue();
1389 var efield = 'person_id_email';
1390 var nfield = 'person_id_name';
1394 ptable != 'Person' &&
1395 typeof(r.data[ptable + '_id_email']) != 'undefined' &&
1396 typeof(r.data[ptable + '_id_name']) != 'undefined'
1398 efield = ptable + '_id_email';
1399 nfield = ptable + '_id_name';
1402 var email = r.data[efield]; // ? r.data.person_id_email : r.data.person_id_email;
1403 var name = r.data[nfield]; // ? r.data.person_id_name : r.data.person_id_name;
1404 return String.format('{0} <<a href="mailto:{1}">{1}</a>>',
1414 xtype : 'ColumnModel',
1415 dataIndex : 'action',
1416 header : _this._strings['004bf6c9a40003140292e97330236c53'] /* Action */,
1417 renderer : function(v) { return String.format('{0}', v); },
1423 xtype : 'ColumnModel',
1424 dataIndex : 'ipaddr',
1425 header : _this._strings['a12a3079e14ced46e69ba52b8a90b21a'] /* IP */,
1426 renderer : function(v) { return String.format('{0}', v); },
1432 xtype : 'ColumnModel',
1433 dataIndex : 'on_table',
1434 header : _this._strings['2c92a9a6a5dbf570825e62eabcdecd8d'] /* Affected */,
1435 hidden : (function() {
1436 return typeof(Pman.Tab.AdminLogEvents.hide_cols) == 'undefined' ?
1438 ((Pman.Tab.AdminLogEvents.hide_cols.indexOf('on_table') > -1) ? true : false);
1440 renderer : function(v, x, r) {
1441 return v ? String.format('{0}({1})', v, r.data.on_id) : '';
1448 xtype : 'ColumnModel',
1449 dataIndex : 'remarks',
1450 header : _this._strings['231bc72756b5e6de492aaaa1577f61b1'] /* Remarks */,
1451 renderer : function(v) { return String.format('<span qtip="{1}">{0}</span>', v, Roo.util.Format.htmlEncode(v)); },