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 '90e4ac2e5a22e53df63b6b186d8727ba' :"No Events found",
29 '2c92a9a6a5dbf570825e62eabcdecd8d' :"Affected"
32 part : ["Admin", "LogEvents" ],
33 order : '001-Pman.Tab.AdminLogEvents',
35 parent : 'Pman.Tab.AdminLogs',
36 name : "Admin - Logs - Events",
38 permname : 'Admin.Logs',
45 title : _this._strings['87f9f735a1d36793ceaecd4e47124b63'] /* Events */,
48 xtype : 'NestedLayoutPanel',
52 xtype : 'BorderLayout',
56 xtype : 'LayoutRegion'
64 xtype : 'LayoutRegion'
72 xtype : 'ContentPanel',
74 render : function (_self)
76 _this.viewPanel = _self;
86 title : _this._strings['87f9f735a1d36793ceaecd4e47124b63'] /* Events */,
91 activate : function() {
94 _this.grid.footer.onClick('first');
99 autoExpandColumn : 'remarks',
108 //_this.dialog = Pman.Dialog.FILL_IN
109 if (_this.panel.active) {
110 this.footer.onClick('first');
116 displayMsg : _this._strings['2ea72778ebaacc973260c88837dd7a2f'] /* Displaying Events {0} - {1} of {2} */,
117 emptyMsg : _this._strings['90e4ac2e5a22e53df63b6b186d8727ba'] /* No Events found */,
121 xtype : 'PagingToolbar',
124 text : _this._strings['01bd6a16732dfa2b760dc8566c58afae'] /* Download to Excel */,
126 '|xns' : 'Roo.Toolbar',
129 click : function (_self, e)
133 'sort' : 'event_when',
137 person_id : _this.personSel.getValue(),
138 'csvTitles[0]' : 'When', 'csvCols[0]' : 'event_when',
139 'csvTitles[1]' : 'Staff', 'csvCols[1]' : 'person_id_name',
140 'csvTitles[2]' : 'Action', 'csvCols[2]' : 'action',
141 'csvTitles[3]' : 'Record ID', 'csvCols[3]' : 'on_id' ,
142 'csvTitles[4]' : 'Record Type', 'csvCols[4]' : 'on_table',
143 'csvTitles[5]' : 'Remarks', 'csvCols[5]' : 'remarks'
146 params.person_id = _this.personSel.getValue();
147 var act = _this.actionSel.getValue();
151 var tbl = _this.affectSel.getValue();
153 params.on_table = tbl;
155 act = _this.dateFrom.getValue();
157 params['query[from]'] = act.format('Y-m-d');
159 act = _this.dateTo.getValue();
161 params['query[to]'] = act.format('Y-m-d');
167 url : baseURL + '/Roo/Events.php',
176 text : _this._strings['e4ef97f584a9c8d2d686f84569307575'] /* Download to Excel (with extra descriptions) */,
178 '|xns' : 'Roo.Toolbar',
181 click : function (_self, e)
185 'sort' : 'event_when',
189 person_id : _this.personSel.getValue(),
190 'csvTitles[0]' : 'ID#', 'csvCols[0]' : 'id',
191 'csvTitles[1]' : 'When', 'csvCols[1]' : 'event_when',
192 'csvTitles[2]' : 'Staff', 'csvCols[2]' : 'person_id_name',
193 'csvTitles[3]' : 'Action', 'csvCols[3]' : 'action',
194 'csvTitles[4]' : 'Record ID', 'csvCols[4]' : 'on_id' ,
195 'csvTitles[5]' : 'Record Type', 'csvCols[5]' : 'on_table',
196 'csvTitles[6]' : 'Remarks', 'csvCols[6]' : 'remarks'
198 params._with_obj_summary = 1;
199 params.person_id = _this.personSel.getValue();
200 var act = _this.actionSel.getValue();
204 var tbl = _this.affectSel.getValue();
206 params.on_table = tbl;
208 act = _this.dateFrom.getValue();
210 params['query[from]'] = act.format('Y-m-d');
212 act = _this.dateTo.getValue();
214 params['query[to]'] = act.format('Y-m-d');
220 url : baseURL + '/Roo/Events.php',
236 text : _this._strings['498f79c4c5bbde77f1bceb6c86fd0f6d'] /* Show */,
238 '|xns' : 'Roo.Toolbar',
244 displayField : 'value',
246 emptyText : _this._strings['037fd50b0e85bb65995ca7125d06c7cd'] /* Select Person Table */,
247 forceSelection : true,
249 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
251 name : 'person_table',
253 qtip : _this._strings['037fd50b0e85bb65995ca7125d06c7cd'] /* Select Person Table */,
254 selectOnFocus : true,
255 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{value}</b> </div>',
256 triggerAction : 'all',
258 valueField : 'value',
264 render : function (_self)
266 _this.tableSel = _self;
269 typeof(uiConfig) == 'undefined' ||
270 typeof(uiConfig.events_person_table) == 'undefined' ||
271 !uiConfig.events_person_table.length
277 select : function (combo, record, index)
279 _this.grid.footer.onClick('first');
285 if(typeof(uiConfig) == 'undefined' || typeof(uiConfig.events_person_table) == 'undefined' || !uiConfig.events_person_table.length){
290 return uiConfig.events_person_table;
293 fields : [ 'value' ],
297 xtype : 'SimpleStore'
302 displayField : 'name',
304 emptyText : _this._strings['fd7535ce3979bb8547e2c01689db0767'] /* Select Person */,
305 fieldLabel : _this._strings['42cf593b947cd3d591fa132742486f89'] /* Person */,
306 forceSelection : true,
308 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
310 name : 'person_id_name',
312 qtip : _this._strings['fd7535ce3979bb8547e2c01689db0767'] /* Select Person */,
313 queryParam : 'query[name]',
314 selectOnFocus : true,
315 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> ({company_id_name}) <{email}> </div>',
316 triggerAction : 'all',
324 render : function (_self)
326 _this.personSel = _self;
328 select : function (combo, record, index)
330 _this.grid.footer.onClick('first');
336 sortInfo : { field : 'name' , direction : 'ASC' },
341 beforeload : function (_self, o)
343 o.params = o.params || {};
344 o.params.company_id = Pman.Login.authUser.company_id;
349 url : baseURL + '/Roo/Person.php',
381 'name': 'company_id',
409 'name': 'no_reset_sent',
413 'name': 'action_type',
417 'name': 'project_id',
421 'name': 'deleted_by',
425 'name': 'deleted_dt',
427 'dateFormat': 'Y-m-d'
430 'name': 'office_id_id',
434 'name': 'office_id_company_id',
438 'name': 'office_id_name',
442 'name': 'office_id_address',
446 'name': 'office_id_phone',
450 'name': 'office_id_fax',
454 'name': 'office_id_email',
458 'name': 'office_id_role',
462 'name': 'company_id_code',
466 'name': 'company_id_name',
470 'name': 'company_id_remarks',
474 'name': 'company_id_owner_id',
478 'name': 'company_id_address',
482 'name': 'company_id_tel',
486 'name': 'company_id_fax',
490 'name': 'company_id_email',
494 'name': 'company_id_id',
498 'name': 'company_id_isOwner',
502 'name': 'company_id_logo_id',
506 'name': 'company_id_background_color',
510 'name': 'company_id_comptype',
514 'name': 'company_id_url',
518 'name': 'company_id_main_office_id',
522 'name': 'company_id_created_by',
526 'name': 'company_id_created_dt',
530 'name': 'company_id_updated_by',
534 'name': 'company_id_updated_dt',
538 'name': 'company_id_passwd',
542 'name': 'company_id_dispatch_port',
546 'name': 'company_id_province',
550 'name': 'company_id_country',
554 'name': 'project_id_id',
558 'name': 'project_id_name',
562 'name': 'project_id_remarks',
566 'name': 'project_id_owner_id',
570 'name': 'project_id_code',
574 'name': 'project_id_active',
578 'name': 'project_id_type',
582 'name': 'project_id_client_id',
586 'name': 'project_id_team_id',
590 'name': 'project_id_file_location',
594 'name': 'project_id_open_date',
598 'name': 'project_id_open_by',
602 'name': 'project_id_close_date',
606 'name': 'project_id_countries',
610 'name': 'project_id_languages',
614 'name': 'project_id_agency_id',
618 'name': 'owner_id_id',
622 'name': 'owner_id_office_id',
626 'name': 'owner_id_name',
630 'name': 'owner_id_phone',
634 'name': 'owner_id_fax',
638 'name': 'owner_id_email',
642 'name': 'owner_id_company_id',
646 'name': 'owner_id_role',
650 'name': 'owner_id_active',
654 'name': 'owner_id_remarks',
658 'name': 'owner_id_passwd',
662 'name': 'owner_id_owner_id',
666 'name': 'owner_id_lang',
670 'name': 'owner_id_no_reset_sent',
674 'name': 'owner_id_action_type',
678 'name': 'owner_id_project_id',
682 'name': 'owner_id_deleted_by',
686 'name': 'owner_id_deleted_dt',
692 totalProperty : 'total',
701 displayField : 'action',
703 emptyText : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
704 forceSelection : true,
706 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
710 qtip : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
711 queryParam : 'query[action]',
712 selectOnFocus : true,
713 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{action}</b> </div>',
714 triggerAction : 'all',
716 valueField : 'action',
722 render : function (_self)
724 _this.actionSel = _self;
726 select : function (combo, record, index)
728 _this.grid.footer.onClick('first');
733 sortInfo : { field : 'action' , direction : 'ASC' },
738 beforeload : function (_self, o)
740 o.params = o.params || {};
741 // staff can see all logs, other companies can only see their own.
742 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
743 o.params.company_id = Pman.Login.authUser.company_id;
745 o.params._distinct = 'action';
746 o.params._columns ='action';
751 url : baseURL + '/Roo/Events.php',
763 'name': 'person_name',
767 'name': 'event_when',
769 'dateFormat': 'Y-m-d'
796 'name': 'person_id_id',
800 'name': 'person_id_office_id',
804 'name': 'person_id_name',
808 'name': 'person_id_phone',
812 'name': 'person_id_fax',
816 'name': 'person_id_email',
820 'name': 'person_id_company_id',
824 'name': 'person_id_role',
828 'name': 'person_id_active',
832 'name': 'person_id_remarks',
836 'name': 'person_id_passwd',
840 'name': 'person_id_owner_id',
844 'name': 'person_id_lang',
848 'name': 'person_id_no_reset_sent',
852 'name': 'person_id_action_type',
856 'name': 'person_id_project_id',
860 'name': 'person_id_deleted_by',
864 'name': 'person_id_deleted_dt',
870 totalProperty : 'total',
879 displayField : 'on_table',
881 emptyText : _this._strings['679308a758de538c5f39c4c6cdba6593'] /* Select Affects */,
882 forceSelection : true,
884 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
888 qtip : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
889 queryParam : 'query[on_table]',
890 selectOnFocus : true,
891 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{on_table}</b> </div>',
892 triggerAction : 'all',
894 valueField : 'action',
900 render : function (_self)
902 _this.affectSel = _self;
904 if(!Pman.hasPerm('Admin.Logs_Affects', 'S')){
908 select : function (combo, record, index)
910 _this.grid.footer.onClick('first');
915 sortInfo : { field : 'on_table' , direction : 'ASC' },
920 beforeload : function (_self, o)
922 o.params = o.params || {};
923 // staff can see all logs, other companies can only see their own.
924 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
925 o.params.company_id = Pman.Login.authUser.company_id;
927 o.params._distinct = 'on_table';
928 o.params._columns ='on_table';
933 url : baseURL + '/Roo/Events.php',
945 'name': 'person_name',
949 'name': 'event_when',
951 'dateFormat': 'Y-m-d'
978 'name': 'person_id_id',
982 'name': 'person_id_office_id',
986 'name': 'person_id_name',
990 'name': 'person_id_phone',
994 'name': 'person_id_fax',
998 'name': 'person_id_email',
1002 'name': 'person_id_company_id',
1006 'name': 'person_id_role',
1010 'name': 'person_id_active',
1014 'name': 'person_id_remarks',
1018 'name': 'person_id_passwd',
1022 'name': 'person_id_owner_id',
1026 'name': 'person_id_lang',
1030 'name': 'person_id_no_reset_sent',
1034 'name': 'person_id_action_type',
1038 'name': 'person_id_project_id',
1042 'name': 'person_id_deleted_by',
1046 'name': 'person_id_deleted_dt',
1052 totalProperty : 'total',
1054 '|xns' : 'Roo.data',
1055 xtype : 'JsonReader'
1060 text : _this._strings['39b9e051f9fe75e65c7a330bb00499d4'] /* Date Range */,
1062 '|xns' : 'Roo.Toolbar',
1068 '|xns' : 'Roo.form',
1069 xtype : 'DateField',
1071 change : function (_self, newValue, oldValue)
1073 _this.grid.footer.onClick('first');
1075 render : function (_self)
1077 _this.dateFrom = _self;
1084 '|xns' : 'Roo.form',
1085 xtype : 'DateField',
1087 change : function (_self, newValue, oldValue)
1089 _this.grid.footer.onClick('first');
1091 render : function (_self)
1093 _this.dateTo = _self;
1101 sortInfo : { field: 'event_when', direction: 'DESC'},
1103 '|xns' : 'Roo.data',
1106 beforeload : function (_self, o)
1108 if (!Pman.buildCompleted) {
1113 if (! _this.personSel) {
1116 o.params = o.params || {};
1117 o.params.person_id = _this.personSel.getValue();
1118 o.params.person_table = _this.tableSel.getValue();
1119 var act = _this.actionSel.getValue();
1121 o.params.action = act;
1123 var tbl = _this.affectSel.getValue();
1125 o.params.on_table = tbl;
1127 act = _this.dateFrom.getValue();
1129 o.params['query[from]'] = act.format('Y-m-d');
1131 act = _this.dateTo.getValue();
1133 o.params['query[to]'] = act.format('Y-m-d');
1138 act = _this.groupedCombo.getValue();
1139 o.params['query[grouped]'] = act;
1140 if (o.params['query[grouped]'] == 'gr') {
1143 Roo.MessageBox.alert("Error", "Select a table to group results on");
1146 // o.params['_columns'] =
1147 o.params['_distinct'] = 'on_id';
1159 url : baseURL + '/Roo/Events.php',
1161 '|xns' : 'Roo.data',
1171 'name': 'person_name',
1175 'name': 'event_when',
1177 'dateFormat': 'Y-m-d'
1196 'name': 'person_id',
1204 'name': 'person_id_id',
1208 'name': 'person_id_office_id',
1212 'name': 'person_id_name',
1216 'name': 'person_id_phone',
1220 'name': 'person_id_fax',
1224 'name': 'person_id_email',
1228 'name': 'person_id_company_id',
1232 'name': 'person_id_role',
1236 'name': 'person_id_active',
1240 'name': 'person_id_remarks',
1244 'name': 'person_id_passwd',
1248 'name': 'person_id_owner_id',
1252 'name': 'person_id_lang',
1256 'name': 'person_id_no_reset_sent',
1260 'name': 'person_id_action_type',
1264 'name': 'person_id_project_id',
1268 'name': 'person_id_deleted_by',
1272 'name': 'person_id_deleted_dt',
1278 totalProperty : 'total',
1280 '|xns' : 'Roo.data',
1281 xtype : 'JsonReader'
1285 singleSelect : true,
1287 '|xns' : 'Roo.grid',
1288 xtype : 'RowSelectionModel',
1290 afterselectionchange : function (_self)
1292 // load detail log in _this.viewPanel;
1293 if (!this.getSelected()) {
1294 this.viewPanel.setContent("Nothing Selected");
1297 var id = this.getSelected().data.id;
1298 _this.viewPanel.load( { url : baseURL + "/Admin/EventView/" + id + ".html" });
1305 dataIndex : 'event_when',
1306 header : _this._strings['4e97aeeaa8b15ca1180fcd1f3ac478d1'] /* When */,
1307 renderer : function(v) { return v ? v.dateFormat('d/m/Y H:i') : ''; },
1310 '|xns' : 'Roo.grid',
1311 xtype : 'ColumnModel'
1315 header : _this._strings['1b7f7d24575cdbfadb83b9587fa1bf97'] /* #id */,
1318 '|xns' : 'Roo.grid',
1319 xtype : 'ColumnModel'
1322 dataIndex : 'person_id_name',
1323 header : _this._strings['40bed7cf9b3d4bb3a3d7a7e3eb18c5eb'] /* Person */,
1324 renderer : function(v,x,r) {
1326 var ptable = _this.tableSel.getValue();
1328 var efield = 'person_id_email';
1329 var nfield = 'person_id_name';
1333 ptable != 'Person' &&
1334 typeof(r.data[ptable + '_id_email']) != 'undefined' &&
1335 typeof(r.data[ptable + '_id_name']) != 'undefined'
1337 efield = ptable + '_id_email';
1338 nfield = ptable + '_id_name';
1341 var email = r.data[efield]; // ? r.data.person_id_email : r.data.person_id_email;
1342 var name = r.data[nfield]; // ? r.data.person_id_name : r.data.person_id_name;
1343 return String.format('{0} <<a href="mailto:{1}">{1}</a>>',
1350 '|xns' : 'Roo.grid',
1351 xtype : 'ColumnModel'
1354 dataIndex : 'action',
1355 header : _this._strings['004bf6c9a40003140292e97330236c53'] /* Action */,
1356 renderer : function(v) { return String.format('{0}', v); },
1359 '|xns' : 'Roo.grid',
1360 xtype : 'ColumnModel'
1363 dataIndex : 'ipaddr',
1364 header : _this._strings['a12a3079e14ced46e69ba52b8a90b21a'] /* IP */,
1365 renderer : function(v) { return String.format('{0}', v); },
1368 '|xns' : 'Roo.grid',
1369 xtype : 'ColumnModel'
1372 dataIndex : 'on_table',
1373 header : _this._strings['2c92a9a6a5dbf570825e62eabcdecd8d'] /* Affected */,
1374 renderer : function(v, x, r) {
1375 return v ? String.format('{0}({1})', v, r.data.on_id) : '';
1379 '|xns' : 'Roo.grid',
1380 xtype : 'ColumnModel'
1383 dataIndex : 'remarks',
1384 header : _this._strings['231bc72756b5e6de492aaaa1577f61b1'] /* Remarks */,
1385 renderer : function(v) { return String.format('<span qtip="{1}">{0}</span>', v, Roo.util.Format.htmlEncode(v)); },
1388 '|xns' : 'Roo.grid',
1389 xtype : 'ColumnModel'