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',
230 '|xns' : 'Roo.Toolbar',
241 text : _this._strings['498f79c4c5bbde77f1bceb6c86fd0f6d'] /* Show */,
243 '|xns' : 'Roo.Toolbar',
249 displayField : 'value',
251 emptyText : _this._strings['037fd50b0e85bb65995ca7125d06c7cd'] /* Select Person Table */,
252 forceSelection : true,
254 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
256 name : 'person_table',
258 qtip : _this._strings['037fd50b0e85bb65995ca7125d06c7cd'] /* Select Person Table */,
259 selectOnFocus : true,
260 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{value}</b> </div>',
261 triggerAction : 'all',
263 valueField : 'value',
269 render : function (_self)
271 _this.tableSel = _self;
274 typeof(uiConfig) == 'undefined' ||
275 typeof(uiConfig.events_person_table) == 'undefined' ||
276 !uiConfig.events_person_table.length
282 select : function (combo, record, index)
284 _this.grid.footer.onClick('first');
290 if(typeof(uiConfig) == 'undefined' || typeof(uiConfig.events_person_table) == 'undefined' || !uiConfig.events_person_table.length){
295 return uiConfig.events_person_table;
298 fields : [ 'value' ],
302 xtype : 'SimpleStore'
307 displayField : 'name',
309 emptyText : _this._strings['fd7535ce3979bb8547e2c01689db0767'] /* Select Person */,
310 fieldLabel : _this._strings['42cf593b947cd3d591fa132742486f89'] /* Person */,
311 forceSelection : true,
313 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
315 name : 'person_id_name',
317 qtip : _this._strings['fd7535ce3979bb8547e2c01689db0767'] /* Select Person */,
318 queryParam : 'query[name]',
319 selectOnFocus : true,
320 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> ({company_id_name}) <{email}> </div>',
321 triggerAction : 'all',
329 render : function (_self)
331 _this.personSel = _self;
333 select : function (combo, record, index)
335 _this.grid.footer.onClick('first');
341 sortInfo : { field : 'name' , direction : 'ASC' },
346 beforeload : function (_self, o)
348 o.params = o.params || {};
349 o.params.company_id = Pman.Login.authUser.company_id;
354 url : baseURL + '/Roo/Person.php',
386 'name': 'company_id',
414 'name': 'no_reset_sent',
418 'name': 'action_type',
422 'name': 'project_id',
426 'name': 'deleted_by',
430 'name': 'deleted_dt',
432 'dateFormat': 'Y-m-d'
435 'name': 'office_id_id',
439 'name': 'office_id_company_id',
443 'name': 'office_id_name',
447 'name': 'office_id_address',
451 'name': 'office_id_phone',
455 'name': 'office_id_fax',
459 'name': 'office_id_email',
463 'name': 'office_id_role',
467 'name': 'company_id_code',
471 'name': 'company_id_name',
475 'name': 'company_id_remarks',
479 'name': 'company_id_owner_id',
483 'name': 'company_id_address',
487 'name': 'company_id_tel',
491 'name': 'company_id_fax',
495 'name': 'company_id_email',
499 'name': 'company_id_id',
503 'name': 'company_id_isOwner',
507 'name': 'company_id_logo_id',
511 'name': 'company_id_background_color',
515 'name': 'company_id_comptype',
519 'name': 'company_id_url',
523 'name': 'company_id_main_office_id',
527 'name': 'company_id_created_by',
531 'name': 'company_id_created_dt',
535 'name': 'company_id_updated_by',
539 'name': 'company_id_updated_dt',
543 'name': 'company_id_passwd',
547 'name': 'company_id_dispatch_port',
551 'name': 'company_id_province',
555 'name': 'company_id_country',
559 'name': 'project_id_id',
563 'name': 'project_id_name',
567 'name': 'project_id_remarks',
571 'name': 'project_id_owner_id',
575 'name': 'project_id_code',
579 'name': 'project_id_active',
583 'name': 'project_id_type',
587 'name': 'project_id_client_id',
591 'name': 'project_id_team_id',
595 'name': 'project_id_file_location',
599 'name': 'project_id_open_date',
603 'name': 'project_id_open_by',
607 'name': 'project_id_close_date',
611 'name': 'project_id_countries',
615 'name': 'project_id_languages',
619 'name': 'project_id_agency_id',
623 'name': 'owner_id_id',
627 'name': 'owner_id_office_id',
631 'name': 'owner_id_name',
635 'name': 'owner_id_phone',
639 'name': 'owner_id_fax',
643 'name': 'owner_id_email',
647 'name': 'owner_id_company_id',
651 'name': 'owner_id_role',
655 'name': 'owner_id_active',
659 'name': 'owner_id_remarks',
663 'name': 'owner_id_passwd',
667 'name': 'owner_id_owner_id',
671 'name': 'owner_id_lang',
675 'name': 'owner_id_no_reset_sent',
679 'name': 'owner_id_action_type',
683 'name': 'owner_id_project_id',
687 'name': 'owner_id_deleted_by',
691 'name': 'owner_id_deleted_dt',
697 totalProperty : 'total',
706 displayField : 'action',
708 emptyText : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
709 forceSelection : true,
711 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
715 qtip : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
716 queryParam : 'query[action]',
717 selectOnFocus : true,
718 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{action}</b> </div>',
719 triggerAction : 'all',
721 valueField : 'action',
727 render : function (_self)
729 _this.actionSel = _self;
731 select : function (combo, record, index)
733 _this.grid.footer.onClick('first');
738 sortInfo : { field : 'action' , direction : 'ASC' },
743 beforeload : function (_self, o)
745 o.params = o.params || {};
746 // staff can see all logs, other companies can only see their own.
747 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
748 o.params.company_id = Pman.Login.authUser.company_id;
750 o.params._distinct = 'action';
751 o.params._columns ='action';
756 url : baseURL + '/Roo/Events.php',
768 'name': 'person_name',
772 'name': 'event_when',
774 'dateFormat': 'Y-m-d'
801 'name': 'person_id_id',
805 'name': 'person_id_office_id',
809 'name': 'person_id_name',
813 'name': 'person_id_phone',
817 'name': 'person_id_fax',
821 'name': 'person_id_email',
825 'name': 'person_id_company_id',
829 'name': 'person_id_role',
833 'name': 'person_id_active',
837 'name': 'person_id_remarks',
841 'name': 'person_id_passwd',
845 'name': 'person_id_owner_id',
849 'name': 'person_id_lang',
853 'name': 'person_id_no_reset_sent',
857 'name': 'person_id_action_type',
861 'name': 'person_id_project_id',
865 'name': 'person_id_deleted_by',
869 'name': 'person_id_deleted_dt',
875 totalProperty : 'total',
884 displayField : 'on_table',
886 emptyText : _this._strings['679308a758de538c5f39c4c6cdba6593'] /* Select Affects */,
887 forceSelection : true,
889 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
893 qtip : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
894 queryParam : 'query[on_table]',
895 selectOnFocus : true,
896 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{on_table}</b> </div>',
897 triggerAction : 'all',
899 valueField : 'action',
905 render : function (_self)
907 _this.affectSel = _self;
909 if(!Pman.hasPerm('Admin.Logs_Affects', 'S')){
913 select : function (combo, record, index)
915 _this.grid.footer.onClick('first');
920 sortInfo : { field : 'on_table' , direction : 'ASC' },
925 beforeload : function (_self, o)
927 o.params = o.params || {};
928 // staff can see all logs, other companies can only see their own.
929 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
930 o.params.company_id = Pman.Login.authUser.company_id;
932 o.params._distinct = 'on_table';
933 o.params._columns ='on_table';
938 url : baseURL + '/Roo/Events.php',
950 'name': 'person_name',
954 'name': 'event_when',
956 'dateFormat': 'Y-m-d'
983 'name': 'person_id_id',
987 'name': 'person_id_office_id',
991 'name': 'person_id_name',
995 'name': 'person_id_phone',
999 'name': 'person_id_fax',
1003 'name': 'person_id_email',
1007 'name': 'person_id_company_id',
1011 'name': 'person_id_role',
1015 'name': 'person_id_active',
1019 'name': 'person_id_remarks',
1023 'name': 'person_id_passwd',
1027 'name': 'person_id_owner_id',
1031 'name': 'person_id_lang',
1035 'name': 'person_id_no_reset_sent',
1039 'name': 'person_id_action_type',
1043 'name': 'person_id_project_id',
1047 'name': 'person_id_deleted_by',
1051 'name': 'person_id_deleted_dt',
1057 totalProperty : 'total',
1059 '|xns' : 'Roo.data',
1060 xtype : 'JsonReader'
1065 text : _this._strings['39b9e051f9fe75e65c7a330bb00499d4'] /* Date Range */,
1067 '|xns' : 'Roo.Toolbar',
1073 '|xns' : 'Roo.form',
1074 xtype : 'DateField',
1076 change : function (_self, newValue, oldValue)
1078 _this.grid.footer.onClick('first');
1080 render : function (_self)
1082 _this.dateFrom = _self;
1089 '|xns' : 'Roo.form',
1090 xtype : 'DateField',
1092 change : function (_self, newValue, oldValue)
1094 _this.grid.footer.onClick('first');
1096 render : function (_self)
1098 _this.dateTo = _self;
1106 sortInfo : { field: 'event_when', direction: 'DESC'},
1108 '|xns' : 'Roo.data',
1111 beforeload : function (_self, o)
1113 if (!Pman.buildCompleted) {
1118 if (! _this.personSel) {
1121 o.params = o.params || {};
1122 o.params.person_id = _this.personSel.getValue();
1123 o.params.person_table = _this.tableSel.getValue();
1124 var act = _this.actionSel.getValue();
1126 o.params.action = act;
1128 var tbl = _this.affectSel.getValue();
1130 o.params.on_table = tbl;
1132 act = _this.dateFrom.getValue();
1134 o.params['query[from]'] = act.format('Y-m-d');
1136 act = _this.dateTo.getValue();
1138 o.params['query[to]'] = act.format('Y-m-d');
1143 act = _this.groupedCombo.getValue();
1144 o.params['query[grouped]'] = act;
1145 if (o.params['query[grouped]'] == 'gr') {
1148 Roo.MessageBox.alert("Error", "Select a table to group results on");
1151 // o.params['_columns'] =
1152 o.params['_distinct'] = 'on_id';
1164 url : baseURL + '/Roo/Events.php',
1166 '|xns' : 'Roo.data',
1176 'name': 'person_name',
1180 'name': 'event_when',
1182 'dateFormat': 'Y-m-d'
1201 'name': 'person_id',
1209 'name': 'person_id_id',
1213 'name': 'person_id_office_id',
1217 'name': 'person_id_name',
1221 'name': 'person_id_phone',
1225 'name': 'person_id_fax',
1229 'name': 'person_id_email',
1233 'name': 'person_id_company_id',
1237 'name': 'person_id_role',
1241 'name': 'person_id_active',
1245 'name': 'person_id_remarks',
1249 'name': 'person_id_passwd',
1253 'name': 'person_id_owner_id',
1257 'name': 'person_id_lang',
1261 'name': 'person_id_no_reset_sent',
1265 'name': 'person_id_action_type',
1269 'name': 'person_id_project_id',
1273 'name': 'person_id_deleted_by',
1277 'name': 'person_id_deleted_dt',
1283 totalProperty : 'total',
1285 '|xns' : 'Roo.data',
1286 xtype : 'JsonReader'
1290 singleSelect : true,
1292 '|xns' : 'Roo.grid',
1293 xtype : 'RowSelectionModel',
1295 afterselectionchange : function (_self)
1297 // load detail log in _this.viewPanel;
1298 if (!this.getSelected()) {
1299 this.viewPanel.setContent("Nothing Selected");
1302 var id = this.getSelected().data.id;
1303 _this.viewPanel.load( { url : baseURL + "/Admin/EventView/" + id + ".html" });
1310 dataIndex : 'event_when',
1311 header : _this._strings['4e97aeeaa8b15ca1180fcd1f3ac478d1'] /* When */,
1312 renderer : function(v) { return v ? v.dateFormat('d/m/Y H:i') : ''; },
1315 '|xns' : 'Roo.grid',
1316 xtype : 'ColumnModel'
1320 header : _this._strings['1b7f7d24575cdbfadb83b9587fa1bf97'] /* #id */,
1323 '|xns' : 'Roo.grid',
1324 xtype : 'ColumnModel'
1327 dataIndex : 'person_id_name',
1328 header : _this._strings['40bed7cf9b3d4bb3a3d7a7e3eb18c5eb'] /* Person */,
1329 renderer : function(v,x,r) {
1331 var ptable = _this.tableSel.getValue();
1333 var efield = 'person_id_email';
1334 var nfield = 'person_id_name';
1338 ptable != 'Person' &&
1339 typeof(r.data[ptable + '_id_email']) != 'undefined' &&
1340 typeof(r.data[ptable + '_id_name']) != 'undefined'
1342 efield = ptable + '_id_email';
1343 nfield = ptable + '_id_name';
1346 var email = r.data[efield]; // ? r.data.person_id_email : r.data.person_id_email;
1347 var name = r.data[nfield]; // ? r.data.person_id_name : r.data.person_id_name;
1348 return String.format('{0} <<a href="mailto:{1}">{1}</a>>',
1355 '|xns' : 'Roo.grid',
1356 xtype : 'ColumnModel'
1359 dataIndex : 'action',
1360 header : _this._strings['004bf6c9a40003140292e97330236c53'] /* Action */,
1361 renderer : function(v) { return String.format('{0}', v); },
1364 '|xns' : 'Roo.grid',
1365 xtype : 'ColumnModel'
1368 dataIndex : 'ipaddr',
1369 header : _this._strings['a12a3079e14ced46e69ba52b8a90b21a'] /* IP */,
1370 renderer : function(v) { return String.format('{0}', v); },
1373 '|xns' : 'Roo.grid',
1374 xtype : 'ColumnModel'
1377 dataIndex : 'on_table',
1378 header : _this._strings['2c92a9a6a5dbf570825e62eabcdecd8d'] /* Affected */,
1379 renderer : function(v, x, r) {
1380 return v ? String.format('{0}({1})', v, r.data.on_id) : '';
1384 '|xns' : 'Roo.grid',
1385 xtype : 'ColumnModel'
1388 dataIndex : 'remarks',
1389 header : _this._strings['231bc72756b5e6de492aaaa1577f61b1'] /* Remarks */,
1390 renderer : function(v) { return String.format('<span qtip="{1}">{0}</span>', v, Roo.util.Format.htmlEncode(v)); },
1393 '|xns' : 'Roo.grid',
1394 xtype : 'ColumnModel'