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');
274 text : _this._strings['498f79c4c5bbde77f1bceb6c86fd0f6d'] /* Show */,
276 '|xns' : 'Roo.Toolbar',
282 displayField : 'value',
284 emptyText : _this._strings['037fd50b0e85bb65995ca7125d06c7cd'] /* Select Person Table */,
285 forceSelection : true,
287 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
289 name : 'person_table',
291 qtip : _this._strings['037fd50b0e85bb65995ca7125d06c7cd'] /* Select Person Table */,
292 selectOnFocus : true,
293 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{value}</b> </div>',
294 triggerAction : 'all',
296 valueField : 'value',
302 render : function (_self)
304 _this.tableSel = _self;
307 typeof(uiConfig) == 'undefined' ||
308 typeof(uiConfig.events_person_table) == 'undefined' ||
309 !uiConfig.events_person_table.length
315 select : function (combo, record, index)
317 _this.grid.footer.onClick('first');
323 if(typeof(uiConfig) == 'undefined' || typeof(uiConfig.events_person_table) == 'undefined' || !uiConfig.events_person_table.length){
328 return uiConfig.events_person_table;
331 fields : [ 'value' ],
335 xtype : 'SimpleStore'
340 displayField : 'name',
342 emptyText : _this._strings['fd7535ce3979bb8547e2c01689db0767'] /* Select Person */,
343 fieldLabel : _this._strings['42cf593b947cd3d591fa132742486f89'] /* Person */,
344 forceSelection : true,
346 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
348 name : 'person_id_name',
350 qtip : _this._strings['fd7535ce3979bb8547e2c01689db0767'] /* Select Person */,
351 queryParam : 'query[name]',
352 selectOnFocus : true,
353 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> ({company_id_name}) <{email}> </div>',
354 triggerAction : 'all',
362 render : function (_self)
364 _this.personSel = _self;
366 select : function (combo, record, index)
368 _this.grid.footer.onClick('first');
374 sortInfo : { field : 'name' , direction : 'ASC' },
379 beforeload : function (_self, o)
381 o.params = o.params || {};
382 o.params.company_id = Pman.Login.authUser.company_id;
387 url : baseURL + '/Roo/Person.php',
419 'name': 'company_id',
447 'name': 'no_reset_sent',
451 'name': 'action_type',
455 'name': 'project_id',
459 'name': 'deleted_by',
463 'name': 'deleted_dt',
465 'dateFormat': 'Y-m-d'
468 'name': 'office_id_id',
472 'name': 'office_id_company_id',
476 'name': 'office_id_name',
480 'name': 'office_id_address',
484 'name': 'office_id_phone',
488 'name': 'office_id_fax',
492 'name': 'office_id_email',
496 'name': 'office_id_role',
500 'name': 'company_id_code',
504 'name': 'company_id_name',
508 'name': 'company_id_remarks',
512 'name': 'company_id_owner_id',
516 'name': 'company_id_address',
520 'name': 'company_id_tel',
524 'name': 'company_id_fax',
528 'name': 'company_id_email',
532 'name': 'company_id_id',
536 'name': 'company_id_isOwner',
540 'name': 'company_id_logo_id',
544 'name': 'company_id_background_color',
548 'name': 'company_id_comptype',
552 'name': 'company_id_url',
556 'name': 'company_id_main_office_id',
560 'name': 'company_id_created_by',
564 'name': 'company_id_created_dt',
568 'name': 'company_id_updated_by',
572 'name': 'company_id_updated_dt',
576 'name': 'company_id_passwd',
580 'name': 'company_id_dispatch_port',
584 'name': 'company_id_province',
588 'name': 'company_id_country',
592 'name': 'project_id_id',
596 'name': 'project_id_name',
600 'name': 'project_id_remarks',
604 'name': 'project_id_owner_id',
608 'name': 'project_id_code',
612 'name': 'project_id_active',
616 'name': 'project_id_type',
620 'name': 'project_id_client_id',
624 'name': 'project_id_team_id',
628 'name': 'project_id_file_location',
632 'name': 'project_id_open_date',
636 'name': 'project_id_open_by',
640 'name': 'project_id_close_date',
644 'name': 'project_id_countries',
648 'name': 'project_id_languages',
652 'name': 'project_id_agency_id',
656 'name': 'owner_id_id',
660 'name': 'owner_id_office_id',
664 'name': 'owner_id_name',
668 'name': 'owner_id_phone',
672 'name': 'owner_id_fax',
676 'name': 'owner_id_email',
680 'name': 'owner_id_company_id',
684 'name': 'owner_id_role',
688 'name': 'owner_id_active',
692 'name': 'owner_id_remarks',
696 'name': 'owner_id_passwd',
700 'name': 'owner_id_owner_id',
704 'name': 'owner_id_lang',
708 'name': 'owner_id_no_reset_sent',
712 'name': 'owner_id_action_type',
716 'name': 'owner_id_project_id',
720 'name': 'owner_id_deleted_by',
724 'name': 'owner_id_deleted_dt',
730 totalProperty : 'total',
739 displayField : 'action',
741 emptyText : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
742 forceSelection : true,
744 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
748 qtip : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
749 queryParam : 'query[action]',
750 selectOnFocus : true,
751 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{action}</b> </div>',
752 triggerAction : 'all',
754 valueField : 'action',
760 render : function (_self)
762 _this.actionSel = _self;
764 select : function (combo, record, index)
766 _this.grid.footer.onClick('first');
771 sortInfo : { field : 'action' , direction : 'ASC' },
776 beforeload : function (_self, o)
778 o.params = o.params || {};
779 // staff can see all logs, other companies can only see their own.
780 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
781 o.params.company_id = Pman.Login.authUser.company_id;
783 o.params._distinct = 'action';
784 o.params._columns ='action';
789 url : baseURL + '/Roo/Events.php',
801 'name': 'person_name',
805 'name': 'event_when',
807 'dateFormat': 'Y-m-d'
834 'name': 'person_id_id',
838 'name': 'person_id_office_id',
842 'name': 'person_id_name',
846 'name': 'person_id_phone',
850 'name': 'person_id_fax',
854 'name': 'person_id_email',
858 'name': 'person_id_company_id',
862 'name': 'person_id_role',
866 'name': 'person_id_active',
870 'name': 'person_id_remarks',
874 'name': 'person_id_passwd',
878 'name': 'person_id_owner_id',
882 'name': 'person_id_lang',
886 'name': 'person_id_no_reset_sent',
890 'name': 'person_id_action_type',
894 'name': 'person_id_project_id',
898 'name': 'person_id_deleted_by',
902 'name': 'person_id_deleted_dt',
908 totalProperty : 'total',
917 displayField : 'on_table',
919 emptyText : _this._strings['679308a758de538c5f39c4c6cdba6593'] /* Select Affects */,
920 forceSelection : true,
922 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
926 qtip : _this._strings['a8929eb5c1553d3f70497f862d25d0ce'] /* Select Action */,
927 queryParam : 'query[on_table]',
928 selectOnFocus : true,
929 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{on_table}</b> </div>',
930 triggerAction : 'all',
932 valueField : 'action',
938 render : function (_self)
940 _this.affectSel = _self;
942 if(!Pman.hasPerm('Admin.Logs_Affects', 'S')){
946 select : function (combo, record, index)
948 _this.grid.footer.onClick('first');
953 sortInfo : { field : 'on_table' , direction : 'ASC' },
958 beforeload : function (_self, o)
960 o.params = o.params || {};
961 // staff can see all logs, other companies can only see their own.
962 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
963 o.params.company_id = Pman.Login.authUser.company_id;
965 o.params._distinct = 'on_table';
966 o.params._columns ='on_table';
971 url : baseURL + '/Roo/Events.php',
983 'name': 'person_name',
987 'name': 'event_when',
989 'dateFormat': 'Y-m-d'
1008 'name': 'person_id',
1016 'name': 'person_id_id',
1020 'name': 'person_id_office_id',
1024 'name': 'person_id_name',
1028 'name': 'person_id_phone',
1032 'name': 'person_id_fax',
1036 'name': 'person_id_email',
1040 'name': 'person_id_company_id',
1044 'name': 'person_id_role',
1048 'name': 'person_id_active',
1052 'name': 'person_id_remarks',
1056 'name': 'person_id_passwd',
1060 'name': 'person_id_owner_id',
1064 'name': 'person_id_lang',
1068 'name': 'person_id_no_reset_sent',
1072 'name': 'person_id_action_type',
1076 'name': 'person_id_project_id',
1080 'name': 'person_id_deleted_by',
1084 'name': 'person_id_deleted_dt',
1090 totalProperty : 'total',
1092 '|xns' : 'Roo.data',
1093 xtype : 'JsonReader'
1098 text : _this._strings['39b9e051f9fe75e65c7a330bb00499d4'] /* Date Range */,
1100 '|xns' : 'Roo.Toolbar',
1106 '|xns' : 'Roo.form',
1107 xtype : 'DateField',
1109 change : function (_self, newValue, oldValue)
1111 _this.grid.footer.onClick('first');
1113 render : function (_self)
1115 _this.dateFrom = _self;
1122 '|xns' : 'Roo.form',
1123 xtype : 'DateField',
1125 change : function (_self, newValue, oldValue)
1127 _this.grid.footer.onClick('first');
1129 render : function (_self)
1131 _this.dateTo = _self;
1139 sortInfo : { field: 'event_when', direction: 'DESC'},
1141 '|xns' : 'Roo.data',
1144 beforeload : function (_self, o)
1146 if (!Pman.buildCompleted) {
1151 if (! _this.personSel) {
1154 o.params = o.params || {};
1155 o.params.person_id = _this.personSel.getValue();
1156 o.params.person_table = _this.tableSel.getValue();
1157 var act = _this.actionSel.getValue();
1159 o.params.action = act;
1161 var tbl = _this.affectSel.getValue();
1163 o.params.on_table = tbl;
1165 act = _this.dateFrom.getValue();
1167 o.params['query[from]'] = act.format('Y-m-d');
1169 act = _this.dateTo.getValue();
1171 o.params['query[to]'] = act.format('Y-m-d');
1176 act = _this.groupedCombo.getValue();
1177 o.params['query[grouped]'] = act;
1178 if (o.params['query[grouped]'] == 'gr') {
1181 Roo.MessageBox.alert("Error", "Select a table to group results on");
1184 // o.params['_columns'] =
1185 o.params['_distinct'] = 'on_id';
1197 url : baseURL + '/Roo/Events.php',
1199 '|xns' : 'Roo.data',
1209 'name': 'person_name',
1213 'name': 'event_when',
1215 'dateFormat': 'Y-m-d'
1234 'name': 'person_id',
1242 'name': 'person_id_id',
1246 'name': 'person_id_office_id',
1250 'name': 'person_id_name',
1254 'name': 'person_id_phone',
1258 'name': 'person_id_fax',
1262 'name': 'person_id_email',
1266 'name': 'person_id_company_id',
1270 'name': 'person_id_role',
1274 'name': 'person_id_active',
1278 'name': 'person_id_remarks',
1282 'name': 'person_id_passwd',
1286 'name': 'person_id_owner_id',
1290 'name': 'person_id_lang',
1294 'name': 'person_id_no_reset_sent',
1298 'name': 'person_id_action_type',
1302 'name': 'person_id_project_id',
1306 'name': 'person_id_deleted_by',
1310 'name': 'person_id_deleted_dt',
1316 totalProperty : 'total',
1318 '|xns' : 'Roo.data',
1319 xtype : 'JsonReader'
1323 singleSelect : true,
1325 '|xns' : 'Roo.grid',
1326 xtype : 'RowSelectionModel',
1328 afterselectionchange : function (_self)
1330 // load detail log in _this.viewPanel;
1331 if (!this.getSelected()) {
1332 this.viewPanel.setContent("Nothing Selected");
1335 var id = this.getSelected().data.id;
1336 _this.viewPanel.load( { url : baseURL + "/Admin/EventView/" + id + ".html" });
1343 dataIndex : 'event_when',
1344 header : _this._strings['4e97aeeaa8b15ca1180fcd1f3ac478d1'] /* When */,
1345 renderer : function(v) { return v ? v.dateFormat('d/m/Y H:i') : ''; },
1348 '|xns' : 'Roo.grid',
1349 xtype : 'ColumnModel'
1353 header : _this._strings['1b7f7d24575cdbfadb83b9587fa1bf97'] /* #id */,
1356 '|xns' : 'Roo.grid',
1357 xtype : 'ColumnModel'
1360 dataIndex : 'person_id_name',
1361 header : _this._strings['40bed7cf9b3d4bb3a3d7a7e3eb18c5eb'] /* Person */,
1362 renderer : function(v,x,r) {
1364 var ptable = _this.tableSel.getValue();
1366 var efield = 'person_id_email';
1367 var nfield = 'person_id_name';
1371 ptable != 'Person' &&
1372 typeof(r.data[ptable + '_id_email']) != 'undefined' &&
1373 typeof(r.data[ptable + '_id_name']) != 'undefined'
1375 efield = ptable + '_id_email';
1376 nfield = ptable + '_id_name';
1379 var email = r.data[efield]; // ? r.data.person_id_email : r.data.person_id_email;
1380 var name = r.data[nfield]; // ? r.data.person_id_name : r.data.person_id_name;
1381 return String.format('{0} <<a href="mailto:{1}">{1}</a>>',
1388 '|xns' : 'Roo.grid',
1389 xtype : 'ColumnModel'
1392 dataIndex : 'action',
1393 header : _this._strings['004bf6c9a40003140292e97330236c53'] /* Action */,
1394 renderer : function(v) { return String.format('{0}', v); },
1397 '|xns' : 'Roo.grid',
1398 xtype : 'ColumnModel'
1401 dataIndex : 'ipaddr',
1402 header : _this._strings['a12a3079e14ced46e69ba52b8a90b21a'] /* IP */,
1403 renderer : function(v) { return String.format('{0}', v); },
1406 '|xns' : 'Roo.grid',
1407 xtype : 'ColumnModel'
1410 dataIndex : 'on_table',
1411 header : _this._strings['2c92a9a6a5dbf570825e62eabcdecd8d'] /* Affected */,
1412 renderer : function(v, x, r) {
1413 return v ? String.format('{0}({1})', v, r.data.on_id) : '';
1417 '|xns' : 'Roo.grid',
1418 xtype : 'ColumnModel'
1421 dataIndex : 'remarks',
1422 header : _this._strings['231bc72756b5e6de492aaaa1577f61b1'] /* Remarks */,
1423 renderer : function(v) { return String.format('<span qtip="{1}">{0}</span>', v, Roo.util.Format.htmlEncode(v)); },
1426 '|xns' : 'Roo.grid',
1427 xtype : 'ColumnModel'