1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
7 // register the module first
8 Pman.on('beforeload', function()
11 modKey : '001-Pman.Tab.AdminLogEvents',
12 module : Pman.Tab.AdminLogEvents,
14 parent : Pman.Tab.AdminLogs,
15 name : "Admin - Logs - Events",
21 Pman.Tab.AdminLogEvents = new Roo.util.Observable({
27 add : function(parentLayout, region)
31 this.parentLayout = parentLayout;
33 this.panel = parentLayout.addxtype({
37 activate : function() {
40 _this.grid.footer.onClick('first');
53 autoExpandColumn : 'remarks',
58 //_this.dialog = Pman.Dialog.FILL_IN
59 if (_this.panel.active) {
60 this.footer.onClick('first');
68 beforeload : function (_self, o)
70 if (! _this.personSel) {
73 o.params = o.params || {};
74 o.params.person_id = _this.personSel.getValue();
75 var act = _this.actionSel.getValue();
77 o.params.action = act;
79 act = _this.affectSel.getValue();
81 o.params.on_table = act;
87 reader : Pman.Readers.Events,
88 sortInfo : { field: 'event_when', direction: 'DESC'},
92 totalProperty : 'total',
101 'name': 'person_name',
105 'name': 'event_when',
107 'dateFormat': 'Y-m-d'
134 'name': 'person_id_id',
138 'name': 'person_id_office_id',
142 'name': 'person_id_name',
146 'name': 'person_id_phone',
150 'name': 'person_id_fax',
154 'name': 'person_id_email',
158 'name': 'person_id_company_id',
162 'name': 'person_id_role',
166 'name': 'person_id_active',
170 'name': 'person_id_remarks',
174 'name': 'person_id_passwd',
178 'name': 'person_id_owner_id',
182 'name': 'person_id_lang',
186 'name': 'person_id_no_reset_sent',
190 'name': 'person_id_action_type',
194 'name': 'person_id_project_id',
198 'name': 'person_id_deleted_by',
202 'name': 'person_id_deleted_dt',
211 url : baseURL + '/Roo/Events.php'
215 xtype: 'PagingToolbar',
219 displayMsg : 'Displaying Events {0} - {1} of {2}',
220 emptyMsg : 'No Events found'
235 select : function (combo, record, index)
237 _this.grid.footer.onClick('first');
240 render : function (_self)
242 _this.personSel = _self;
246 displayField : 'name',
248 emptyText : "Select Person ",
249 fieldLabel : 'Person ',
250 forceSelection : true,
252 loadingText : "Searching...",
254 name : 'person_id_name',
256 qtip : "Select Person ",
257 queryParam : 'query[name]',
258 selectOnFocus : true,
259 tpl : '<div class="x-grid-cell-text x-btn button"><b>{name}</b> <{email}> </div>',
260 triggerAction : 'all',
268 beforeload : function (_self, o)
270 o.params = o.params || {};
271 o.company_id = Pman.Login.authUser.company_id;
274 sortInfo : { field : 'name' , direction : 'ASC' },
278 url : baseURL + '/Roo/Person.php',
286 totalProperty : 'total',
313 'name': 'company_id',
341 'name': 'no_reset_sent',
345 'name': 'action_type',
349 'name': 'project_id',
353 'name': 'deleted_by',
357 'name': 'deleted_dt',
359 'dateFormat': 'Y-m-d'
362 'name': 'office_id_id',
366 'name': 'office_id_company_id',
370 'name': 'office_id_name',
374 'name': 'office_id_address',
378 'name': 'office_id_phone',
382 'name': 'office_id_fax',
386 'name': 'office_id_email',
390 'name': 'office_id_role',
394 'name': 'company_id_code',
398 'name': 'company_id_name',
402 'name': 'company_id_remarks',
406 'name': 'company_id_owner_id',
410 'name': 'company_id_address',
414 'name': 'company_id_tel',
418 'name': 'company_id_fax',
422 'name': 'company_id_email',
426 'name': 'company_id_id',
430 'name': 'company_id_isOwner',
434 'name': 'company_id_logo_id',
438 'name': 'company_id_background_color',
442 'name': 'company_id_comptype',
446 'name': 'company_id_url',
450 'name': 'company_id_main_office_id',
454 'name': 'company_id_created_by',
458 'name': 'company_id_created_dt',
462 'name': 'company_id_updated_by',
466 'name': 'company_id_updated_dt',
470 'name': 'company_id_passwd',
474 'name': 'company_id_dispatch_port',
478 'name': 'company_id_province',
482 'name': 'company_id_country',
486 'name': 'project_id_id',
490 'name': 'project_id_name',
494 'name': 'project_id_remarks',
498 'name': 'project_id_owner_id',
502 'name': 'project_id_code',
506 'name': 'project_id_active',
510 'name': 'project_id_type',
514 'name': 'project_id_client_id',
518 'name': 'project_id_team_id',
522 'name': 'project_id_file_location',
526 'name': 'project_id_open_date',
530 'name': 'project_id_open_by',
534 'name': 'project_id_close_date',
538 'name': 'project_id_countries',
542 'name': 'project_id_languages',
546 'name': 'project_id_agency_id',
550 'name': 'owner_id_id',
554 'name': 'owner_id_office_id',
558 'name': 'owner_id_name',
562 'name': 'owner_id_phone',
566 'name': 'owner_id_fax',
570 'name': 'owner_id_email',
574 'name': 'owner_id_company_id',
578 'name': 'owner_id_role',
582 'name': 'owner_id_active',
586 'name': 'owner_id_remarks',
590 'name': 'owner_id_passwd',
594 'name': 'owner_id_owner_id',
598 'name': 'owner_id_lang',
602 'name': 'owner_id_no_reset_sent',
606 'name': 'owner_id_action_type',
610 'name': 'owner_id_project_id',
614 'name': 'owner_id_deleted_by',
618 'name': 'owner_id_deleted_dt',
629 select : function (combo, record, index)
631 _this.grid.footer.onClick('first');
633 render : function (_self)
635 _this.actionSel = _self;
639 displayField : 'action',
641 emptyText : "Select Action",
642 forceSelection : true,
644 loadingText : "Searching...",
648 qtip : "Select Action",
649 queryParam : 'query[action]',
650 selectOnFocus : true,
651 tpl : '<div class="x-grid-cell-text x-btn button"><b>{action}</b> </div>',
652 triggerAction : 'all',
654 valueField : 'action',
660 beforeload : function (_self, o)
662 o.params = o.params || {};
663 // staff can see all logs, other companies can only see their own.
664 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
665 o.params.company_id = Pman.Login.authUser.company_id;
667 o.params._distinct = 'action';
668 o.params._columns ='action';
671 sortInfo : { field : 'action' , direction : 'ASC' },
676 url : baseURL + '/Roo/Events.php'
681 totalProperty : 'total',
690 'name': 'person_name',
694 'name': 'event_when',
696 'dateFormat': 'Y-m-d'
723 'name': 'person_id_id',
727 'name': 'person_id_office_id',
731 'name': 'person_id_name',
735 'name': 'person_id_phone',
739 'name': 'person_id_fax',
743 'name': 'person_id_email',
747 'name': 'person_id_company_id',
751 'name': 'person_id_role',
755 'name': 'person_id_active',
759 'name': 'person_id_remarks',
763 'name': 'person_id_passwd',
767 'name': 'person_id_owner_id',
771 'name': 'person_id_lang',
775 'name': 'person_id_no_reset_sent',
779 'name': 'person_id_action_type',
783 'name': 'person_id_project_id',
787 'name': 'person_id_deleted_by',
791 'name': 'person_id_deleted_dt',
802 select : function (combo, record, index)
804 _this.grid.footer.onClick('first');
806 render : function (_self)
808 _this.affectSel = _self;
812 displayField : 'on_table',
814 emptyText : "Select Affects",
815 forceSelection : true,
817 loadingText : "Searching...",
821 qtip : "Select Action",
822 queryParam : 'query[on_table]',
823 selectOnFocus : true,
824 tpl : '<div class="x-grid-cell-text x-btn button"><b>{on_table}</b> </div>',
825 triggerAction : 'all',
827 valueField : 'action',
833 beforeload : function (_self, o)
835 o.params = o.params || {};
836 // staff can see all logs, other companies can only see their own.
837 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
838 o.params.company_id = Pman.Login.authUser.company_id;
840 o.params._distinct = 'on_table';
841 o.params._columns ='on_table';
844 sortInfo : { field : 'on_table' , direction : 'ASC' },
849 url : baseURL + '/Roo/Events.php'
854 totalProperty : 'total',
863 'name': 'person_name',
867 'name': 'event_when',
869 'dateFormat': 'Y-m-d'
896 'name': 'person_id_id',
900 'name': 'person_id_office_id',
904 'name': 'person_id_name',
908 'name': 'person_id_phone',
912 'name': 'person_id_fax',
916 'name': 'person_id_email',
920 'name': 'person_id_company_id',
924 'name': 'person_id_role',
928 'name': 'person_id_active',
932 'name': 'person_id_remarks',
936 'name': 'person_id_passwd',
940 'name': 'person_id_owner_id',
944 'name': 'person_id_lang',
948 'name': 'person_id_no_reset_sent',
952 'name': 'person_id_action_type',
956 'name': 'person_id_project_id',
960 'name': 'person_id_deleted_by',
964 'name': 'person_id_deleted_dt',
975 click : function (_self, e)
979 'sort' : 'event_when',
983 person_id : _this.personSel.getValue(),
984 'csvTitles[0]' : 'When', 'csvCols[0]' : 'event_when',
985 'csvTitles[1]' : 'Staff', 'csvCols[1]' : 'person_name',
986 'csvTitles[2]' : 'Action', 'csvCols[2]' : 'action',
987 'csvTitles[3]' : 'Remarks', 'csvCols[3]' : 'remarks'
992 var act = _this.actionSel.getValue();
999 url : baseURL + '/Roo/Events.php',
1012 xtype: 'ColumnModel',
1016 dataIndex : 'event_when',
1017 renderer : function(v) { return v ? v.dateFormat('d/m/Y H:i') : ''; }
1020 xtype: 'ColumnModel',
1027 xtype: 'ColumnModel',
1029 dataIndex : 'person_name',
1032 renderer : function(v,x,r) {
1033 return String.format('{0} <<a href="mailto:{1}">{1}</a>>', v, r.data.person_id_email);
1037 xtype: 'ColumnModel',
1041 dataIndex : 'action',
1042 renderer : function(v) { return String.format('{0}', v); }
1045 xtype: 'ColumnModel',
1049 dataIndex : 'ipaddr',
1050 renderer : function(v) { return String.format('{0}', v); }
1053 xtype: 'ColumnModel',
1055 header : 'Affected',
1057 dataIndex : 'on_id',
1058 renderer : function(v, x, r) { return v ? String.format('{0}({1})', r.data.on_table, v) : ''; }
1061 xtype: 'ColumnModel',
1065 dataIndex : 'remarks',
1066 renderer : function(v) { return String.format('{0}', v); }
1071 this.layout = this.panel.layout;