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 o.params.company_id = Pman.Login.authUser.company_id;
388 url : baseURL + '/Roo/Person.php',
420 'name': 'company_id',
448 'name': 'no_reset_sent',
452 'name': 'action_type',
456 'name': 'project_id',
460 'name': 'deleted_by',
464 'name': 'deleted_dt',
466 'dateFormat': 'Y-m-d'
469 'name': 'office_id_id',
473 'name': 'office_id_company_id',
477 'name': 'office_id_name',
481 'name': 'office_id_address',
485 'name': 'office_id_phone',
489 'name': 'office_id_fax',
493 'name': 'office_id_email',
497 'name': 'office_id_role',
501 'name': 'company_id_code',
505 'name': 'company_id_name',
509 'name': 'company_id_remarks',
513 'name': 'company_id_owner_id',
517 'name': 'company_id_address',
521 'name': 'company_id_tel',
525 'name': 'company_id_fax',
529 'name': 'company_id_email',
533 'name': 'company_id_id',
537 'name': 'company_id_isOwner',
541 'name': 'company_id_logo_id',
545 'name': 'company_id_background_color',
549 'name': 'company_id_comptype',
553 'name': 'company_id_url',
557 'name': 'company_id_main_office_id',
561 'name': 'company_id_created_by',
565 'name': 'company_id_created_dt',
569 'name': 'company_id_updated_by',
573 'name': 'company_id_updated_dt',
577 'name': 'company_id_passwd',
581 'name': 'company_id_dispatch_port',
585 'name': 'company_id_province',
589 'name': 'company_id_country',
593 'name': 'project_id_id',
597 'name': 'project_id_name',
601 'name': 'project_id_remarks',
605 'name': 'project_id_owner_id',
609 'name': 'project_id_code',
613 'name': 'project_id_active',
617 'name': 'project_id_type',
621 'name': 'project_id_client_id',
625 'name': 'project_id_team_id',
629 'name': 'project_id_file_location',
633 'name': 'project_id_open_date',
637 'name': 'project_id_open_by',
641 'name': 'project_id_close_date',
645 'name': 'project_id_countries',
649 'name': 'project_id_languages',
653 'name': 'project_id_agency_id',
657 'name': 'owner_id_id',
661 'name': 'owner_id_office_id',
665 'name': 'owner_id_name',
669 'name': 'owner_id_phone',
673 'name': 'owner_id_fax',
677 'name': 'owner_id_email',
681 'name': 'owner_id_company_id',
685 'name': 'owner_id_role',
689 'name': 'owner_id_active',
693 'name': 'owner_id_remarks',
697 'name': 'owner_id_passwd',
701 'name': 'owner_id_owner_id',
705 'name': 'owner_id_lang',
709 'name': 'owner_id_no_reset_sent',
713 'name': 'owner_id_action_type',
717 'name': 'owner_id_project_id',
721 'name': 'owner_id_deleted_by',
725 'name': 'owner_id_deleted_dt',
731 totalProperty : 'total',
740 displayField : 'action',
742 emptyText : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
743 forceSelection : true,
745 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
749 qtip : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
750 queryParam : 'query[action]',
751 selectOnFocus : true,
752 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{action}</b> </div>',
753 triggerAction : 'all',
755 valueField : 'action',
761 render : function (_self)
763 _this.actionSel = _self;
765 select : function (combo, record, index)
767 _this.grid.footer.onClick('first');
772 sortInfo : { field : 'action' , direction : 'ASC' },
777 beforeload : function (_self, o)
779 o.params = o.params || {};
780 // staff can see all logs, other companies can only see their own.
781 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
782 o.params.company_id = Pman.Login.authUser.company_id;
784 o.params._distinct = 'action';
785 o.params._columns ='action';
790 url : baseURL + '/Roo/Events.php',
802 'name': 'person_name',
806 'name': 'event_when',
808 'dateFormat': 'Y-m-d'
835 'name': 'person_id_id',
839 'name': 'person_id_office_id',
843 'name': 'person_id_name',
847 'name': 'person_id_phone',
851 'name': 'person_id_fax',
855 'name': 'person_id_email',
859 'name': 'person_id_company_id',
863 'name': 'person_id_role',
867 'name': 'person_id_active',
871 'name': 'person_id_remarks',
875 'name': 'person_id_passwd',
879 'name': 'person_id_owner_id',
883 'name': 'person_id_lang',
887 'name': 'person_id_no_reset_sent',
891 'name': 'person_id_action_type',
895 'name': 'person_id_project_id',
899 'name': 'person_id_deleted_by',
903 'name': 'person_id_deleted_dt',
909 totalProperty : 'total',
918 displayField : 'on_table',
920 emptyText : _this._strings['679308a758de538c5f39c4c6cdba6593'] /* Select Affects */,
921 forceSelection : true,
923 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
927 qtip : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
928 queryParam : 'query[on_table]',
929 selectOnFocus : true,
930 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{on_table}</b> </div>',
931 triggerAction : 'all',
933 valueField : 'action',
939 render : function (_self)
941 _this.affectSel = _self;
943 if(!Pman.hasPerm('Admin.Logs_Affects', 'S')){
947 select : function (combo, record, index)
949 _this.grid.footer.onClick('first');
954 sortInfo : { field : 'on_table' , direction : 'ASC' },
959 beforeload : function (_self, o)
961 o.params = o.params || {};
962 // staff can see all logs, other companies can only see their own.
963 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
964 o.params.company_id = Pman.Login.authUser.company_id;
966 o.params._distinct = 'on_table';
967 o.params._columns ='on_table';
972 url : baseURL + '/Roo/Events.php',
984 'name': 'person_name',
988 'name': 'event_when',
990 'dateFormat': 'Y-m-d'
1009 'name': 'person_id',
1017 'name': 'person_id_id',
1021 'name': 'person_id_office_id',
1025 'name': 'person_id_name',
1029 'name': 'person_id_phone',
1033 'name': 'person_id_fax',
1037 'name': 'person_id_email',
1041 'name': 'person_id_company_id',
1045 'name': 'person_id_role',
1049 'name': 'person_id_active',
1053 'name': 'person_id_remarks',
1057 'name': 'person_id_passwd',
1061 'name': 'person_id_owner_id',
1065 'name': 'person_id_lang',
1069 'name': 'person_id_no_reset_sent',
1073 'name': 'person_id_action_type',
1077 'name': 'person_id_project_id',
1081 'name': 'person_id_deleted_by',
1085 'name': 'person_id_deleted_dt',
1091 totalProperty : 'total',
1093 '|xns' : 'Roo.data',
1094 xtype : 'JsonReader'
1099 text : _this._strings['39b9e051f9fe75e65c7a330bb00499d4'] /* Date Range */,
1101 '|xns' : 'Roo.Toolbar',
1107 '|xns' : 'Roo.form',
1108 xtype : 'DateField',
1110 change : function (_self, newValue, oldValue)
1112 _this.grid.footer.onClick('first');
1114 render : function (_self)
1116 _this.dateFrom = _self;
1123 '|xns' : 'Roo.form',
1124 xtype : 'DateField',
1126 change : function (_self, newValue, oldValue)
1128 _this.grid.footer.onClick('first');
1130 render : function (_self)
1132 _this.dateTo = _self;
1140 sortInfo : { field: 'event_when', direction: 'DESC'},
1142 '|xns' : 'Roo.data',
1145 beforeload : function (_self, o)
1147 if (!Pman.buildCompleted) {
1152 if (! _this.personSel) {
1155 o.params = o.params || {};
1156 o.params.person_id = _this.personSel.getValue();
1157 o.params.person_table = _this.tableSel.getValue();
1158 var act = _this.actionSel.getValue();
1160 o.params.action = act;
1162 var tbl = _this.affectSel.getValue();
1164 o.params.on_table = tbl;
1166 act = _this.dateFrom.getValue();
1168 o.params['query[from]'] = act.format('Y-m-d');
1170 act = _this.dateTo.getValue();
1172 o.params['query[to]'] = act.format('Y-m-d');
1177 act = _this.groupedCombo.getValue();
1178 o.params['query[grouped]'] = act;
1179 if (o.params['query[grouped]'] == 'gr') {
1182 Roo.MessageBox.alert("Error", "Select a table to group results on");
1185 // o.params['_columns'] =
1186 o.params['_distinct'] = 'on_id';
1198 url : baseURL + '/Roo/Events.php',
1200 '|xns' : 'Roo.data',
1210 'name': 'person_name',
1214 'name': 'event_when',
1216 'dateFormat': 'Y-m-d'
1235 'name': 'person_id',
1243 'name': 'person_id_id',
1247 'name': 'person_id_office_id',
1251 'name': 'person_id_name',
1255 'name': 'person_id_phone',
1259 'name': 'person_id_fax',
1263 'name': 'person_id_email',
1267 'name': 'person_id_company_id',
1271 'name': 'person_id_role',
1275 'name': 'person_id_active',
1279 'name': 'person_id_remarks',
1283 'name': 'person_id_passwd',
1287 'name': 'person_id_owner_id',
1291 'name': 'person_id_lang',
1295 'name': 'person_id_no_reset_sent',
1299 'name': 'person_id_action_type',
1303 'name': 'person_id_project_id',
1307 'name': 'person_id_deleted_by',
1311 'name': 'person_id_deleted_dt',
1317 totalProperty : 'total',
1319 '|xns' : 'Roo.data',
1320 xtype : 'JsonReader'
1324 singleSelect : true,
1326 '|xns' : 'Roo.grid',
1327 xtype : 'RowSelectionModel',
1329 afterselectionchange : function (_self)
1331 // load detail log in _this.viewPanel;
1332 if (!this.getSelected()) {
1333 this.viewPanel.setContent("Nothing Selected");
1336 var id = this.getSelected().data.id;
1337 _this.viewPanel.load( { url : baseURL + "/Admin/EventView/" + id + ".html" });
1344 dataIndex : 'event_when',
1345 header : _this._strings['4e97aeeaa8b15ca1180fcd1f3ac478d1'] /* When */,
1346 renderer : function(v) { return v ? v.dateFormat('d/m/Y H:i') : ''; },
1349 '|xns' : 'Roo.grid',
1350 xtype : 'ColumnModel'
1354 header : _this._strings['1b7f7d24575cdbfadb83b9587fa1bf97'] /* #id */,
1357 '|xns' : 'Roo.grid',
1358 xtype : 'ColumnModel'
1361 dataIndex : 'person_id_name',
1362 header : _this._strings['40bed7cf9b3d4bb3a3d7a7e3eb18c5eb'] /* Person */,
1363 renderer : function(v,x,r) {
1365 var ptable = _this.tableSel.getValue();
1367 var efield = 'person_id_email';
1368 var nfield = 'person_id_name';
1372 ptable != 'Person' &&
1373 typeof(r.data[ptable + '_id_email']) != 'undefined' &&
1374 typeof(r.data[ptable + '_id_name']) != 'undefined'
1376 efield = ptable + '_id_email';
1377 nfield = ptable + '_id_name';
1380 var email = r.data[efield]; // ? r.data.person_id_email : r.data.person_id_email;
1381 var name = r.data[nfield]; // ? r.data.person_id_name : r.data.person_id_name;
1382 return String.format('{0} <<a href="mailto:{1}">{1}</a>>',
1389 '|xns' : 'Roo.grid',
1390 xtype : 'ColumnModel'
1393 dataIndex : 'action',
1394 header : _this._strings['004bf6c9a40003140292e97330236c53'] /* Action */,
1395 renderer : function(v) { return String.format('{0}', v); },
1398 '|xns' : 'Roo.grid',
1399 xtype : 'ColumnModel'
1402 dataIndex : 'ipaddr',
1403 header : _this._strings['a12a3079e14ced46e69ba52b8a90b21a'] /* IP */,
1404 renderer : function(v) { return String.format('{0}', v); },
1407 '|xns' : 'Roo.grid',
1408 xtype : 'ColumnModel'
1411 dataIndex : 'on_table',
1412 header : _this._strings['2c92a9a6a5dbf570825e62eabcdecd8d'] /* Affected */,
1413 renderer : function(v, x, r) {
1414 return v ? String.format('{0}({1})', v, r.data.on_id) : '';
1418 '|xns' : 'Roo.grid',
1419 xtype : 'ColumnModel'
1422 dataIndex : 'remarks',
1423 header : _this._strings['231bc72756b5e6de492aaaa1577f61b1'] /* Remarks */,
1424 renderer : function(v) { return String.format('<span qtip="{1}">{0}</span>', v, Roo.util.Format.htmlEncode(v)); },
1427 '|xns' : 'Roo.grid',
1428 xtype : 'ColumnModel'