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');
263 text : _this._strings['498f79c4c5bbde77f1bceb6c86fd0f6d'] /* Show */,
265 '|xns' : 'Roo.Toolbar',
271 displayField : 'value',
273 emptyText : _this._strings['037fd50b0e85bb65995ca7125d06c7cd'] /* Select Person Table */,
274 forceSelection : true,
276 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
278 name : 'person_table',
280 qtip : _this._strings['037fd50b0e85bb65995ca7125d06c7cd'] /* Select Person Table */,
281 selectOnFocus : true,
282 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{value}</b> </div>',
283 triggerAction : 'all',
285 valueField : 'value',
291 render : function (_self)
293 _this.tableSel = _self;
296 typeof(uiConfig) == 'undefined' ||
297 typeof(uiConfig.events_person_table) == 'undefined' ||
298 !uiConfig.events_person_table.length
304 select : function (combo, record, index)
306 _this.grid.footer.onClick('first');
312 if(typeof(uiConfig) == 'undefined' || typeof(uiConfig.events_person_table) == 'undefined' || !uiConfig.events_person_table.length){
317 return uiConfig.events_person_table;
320 fields : [ 'value' ],
324 xtype : 'SimpleStore'
329 displayField : 'name',
331 emptyText : _this._strings['fd7535ce3979bb8547e2c01689db0767'] /* Select Person */,
332 fieldLabel : _this._strings['42cf593b947cd3d591fa132742486f89'] /* Person */,
333 forceSelection : true,
335 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
337 name : 'person_id_name',
339 qtip : _this._strings['fd7535ce3979bb8547e2c01689db0767'] /* Select Person */,
340 queryParam : 'query[name]',
341 selectOnFocus : true,
342 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> ({company_id_name}) <{email}> </div>',
343 triggerAction : 'all',
351 render : function (_self)
353 _this.personSel = _self;
355 select : function (combo, record, index)
357 _this.grid.footer.onClick('first');
363 sortInfo : { field : 'name' , direction : 'ASC' },
368 beforeload : function (_self, o)
370 o.params = o.params || {};
371 o.params.company_id = Pman.Login.authUser.company_id;
376 url : baseURL + '/Roo/Person.php',
408 'name': 'company_id',
436 'name': 'no_reset_sent',
440 'name': 'action_type',
444 'name': 'project_id',
448 'name': 'deleted_by',
452 'name': 'deleted_dt',
454 'dateFormat': 'Y-m-d'
457 'name': 'office_id_id',
461 'name': 'office_id_company_id',
465 'name': 'office_id_name',
469 'name': 'office_id_address',
473 'name': 'office_id_phone',
477 'name': 'office_id_fax',
481 'name': 'office_id_email',
485 'name': 'office_id_role',
489 'name': 'company_id_code',
493 'name': 'company_id_name',
497 'name': 'company_id_remarks',
501 'name': 'company_id_owner_id',
505 'name': 'company_id_address',
509 'name': 'company_id_tel',
513 'name': 'company_id_fax',
517 'name': 'company_id_email',
521 'name': 'company_id_id',
525 'name': 'company_id_isOwner',
529 'name': 'company_id_logo_id',
533 'name': 'company_id_background_color',
537 'name': 'company_id_comptype',
541 'name': 'company_id_url',
545 'name': 'company_id_main_office_id',
549 'name': 'company_id_created_by',
553 'name': 'company_id_created_dt',
557 'name': 'company_id_updated_by',
561 'name': 'company_id_updated_dt',
565 'name': 'company_id_passwd',
569 'name': 'company_id_dispatch_port',
573 'name': 'company_id_province',
577 'name': 'company_id_country',
581 'name': 'project_id_id',
585 'name': 'project_id_name',
589 'name': 'project_id_remarks',
593 'name': 'project_id_owner_id',
597 'name': 'project_id_code',
601 'name': 'project_id_active',
605 'name': 'project_id_type',
609 'name': 'project_id_client_id',
613 'name': 'project_id_team_id',
617 'name': 'project_id_file_location',
621 'name': 'project_id_open_date',
625 'name': 'project_id_open_by',
629 'name': 'project_id_close_date',
633 'name': 'project_id_countries',
637 'name': 'project_id_languages',
641 'name': 'project_id_agency_id',
645 'name': 'owner_id_id',
649 'name': 'owner_id_office_id',
653 'name': 'owner_id_name',
657 'name': 'owner_id_phone',
661 'name': 'owner_id_fax',
665 'name': 'owner_id_email',
669 'name': 'owner_id_company_id',
673 'name': 'owner_id_role',
677 'name': 'owner_id_active',
681 'name': 'owner_id_remarks',
685 'name': 'owner_id_passwd',
689 'name': 'owner_id_owner_id',
693 'name': 'owner_id_lang',
697 'name': 'owner_id_no_reset_sent',
701 'name': 'owner_id_action_type',
705 'name': 'owner_id_project_id',
709 'name': 'owner_id_deleted_by',
713 'name': 'owner_id_deleted_dt',
719 totalProperty : 'total',
728 displayField : 'action',
730 emptyText : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
731 forceSelection : true,
733 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
737 qtip : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
738 queryParam : 'query[action]',
739 selectOnFocus : true,
740 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{action}</b> </div>',
741 triggerAction : 'all',
743 valueField : 'action',
749 render : function (_self)
751 _this.actionSel = _self;
753 select : function (combo, record, index)
755 _this.grid.footer.onClick('first');
760 sortInfo : { field : 'action' , direction : 'ASC' },
765 beforeload : function (_self, o)
767 o.params = o.params || {};
768 // staff can see all logs, other companies can only see their own.
769 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
770 o.params.company_id = Pman.Login.authUser.company_id;
772 o.params._distinct = 'action';
773 o.params._columns ='action';
778 url : baseURL + '/Roo/Events.php',
790 'name': 'person_name',
794 'name': 'event_when',
796 'dateFormat': 'Y-m-d'
823 'name': 'person_id_id',
827 'name': 'person_id_office_id',
831 'name': 'person_id_name',
835 'name': 'person_id_phone',
839 'name': 'person_id_fax',
843 'name': 'person_id_email',
847 'name': 'person_id_company_id',
851 'name': 'person_id_role',
855 'name': 'person_id_active',
859 'name': 'person_id_remarks',
863 'name': 'person_id_passwd',
867 'name': 'person_id_owner_id',
871 'name': 'person_id_lang',
875 'name': 'person_id_no_reset_sent',
879 'name': 'person_id_action_type',
883 'name': 'person_id_project_id',
887 'name': 'person_id_deleted_by',
891 'name': 'person_id_deleted_dt',
897 totalProperty : 'total',
906 displayField : 'on_table',
908 emptyText : _this._strings['679308a758de538c5f39c4c6cdba6593'] /* Select Affects */,
909 forceSelection : true,
911 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
915 qtip : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
916 queryParam : 'query[on_table]',
917 selectOnFocus : true,
918 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{on_table}</b> </div>',
919 triggerAction : 'all',
921 valueField : 'action',
927 render : function (_self)
929 _this.affectSel = _self;
931 if(!Pman.hasPerm('Admin.Logs_Affects', 'S')){
935 select : function (combo, record, index)
937 _this.grid.footer.onClick('first');
942 sortInfo : { field : 'on_table' , direction : 'ASC' },
947 beforeload : function (_self, o)
949 o.params = o.params || {};
950 // staff can see all logs, other companies can only see their own.
951 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
952 o.params.company_id = Pman.Login.authUser.company_id;
954 o.params._distinct = 'on_table';
955 o.params._columns ='on_table';
960 url : baseURL + '/Roo/Events.php',
972 'name': 'person_name',
976 'name': 'event_when',
978 'dateFormat': 'Y-m-d'
1005 'name': 'person_id_id',
1009 'name': 'person_id_office_id',
1013 'name': 'person_id_name',
1017 'name': 'person_id_phone',
1021 'name': 'person_id_fax',
1025 'name': 'person_id_email',
1029 'name': 'person_id_company_id',
1033 'name': 'person_id_role',
1037 'name': 'person_id_active',
1041 'name': 'person_id_remarks',
1045 'name': 'person_id_passwd',
1049 'name': 'person_id_owner_id',
1053 'name': 'person_id_lang',
1057 'name': 'person_id_no_reset_sent',
1061 'name': 'person_id_action_type',
1065 'name': 'person_id_project_id',
1069 'name': 'person_id_deleted_by',
1073 'name': 'person_id_deleted_dt',
1079 totalProperty : 'total',
1081 '|xns' : 'Roo.data',
1082 xtype : 'JsonReader'
1087 text : _this._strings['39b9e051f9fe75e65c7a330bb00499d4'] /* Date Range */,
1089 '|xns' : 'Roo.Toolbar',
1095 '|xns' : 'Roo.form',
1096 xtype : 'DateField',
1098 change : function (_self, newValue, oldValue)
1100 _this.grid.footer.onClick('first');
1102 render : function (_self)
1104 _this.dateFrom = _self;
1111 '|xns' : 'Roo.form',
1112 xtype : 'DateField',
1114 change : function (_self, newValue, oldValue)
1116 _this.grid.footer.onClick('first');
1118 render : function (_self)
1120 _this.dateTo = _self;
1128 sortInfo : { field: 'event_when', direction: 'DESC'},
1130 '|xns' : 'Roo.data',
1133 beforeload : function (_self, o)
1135 if (!Pman.buildCompleted) {
1140 if (! _this.personSel) {
1143 o.params = o.params || {};
1144 o.params.person_id = _this.personSel.getValue();
1145 o.params.person_table = _this.tableSel.getValue();
1146 var act = _this.actionSel.getValue();
1148 o.params.action = act;
1150 var tbl = _this.affectSel.getValue();
1152 o.params.on_table = tbl;
1154 act = _this.dateFrom.getValue();
1156 o.params['query[from]'] = act.format('Y-m-d');
1158 act = _this.dateTo.getValue();
1160 o.params['query[to]'] = act.format('Y-m-d');
1165 act = _this.groupedCombo.getValue();
1166 o.params['query[grouped]'] = act;
1167 if (o.params['query[grouped]'] == 'gr') {
1170 Roo.MessageBox.alert("Error", "Select a table to group results on");
1173 // o.params['_columns'] =
1174 o.params['_distinct'] = 'on_id';
1186 url : baseURL + '/Roo/Events.php',
1188 '|xns' : 'Roo.data',
1198 'name': 'person_name',
1202 'name': 'event_when',
1204 'dateFormat': 'Y-m-d'
1223 'name': 'person_id',
1231 'name': 'person_id_id',
1235 'name': 'person_id_office_id',
1239 'name': 'person_id_name',
1243 'name': 'person_id_phone',
1247 'name': 'person_id_fax',
1251 'name': 'person_id_email',
1255 'name': 'person_id_company_id',
1259 'name': 'person_id_role',
1263 'name': 'person_id_active',
1267 'name': 'person_id_remarks',
1271 'name': 'person_id_passwd',
1275 'name': 'person_id_owner_id',
1279 'name': 'person_id_lang',
1283 'name': 'person_id_no_reset_sent',
1287 'name': 'person_id_action_type',
1291 'name': 'person_id_project_id',
1295 'name': 'person_id_deleted_by',
1299 'name': 'person_id_deleted_dt',
1305 totalProperty : 'total',
1307 '|xns' : 'Roo.data',
1308 xtype : 'JsonReader'
1312 singleSelect : true,
1314 '|xns' : 'Roo.grid',
1315 xtype : 'RowSelectionModel',
1317 afterselectionchange : function (_self)
1319 // load detail log in _this.viewPanel;
1320 if (!this.getSelected()) {
1321 this.viewPanel.setContent("Nothing Selected");
1324 var id = this.getSelected().data.id;
1325 _this.viewPanel.load( { url : baseURL + "/Admin/EventView/" + id + ".html" });
1332 dataIndex : 'event_when',
1333 header : _this._strings['4e97aeeaa8b15ca1180fcd1f3ac478d1'] /* When */,
1334 renderer : function(v) { return v ? v.dateFormat('d/m/Y H:i') : ''; },
1337 '|xns' : 'Roo.grid',
1338 xtype : 'ColumnModel'
1342 header : _this._strings['1b7f7d24575cdbfadb83b9587fa1bf97'] /* #id */,
1345 '|xns' : 'Roo.grid',
1346 xtype : 'ColumnModel'
1349 dataIndex : 'person_id_name',
1350 header : _this._strings['40bed7cf9b3d4bb3a3d7a7e3eb18c5eb'] /* Person */,
1351 renderer : function(v,x,r) {
1353 var ptable = _this.tableSel.getValue();
1355 var efield = 'person_id_email';
1356 var nfield = 'person_id_name';
1360 ptable != 'Person' &&
1361 typeof(r.data[ptable + '_id_email']) != 'undefined' &&
1362 typeof(r.data[ptable + '_id_name']) != 'undefined'
1364 efield = ptable + '_id_email';
1365 nfield = ptable + '_id_name';
1368 var email = r.data[efield]; // ? r.data.person_id_email : r.data.person_id_email;
1369 var name = r.data[nfield]; // ? r.data.person_id_name : r.data.person_id_name;
1370 return String.format('{0} <<a href="mailto:{1}">{1}</a>>',
1377 '|xns' : 'Roo.grid',
1378 xtype : 'ColumnModel'
1381 dataIndex : 'action',
1382 header : _this._strings['004bf6c9a40003140292e97330236c53'] /* Action */,
1383 renderer : function(v) { return String.format('{0}', v); },
1386 '|xns' : 'Roo.grid',
1387 xtype : 'ColumnModel'
1390 dataIndex : 'ipaddr',
1391 header : _this._strings['a12a3079e14ced46e69ba52b8a90b21a'] /* IP */,
1392 renderer : function(v) { return String.format('{0}', v); },
1395 '|xns' : 'Roo.grid',
1396 xtype : 'ColumnModel'
1399 dataIndex : 'on_table',
1400 header : _this._strings['2c92a9a6a5dbf570825e62eabcdecd8d'] /* Affected */,
1401 renderer : function(v, x, r) {
1402 return v ? String.format('{0}({1})', v, r.data.on_id) : '';
1406 '|xns' : 'Roo.grid',
1407 xtype : 'ColumnModel'
1410 dataIndex : 'remarks',
1411 header : _this._strings['231bc72756b5e6de492aaaa1577f61b1'] /* Remarks */,
1412 renderer : function(v) { return String.format('<span qtip="{1}">{0}</span>', v, Roo.util.Format.htmlEncode(v)); },
1415 '|xns' : 'Roo.grid',
1416 xtype : 'ColumnModel'