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().getSelections();
245 if (!s.length || (s.length > 1)) {
246 Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
249 if (!_this.dialog) return;
250 _this.dialog.show(s[0].data, function() {
251 _this.grid.footer.onClick('first');
265 text : _this._strings['498f79c4c5bbde77f1bceb6c86fd0f6d'] /* Show */,
267 '|xns' : 'Roo.Toolbar',
273 displayField : 'value',
275 emptyText : _this._strings['037fd50b0e85bb65995ca7125d06c7cd'] /* Select Person Table */,
276 forceSelection : true,
278 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
280 name : 'person_table',
282 qtip : _this._strings['037fd50b0e85bb65995ca7125d06c7cd'] /* Select Person Table */,
283 selectOnFocus : true,
284 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{value}</b> </div>',
285 triggerAction : 'all',
287 valueField : 'value',
293 render : function (_self)
295 _this.tableSel = _self;
298 typeof(uiConfig) == 'undefined' ||
299 typeof(uiConfig.events_person_table) == 'undefined' ||
300 !uiConfig.events_person_table.length
306 select : function (combo, record, index)
308 _this.grid.footer.onClick('first');
314 if(typeof(uiConfig) == 'undefined' || typeof(uiConfig.events_person_table) == 'undefined' || !uiConfig.events_person_table.length){
319 return uiConfig.events_person_table;
322 fields : [ 'value' ],
326 xtype : 'SimpleStore'
331 displayField : 'name',
333 emptyText : _this._strings['fd7535ce3979bb8547e2c01689db0767'] /* Select Person */,
334 fieldLabel : _this._strings['42cf593b947cd3d591fa132742486f89'] /* Person */,
335 forceSelection : true,
337 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
339 name : 'person_id_name',
341 qtip : _this._strings['fd7535ce3979bb8547e2c01689db0767'] /* Select Person */,
342 queryParam : 'query[name]',
343 selectOnFocus : true,
344 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> ({company_id_name}) <{email}> </div>',
345 triggerAction : 'all',
353 render : function (_self)
355 _this.personSel = _self;
357 select : function (combo, record, index)
359 _this.grid.footer.onClick('first');
365 sortInfo : { field : 'name' , direction : 'ASC' },
370 beforeload : function (_self, o)
372 o.params = o.params || {};
373 o.params.company_id = Pman.Login.authUser.company_id;
378 url : baseURL + '/Roo/Person.php',
410 'name': 'company_id',
438 'name': 'no_reset_sent',
442 'name': 'action_type',
446 'name': 'project_id',
450 'name': 'deleted_by',
454 'name': 'deleted_dt',
456 'dateFormat': 'Y-m-d'
459 'name': 'office_id_id',
463 'name': 'office_id_company_id',
467 'name': 'office_id_name',
471 'name': 'office_id_address',
475 'name': 'office_id_phone',
479 'name': 'office_id_fax',
483 'name': 'office_id_email',
487 'name': 'office_id_role',
491 'name': 'company_id_code',
495 'name': 'company_id_name',
499 'name': 'company_id_remarks',
503 'name': 'company_id_owner_id',
507 'name': 'company_id_address',
511 'name': 'company_id_tel',
515 'name': 'company_id_fax',
519 'name': 'company_id_email',
523 'name': 'company_id_id',
527 'name': 'company_id_isOwner',
531 'name': 'company_id_logo_id',
535 'name': 'company_id_background_color',
539 'name': 'company_id_comptype',
543 'name': 'company_id_url',
547 'name': 'company_id_main_office_id',
551 'name': 'company_id_created_by',
555 'name': 'company_id_created_dt',
559 'name': 'company_id_updated_by',
563 'name': 'company_id_updated_dt',
567 'name': 'company_id_passwd',
571 'name': 'company_id_dispatch_port',
575 'name': 'company_id_province',
579 'name': 'company_id_country',
583 'name': 'project_id_id',
587 'name': 'project_id_name',
591 'name': 'project_id_remarks',
595 'name': 'project_id_owner_id',
599 'name': 'project_id_code',
603 'name': 'project_id_active',
607 'name': 'project_id_type',
611 'name': 'project_id_client_id',
615 'name': 'project_id_team_id',
619 'name': 'project_id_file_location',
623 'name': 'project_id_open_date',
627 'name': 'project_id_open_by',
631 'name': 'project_id_close_date',
635 'name': 'project_id_countries',
639 'name': 'project_id_languages',
643 'name': 'project_id_agency_id',
647 'name': 'owner_id_id',
651 'name': 'owner_id_office_id',
655 'name': 'owner_id_name',
659 'name': 'owner_id_phone',
663 'name': 'owner_id_fax',
667 'name': 'owner_id_email',
671 'name': 'owner_id_company_id',
675 'name': 'owner_id_role',
679 'name': 'owner_id_active',
683 'name': 'owner_id_remarks',
687 'name': 'owner_id_passwd',
691 'name': 'owner_id_owner_id',
695 'name': 'owner_id_lang',
699 'name': 'owner_id_no_reset_sent',
703 'name': 'owner_id_action_type',
707 'name': 'owner_id_project_id',
711 'name': 'owner_id_deleted_by',
715 'name': 'owner_id_deleted_dt',
721 totalProperty : 'total',
730 displayField : 'action',
732 emptyText : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
733 forceSelection : true,
735 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
739 qtip : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
740 queryParam : 'query[action]',
741 selectOnFocus : true,
742 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{action}</b> </div>',
743 triggerAction : 'all',
745 valueField : 'action',
751 render : function (_self)
753 _this.actionSel = _self;
755 select : function (combo, record, index)
757 _this.grid.footer.onClick('first');
762 sortInfo : { field : 'action' , direction : 'ASC' },
767 beforeload : function (_self, o)
769 o.params = o.params || {};
770 // staff can see all logs, other companies can only see their own.
771 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
772 o.params.company_id = Pman.Login.authUser.company_id;
774 o.params._distinct = 'action';
775 o.params._columns ='action';
780 url : baseURL + '/Roo/Events.php',
792 'name': 'person_name',
796 'name': 'event_when',
798 'dateFormat': 'Y-m-d'
825 'name': 'person_id_id',
829 'name': 'person_id_office_id',
833 'name': 'person_id_name',
837 'name': 'person_id_phone',
841 'name': 'person_id_fax',
845 'name': 'person_id_email',
849 'name': 'person_id_company_id',
853 'name': 'person_id_role',
857 'name': 'person_id_active',
861 'name': 'person_id_remarks',
865 'name': 'person_id_passwd',
869 'name': 'person_id_owner_id',
873 'name': 'person_id_lang',
877 'name': 'person_id_no_reset_sent',
881 'name': 'person_id_action_type',
885 'name': 'person_id_project_id',
889 'name': 'person_id_deleted_by',
893 'name': 'person_id_deleted_dt',
899 totalProperty : 'total',
908 displayField : 'on_table',
910 emptyText : _this._strings['679308a758de538c5f39c4c6cdba6593'] /* Select Affects */,
911 forceSelection : true,
913 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
917 qtip : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
918 queryParam : 'query[on_table]',
919 selectOnFocus : true,
920 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{on_table}</b> </div>',
921 triggerAction : 'all',
923 valueField : 'action',
929 render : function (_self)
931 _this.affectSel = _self;
933 if(!Pman.hasPerm('Admin.Logs_Affects', 'S')){
937 select : function (combo, record, index)
939 _this.grid.footer.onClick('first');
944 sortInfo : { field : 'on_table' , direction : 'ASC' },
949 beforeload : function (_self, o)
951 o.params = o.params || {};
952 // staff can see all logs, other companies can only see their own.
953 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
954 o.params.company_id = Pman.Login.authUser.company_id;
956 o.params._distinct = 'on_table';
957 o.params._columns ='on_table';
962 url : baseURL + '/Roo/Events.php',
974 'name': 'person_name',
978 'name': 'event_when',
980 'dateFormat': 'Y-m-d'
1007 'name': 'person_id_id',
1011 'name': 'person_id_office_id',
1015 'name': 'person_id_name',
1019 'name': 'person_id_phone',
1023 'name': 'person_id_fax',
1027 'name': 'person_id_email',
1031 'name': 'person_id_company_id',
1035 'name': 'person_id_role',
1039 'name': 'person_id_active',
1043 'name': 'person_id_remarks',
1047 'name': 'person_id_passwd',
1051 'name': 'person_id_owner_id',
1055 'name': 'person_id_lang',
1059 'name': 'person_id_no_reset_sent',
1063 'name': 'person_id_action_type',
1067 'name': 'person_id_project_id',
1071 'name': 'person_id_deleted_by',
1075 'name': 'person_id_deleted_dt',
1081 totalProperty : 'total',
1083 '|xns' : 'Roo.data',
1084 xtype : 'JsonReader'
1089 text : _this._strings['39b9e051f9fe75e65c7a330bb00499d4'] /* Date Range */,
1091 '|xns' : 'Roo.Toolbar',
1097 '|xns' : 'Roo.form',
1098 xtype : 'DateField',
1100 change : function (_self, newValue, oldValue)
1102 _this.grid.footer.onClick('first');
1104 render : function (_self)
1106 _this.dateFrom = _self;
1113 '|xns' : 'Roo.form',
1114 xtype : 'DateField',
1116 change : function (_self, newValue, oldValue)
1118 _this.grid.footer.onClick('first');
1120 render : function (_self)
1122 _this.dateTo = _self;
1130 sortInfo : { field: 'event_when', direction: 'DESC'},
1132 '|xns' : 'Roo.data',
1135 beforeload : function (_self, o)
1137 if (!Pman.buildCompleted) {
1142 if (! _this.personSel) {
1145 o.params = o.params || {};
1146 o.params.person_id = _this.personSel.getValue();
1147 o.params.person_table = _this.tableSel.getValue();
1148 var act = _this.actionSel.getValue();
1150 o.params.action = act;
1152 var tbl = _this.affectSel.getValue();
1154 o.params.on_table = tbl;
1156 act = _this.dateFrom.getValue();
1158 o.params['query[from]'] = act.format('Y-m-d');
1160 act = _this.dateTo.getValue();
1162 o.params['query[to]'] = act.format('Y-m-d');
1167 act = _this.groupedCombo.getValue();
1168 o.params['query[grouped]'] = act;
1169 if (o.params['query[grouped]'] == 'gr') {
1172 Roo.MessageBox.alert("Error", "Select a table to group results on");
1175 // o.params['_columns'] =
1176 o.params['_distinct'] = 'on_id';
1188 url : baseURL + '/Roo/Events.php',
1190 '|xns' : 'Roo.data',
1200 'name': 'person_name',
1204 'name': 'event_when',
1206 'dateFormat': 'Y-m-d'
1225 'name': 'person_id',
1233 'name': 'person_id_id',
1237 'name': 'person_id_office_id',
1241 'name': 'person_id_name',
1245 'name': 'person_id_phone',
1249 'name': 'person_id_fax',
1253 'name': 'person_id_email',
1257 'name': 'person_id_company_id',
1261 'name': 'person_id_role',
1265 'name': 'person_id_active',
1269 'name': 'person_id_remarks',
1273 'name': 'person_id_passwd',
1277 'name': 'person_id_owner_id',
1281 'name': 'person_id_lang',
1285 'name': 'person_id_no_reset_sent',
1289 'name': 'person_id_action_type',
1293 'name': 'person_id_project_id',
1297 'name': 'person_id_deleted_by',
1301 'name': 'person_id_deleted_dt',
1307 totalProperty : 'total',
1309 '|xns' : 'Roo.data',
1310 xtype : 'JsonReader'
1314 singleSelect : true,
1316 '|xns' : 'Roo.grid',
1317 xtype : 'RowSelectionModel',
1319 afterselectionchange : function (_self)
1321 // load detail log in _this.viewPanel;
1322 if (!this.getSelected()) {
1323 this.viewPanel.setContent("Nothing Selected");
1326 var id = this.getSelected().data.id;
1327 _this.viewPanel.load( { url : baseURL + "/Admin/EventView/" + id + ".html" });
1334 dataIndex : 'event_when',
1335 header : _this._strings['4e97aeeaa8b15ca1180fcd1f3ac478d1'] /* When */,
1336 renderer : function(v) { return v ? v.dateFormat('d/m/Y H:i') : ''; },
1339 '|xns' : 'Roo.grid',
1340 xtype : 'ColumnModel'
1344 header : _this._strings['1b7f7d24575cdbfadb83b9587fa1bf97'] /* #id */,
1347 '|xns' : 'Roo.grid',
1348 xtype : 'ColumnModel'
1351 dataIndex : 'person_id_name',
1352 header : _this._strings['40bed7cf9b3d4bb3a3d7a7e3eb18c5eb'] /* Person */,
1353 renderer : function(v,x,r) {
1355 var ptable = _this.tableSel.getValue();
1357 var efield = 'person_id_email';
1358 var nfield = 'person_id_name';
1362 ptable != 'Person' &&
1363 typeof(r.data[ptable + '_id_email']) != 'undefined' &&
1364 typeof(r.data[ptable + '_id_name']) != 'undefined'
1366 efield = ptable + '_id_email';
1367 nfield = ptable + '_id_name';
1370 var email = r.data[efield]; // ? r.data.person_id_email : r.data.person_id_email;
1371 var name = r.data[nfield]; // ? r.data.person_id_name : r.data.person_id_name;
1372 return String.format('{0} <<a href="mailto:{1}">{1}</a>>',
1379 '|xns' : 'Roo.grid',
1380 xtype : 'ColumnModel'
1383 dataIndex : 'action',
1384 header : _this._strings['004bf6c9a40003140292e97330236c53'] /* Action */,
1385 renderer : function(v) { return String.format('{0}', v); },
1388 '|xns' : 'Roo.grid',
1389 xtype : 'ColumnModel'
1392 dataIndex : 'ipaddr',
1393 header : _this._strings['a12a3079e14ced46e69ba52b8a90b21a'] /* IP */,
1394 renderer : function(v) { return String.format('{0}', v); },
1397 '|xns' : 'Roo.grid',
1398 xtype : 'ColumnModel'
1401 dataIndex : 'on_table',
1402 header : _this._strings['2c92a9a6a5dbf570825e62eabcdecd8d'] /* Affected */,
1403 renderer : function(v, x, r) {
1404 return v ? String.format('{0}({1})', v, r.data.on_id) : '';
1408 '|xns' : 'Roo.grid',
1409 xtype : 'ColumnModel'
1412 dataIndex : 'remarks',
1413 header : _this._strings['231bc72756b5e6de492aaaa1577f61b1'] /* Remarks */,
1414 renderer : function(v) { return String.format('<span qtip="{1}">{0}</span>', v, Roo.util.Format.htmlEncode(v)); },
1417 '|xns' : 'Roo.grid',
1418 xtype : 'ColumnModel'