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]' : 'When', 'csvCols[0]' : 'event_when',
191 'csvTitles[1]' : 'Staff', 'csvCols[1]' : 'person_id_name',
192 'csvTitles[2]' : 'Action', 'csvCols[2]' : 'action',
193 'csvTitles[3]' : 'Record ID', 'csvCols[3]' : 'on_id' ,
194 'csvTitles[4]' : 'Record Type', 'csvCols[4]' : 'on_table',
195 'csvTitles[5]' : 'Remarks', 'csvCols[5]' : 'remarks'
198 params.person_id = _this.personSel.getValue();
199 var act = _this.actionSel.getValue();
203 var tbl = _this.affectSel.getValue();
205 params.on_table = tbl;
207 act = _this.dateFrom.getValue();
209 params['query[from]'] = act.format('Y-m-d');
211 act = _this.dateTo.getValue();
213 params['query[to]'] = act.format('Y-m-d');
219 url : baseURL + '/Roo/Events.php',
235 text : _this._strings['498f79c4c5bbde77f1bceb6c86fd0f6d'] /* Show */,
237 '|xns' : 'Roo.Toolbar',
243 displayField : 'value',
245 emptyText : _this._strings['037fd50b0e85bb65995ca7125d06c7cd'] /* Select Person Table */,
246 forceSelection : true,
248 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
250 name : 'person_table',
252 qtip : _this._strings['037fd50b0e85bb65995ca7125d06c7cd'] /* Select Person Table */,
253 selectOnFocus : true,
254 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{value}</b> </div>',
255 triggerAction : 'all',
257 valueField : 'value',
263 render : function (_self)
265 _this.tableSel = _self;
268 typeof(uiConfig) == 'undefined' ||
269 typeof(uiConfig.events_person_table) == 'undefined' ||
270 !uiConfig.events_person_table.length
276 select : function (combo, record, index)
278 _this.grid.footer.onClick('first');
284 if(typeof(uiConfig) == 'undefined' || typeof(uiConfig.events_person_table) == 'undefined' || !uiConfig.events_person_table.length){
289 return uiConfig.events_person_table;
292 fields : [ 'value' ],
296 xtype : 'SimpleStore'
301 displayField : 'name',
303 emptyText : _this._strings['fd7535ce3979bb8547e2c01689db0767'] /* Select Person */,
304 fieldLabel : _this._strings['42cf593b947cd3d591fa132742486f89'] /* Person */,
305 forceSelection : true,
307 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
309 name : 'person_id_name',
311 qtip : _this._strings['fd7535ce3979bb8547e2c01689db0767'] /* Select Person */,
312 queryParam : 'query[name]',
313 selectOnFocus : true,
314 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> ({company_id_name}) <{email}> </div>',
315 triggerAction : 'all',
323 render : function (_self)
325 _this.personSel = _self;
327 select : function (combo, record, index)
329 _this.grid.footer.onClick('first');
335 sortInfo : { field : 'name' , direction : 'ASC' },
340 beforeload : function (_self, o)
342 o.params = o.params || {};
343 o.params.company_id = Pman.Login.authUser.company_id;
348 url : baseURL + '/Roo/Person.php',
380 'name': 'company_id',
408 'name': 'no_reset_sent',
412 'name': 'action_type',
416 'name': 'project_id',
420 'name': 'deleted_by',
424 'name': 'deleted_dt',
426 'dateFormat': 'Y-m-d'
429 'name': 'office_id_id',
433 'name': 'office_id_company_id',
437 'name': 'office_id_name',
441 'name': 'office_id_address',
445 'name': 'office_id_phone',
449 'name': 'office_id_fax',
453 'name': 'office_id_email',
457 'name': 'office_id_role',
461 'name': 'company_id_code',
465 'name': 'company_id_name',
469 'name': 'company_id_remarks',
473 'name': 'company_id_owner_id',
477 'name': 'company_id_address',
481 'name': 'company_id_tel',
485 'name': 'company_id_fax',
489 'name': 'company_id_email',
493 'name': 'company_id_id',
497 'name': 'company_id_isOwner',
501 'name': 'company_id_logo_id',
505 'name': 'company_id_background_color',
509 'name': 'company_id_comptype',
513 'name': 'company_id_url',
517 'name': 'company_id_main_office_id',
521 'name': 'company_id_created_by',
525 'name': 'company_id_created_dt',
529 'name': 'company_id_updated_by',
533 'name': 'company_id_updated_dt',
537 'name': 'company_id_passwd',
541 'name': 'company_id_dispatch_port',
545 'name': 'company_id_province',
549 'name': 'company_id_country',
553 'name': 'project_id_id',
557 'name': 'project_id_name',
561 'name': 'project_id_remarks',
565 'name': 'project_id_owner_id',
569 'name': 'project_id_code',
573 'name': 'project_id_active',
577 'name': 'project_id_type',
581 'name': 'project_id_client_id',
585 'name': 'project_id_team_id',
589 'name': 'project_id_file_location',
593 'name': 'project_id_open_date',
597 'name': 'project_id_open_by',
601 'name': 'project_id_close_date',
605 'name': 'project_id_countries',
609 'name': 'project_id_languages',
613 'name': 'project_id_agency_id',
617 'name': 'owner_id_id',
621 'name': 'owner_id_office_id',
625 'name': 'owner_id_name',
629 'name': 'owner_id_phone',
633 'name': 'owner_id_fax',
637 'name': 'owner_id_email',
641 'name': 'owner_id_company_id',
645 'name': 'owner_id_role',
649 'name': 'owner_id_active',
653 'name': 'owner_id_remarks',
657 'name': 'owner_id_passwd',
661 'name': 'owner_id_owner_id',
665 'name': 'owner_id_lang',
669 'name': 'owner_id_no_reset_sent',
673 'name': 'owner_id_action_type',
677 'name': 'owner_id_project_id',
681 'name': 'owner_id_deleted_by',
685 'name': 'owner_id_deleted_dt',
691 totalProperty : 'total',
700 displayField : 'action',
702 emptyText : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
703 forceSelection : true,
705 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
709 qtip : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
710 queryParam : 'query[action]',
711 selectOnFocus : true,
712 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{action}</b> </div>',
713 triggerAction : 'all',
715 valueField : 'action',
721 render : function (_self)
723 _this.actionSel = _self;
725 select : function (combo, record, index)
727 _this.grid.footer.onClick('first');
732 sortInfo : { field : 'action' , direction : 'ASC' },
737 beforeload : function (_self, o)
739 o.params = o.params || {};
740 // staff can see all logs, other companies can only see their own.
741 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
742 o.params.company_id = Pman.Login.authUser.company_id;
744 o.params._distinct = 'action';
745 o.params._columns ='action';
750 url : baseURL + '/Roo/Events.php',
762 'name': 'person_name',
766 'name': 'event_when',
768 'dateFormat': 'Y-m-d'
795 'name': 'person_id_id',
799 'name': 'person_id_office_id',
803 'name': 'person_id_name',
807 'name': 'person_id_phone',
811 'name': 'person_id_fax',
815 'name': 'person_id_email',
819 'name': 'person_id_company_id',
823 'name': 'person_id_role',
827 'name': 'person_id_active',
831 'name': 'person_id_remarks',
835 'name': 'person_id_passwd',
839 'name': 'person_id_owner_id',
843 'name': 'person_id_lang',
847 'name': 'person_id_no_reset_sent',
851 'name': 'person_id_action_type',
855 'name': 'person_id_project_id',
859 'name': 'person_id_deleted_by',
863 'name': 'person_id_deleted_dt',
869 totalProperty : 'total',
878 displayField : 'on_table',
880 emptyText : _this._strings['679308a758de538c5f39c4c6cdba6593'] /* Select Affects */,
881 forceSelection : true,
883 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
887 qtip : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
888 queryParam : 'query[on_table]',
889 selectOnFocus : true,
890 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{on_table}</b> </div>',
891 triggerAction : 'all',
893 valueField : 'action',
899 render : function (_self)
901 _this.affectSel = _self;
903 if(!Pman.hasPerm('Admin.Logs_Affects', 'S')){
907 select : function (combo, record, index)
909 _this.grid.footer.onClick('first');
914 sortInfo : { field : 'on_table' , direction : 'ASC' },
919 beforeload : function (_self, o)
921 o.params = o.params || {};
922 // staff can see all logs, other companies can only see their own.
923 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
924 o.params.company_id = Pman.Login.authUser.company_id;
926 o.params._distinct = 'on_table';
927 o.params._columns ='on_table';
932 url : baseURL + '/Roo/Events.php',
944 'name': 'person_name',
948 'name': 'event_when',
950 'dateFormat': 'Y-m-d'
977 'name': 'person_id_id',
981 'name': 'person_id_office_id',
985 'name': 'person_id_name',
989 'name': 'person_id_phone',
993 'name': 'person_id_fax',
997 'name': 'person_id_email',
1001 'name': 'person_id_company_id',
1005 'name': 'person_id_role',
1009 'name': 'person_id_active',
1013 'name': 'person_id_remarks',
1017 'name': 'person_id_passwd',
1021 'name': 'person_id_owner_id',
1025 'name': 'person_id_lang',
1029 'name': 'person_id_no_reset_sent',
1033 'name': 'person_id_action_type',
1037 'name': 'person_id_project_id',
1041 'name': 'person_id_deleted_by',
1045 'name': 'person_id_deleted_dt',
1051 totalProperty : 'total',
1053 '|xns' : 'Roo.data',
1054 xtype : 'JsonReader'
1059 text : _this._strings['39b9e051f9fe75e65c7a330bb00499d4'] /* Date Range */,
1061 '|xns' : 'Roo.Toolbar',
1067 '|xns' : 'Roo.form',
1068 xtype : 'DateField',
1070 change : function (_self, newValue, oldValue)
1072 _this.grid.footer.onClick('first');
1074 render : function (_self)
1076 _this.dateFrom = _self;
1083 '|xns' : 'Roo.form',
1084 xtype : 'DateField',
1086 change : function (_self, newValue, oldValue)
1088 _this.grid.footer.onClick('first');
1090 render : function (_self)
1092 _this.dateTo = _self;
1100 sortInfo : { field: 'event_when', direction: 'DESC'},
1102 '|xns' : 'Roo.data',
1105 beforeload : function (_self, o)
1107 if (!Pman.buildCompleted) {
1112 if (! _this.personSel) {
1115 o.params = o.params || {};
1116 o.params.person_id = _this.personSel.getValue();
1117 o.params.person_table = _this.tableSel.getValue();
1118 var act = _this.actionSel.getValue();
1120 o.params.action = act;
1122 var tbl = _this.affectSel.getValue();
1124 o.params.on_table = tbl;
1126 act = _this.dateFrom.getValue();
1128 o.params['query[from]'] = act.format('Y-m-d');
1130 act = _this.dateTo.getValue();
1132 o.params['query[to]'] = act.format('Y-m-d');
1137 act = _this.groupedCombo.getValue();
1138 o.params['query[grouped]'] = act;
1139 if (o.params['query[grouped]'] == 'gr') {
1142 Roo.MessageBox.alert("Error", "Select a table to group results on");
1145 // o.params['_columns'] =
1146 o.params['_distinct'] = 'on_id';
1158 url : baseURL + '/Roo/Events.php',
1160 '|xns' : 'Roo.data',
1170 'name': 'person_name',
1174 'name': 'event_when',
1176 'dateFormat': 'Y-m-d'
1195 'name': 'person_id',
1203 'name': 'person_id_id',
1207 'name': 'person_id_office_id',
1211 'name': 'person_id_name',
1215 'name': 'person_id_phone',
1219 'name': 'person_id_fax',
1223 'name': 'person_id_email',
1227 'name': 'person_id_company_id',
1231 'name': 'person_id_role',
1235 'name': 'person_id_active',
1239 'name': 'person_id_remarks',
1243 'name': 'person_id_passwd',
1247 'name': 'person_id_owner_id',
1251 'name': 'person_id_lang',
1255 'name': 'person_id_no_reset_sent',
1259 'name': 'person_id_action_type',
1263 'name': 'person_id_project_id',
1267 'name': 'person_id_deleted_by',
1271 'name': 'person_id_deleted_dt',
1277 totalProperty : 'total',
1279 '|xns' : 'Roo.data',
1280 xtype : 'JsonReader'
1284 singleSelect : true,
1286 '|xns' : 'Roo.grid',
1287 xtype : 'RowSelectionModel',
1289 afterselectionchange : function (_self)
1291 // load detail log in _this.viewPanel;
1292 if (!this.getSelected()) {
1293 this.viewPanel.setContent("Nothing Selected");
1296 var id = this.getSelected().data.id;
1297 _this.viewPanel.load( { url : baseURL + "/Admin/EventView/" + id + ".html" });
1304 dataIndex : 'event_when',
1305 header : _this._strings['4e97aeeaa8b15ca1180fcd1f3ac478d1'] /* When */,
1306 renderer : function(v) { return v ? v.dateFormat('d/m/Y H:i') : ''; },
1309 '|xns' : 'Roo.grid',
1310 xtype : 'ColumnModel'
1314 header : _this._strings['1b7f7d24575cdbfadb83b9587fa1bf97'] /* #id */,
1317 '|xns' : 'Roo.grid',
1318 xtype : 'ColumnModel'
1321 dataIndex : 'person_id_name',
1322 header : _this._strings['40bed7cf9b3d4bb3a3d7a7e3eb18c5eb'] /* Person */,
1323 renderer : function(v,x,r) {
1325 var ptable = _this.tableSel.getValue();
1327 var efield = 'person_id_email';
1328 var nfield = 'person_id_name';
1332 ptable != 'Person' &&
1333 typeof(r.data[ptable + '_id_email']) != 'undefined' &&
1334 typeof(r.data[ptable + '_id_name']) != 'undefined'
1336 efield = ptable + '_id_email';
1337 nfield = ptable + '_id_name';
1340 var email = r.data[efield]; // ? r.data.person_id_email : r.data.person_id_email;
1341 var name = r.data[nfield]; // ? r.data.person_id_name : r.data.person_id_name;
1342 return String.format('{0} <<a href="mailto:{1}">{1}</a>>',
1349 '|xns' : 'Roo.grid',
1350 xtype : 'ColumnModel'
1353 dataIndex : 'action',
1354 header : _this._strings['004bf6c9a40003140292e97330236c53'] /* Action */,
1355 renderer : function(v) { return String.format('{0}', v); },
1358 '|xns' : 'Roo.grid',
1359 xtype : 'ColumnModel'
1362 dataIndex : 'ipaddr',
1363 header : _this._strings['a12a3079e14ced46e69ba52b8a90b21a'] /* IP */,
1364 renderer : function(v) { return String.format('{0}', v); },
1367 '|xns' : 'Roo.grid',
1368 xtype : 'ColumnModel'
1371 dataIndex : 'on_table',
1372 header : _this._strings['2c92a9a6a5dbf570825e62eabcdecd8d'] /* Affected */,
1373 renderer : function(v, x, r) {
1374 return v ? String.format('{0}({1})', v, r.data.on_id) : '';
1378 '|xns' : 'Roo.grid',
1379 xtype : 'ColumnModel'
1382 dataIndex : 'remarks',
1383 header : _this._strings['231bc72756b5e6de492aaaa1577f61b1'] /* Remarks */,
1384 renderer : function(v) { return String.format('<span qtip="{1}">{0}</span>', v, Roo.util.Format.htmlEncode(v)); },
1387 '|xns' : 'Roo.grid',
1388 xtype : 'ColumnModel'