1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Pman.Dialog.CoreAutoSavePreview = {
10 show : function(data, cb)
18 this.dialog.show(this.data._el);
21 this.form.setValues(data);
22 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
30 this.dialog = Roo.factory({
31 xtype: 'LayoutDialog',
39 title : "Saved Version",
46 activate : function() {
49 _this.grid.footer.onClick('first');
65 //_this.dialog = Pman.Dialog.FILL_IN
66 if (_this.panel.active) {
67 this.footer.onClick('first');
71 autoExpandColumn : 'remarks',
74 xtype: 'RowSelectionModel',
77 afterselectionchange : function (_self)
79 // load detail log in _this.viewPanel;
80 if (!this.getSelected()) {
81 this.viewPanel.setContent("Nothing Selected");
84 var id = this.getSelected().data.id;
85 _this.viewPanel.load( { url : baseURL + "/Admin/EventView/" + id + ".html" });
95 beforeload : function (_self, o)
97 if (!Pman.buildCompleted) {
102 if (! _this.personSel) {
105 o.params = o.params || {};
106 o.params.person_id = _this.personSel.getValue();
107 var act = _this.actionSel.getValue();
109 o.params.action = act;
111 var tbl = _this.affectSel.getValue();
113 o.params.on_table = tbl;
115 act = _this.dateFrom.getValue();
117 o.params['query[from]'] = act.format('Y-m-d');
119 act = _this.dateTo.getValue();
121 o.params['query[to]'] = act.format('Y-m-d');
126 act = _this.groupedCombo.getValue();
127 o.params['query[grouped]'] = act;
128 if (o.params['query[grouped]'] == 'gr') {
131 Roo.MessageBox.alert("Error", "Select a table to group results on");
134 // o.params['_columns'] =
135 o.params['_distinct'] = 'on_id';
146 sortInfo : { field: 'event_when', direction: 'DESC'},
150 totalProperty : 'total',
159 'name': 'person_name',
163 'name': 'event_when',
165 'dateFormat': 'Y-m-d'
192 'name': 'person_id_id',
196 'name': 'person_id_office_id',
200 'name': 'person_id_name',
204 'name': 'person_id_phone',
208 'name': 'person_id_fax',
212 'name': 'person_id_email',
216 'name': 'person_id_company_id',
220 'name': 'person_id_role',
224 'name': 'person_id_active',
228 'name': 'person_id_remarks',
232 'name': 'person_id_passwd',
236 'name': 'person_id_owner_id',
240 'name': 'person_id_lang',
244 'name': 'person_id_no_reset_sent',
248 'name': 'person_id_action_type',
252 'name': 'person_id_project_id',
256 'name': 'person_id_deleted_by',
260 'name': 'person_id_deleted_dt',
269 url : baseURL + '/Roo/Events.php'
273 xtype: 'PagingToolbar',
277 displayMsg : "Displaying Events {0} - {1} of {2}",
278 emptyMsg : "No Events found",
284 click : function (_self, e)
288 'sort' : 'event_when',
292 person_id : _this.personSel.getValue(),
293 'csvTitles[0]' : 'When', 'csvCols[0]' : 'event_when',
294 'csvTitles[1]' : 'Staff', 'csvCols[1]' : 'person_id_name',
295 'csvTitles[2]' : 'Action', 'csvCols[2]' : 'action',
296 'csvTitles[3]' : 'Record ID', 'csvCols[3]' : 'on_id' ,
297 'csvTitles[4]' : 'Record Type', 'csvCols[4]' : 'on_table',
298 'csvTitles[5]' : 'Remarks', 'csvCols[5]' : 'remarks'
301 params.person_id = _this.personSel.getValue();
302 var act = _this.actionSel.getValue();
306 var tbl = _this.affectSel.getValue();
308 params.on_table = tbl;
310 act = _this.dateFrom.getValue();
312 params['query[from]'] = act.format('Y-m-d');
314 act = _this.dateTo.getValue();
316 params['query[to]'] = act.format('Y-m-d');
322 url : baseURL + '/Roo/Events.php',
329 text : "Download to Excel"
346 select : function (combo, record, index)
348 _this.grid.footer.onClick('first');
351 render : function (_self)
353 _this.personSel = _self;
357 displayField : 'name',
359 emptyText : "Select Person ",
360 fieldLabel : 'Person ',
361 forceSelection : true,
363 loadingText : "Searching...",
365 name : 'person_id_name',
367 qtip : "Select Person ",
368 queryParam : 'query[name]',
369 selectOnFocus : true,
370 tpl : '<div class="x-grid-cell-text x-btn button"><b>{name}</b> ({company_id_name}) <{email}> </div>',
371 triggerAction : 'all',
379 beforeload : function (_self, o)
381 o.params = o.params || {};
382 o.params.company_id = Pman.Login.authUser.company_id;
386 sortInfo : { field : 'name' , direction : 'ASC' },
391 url : baseURL + '/Roo/Person.php'
398 totalProperty : 'total',
425 'name': 'company_id',
453 'name': 'no_reset_sent',
457 'name': 'action_type',
461 'name': 'project_id',
465 'name': 'deleted_by',
469 'name': 'deleted_dt',
471 'dateFormat': 'Y-m-d'
474 'name': 'office_id_id',
478 'name': 'office_id_company_id',
482 'name': 'office_id_name',
486 'name': 'office_id_address',
490 'name': 'office_id_phone',
494 'name': 'office_id_fax',
498 'name': 'office_id_email',
502 'name': 'office_id_role',
506 'name': 'company_id_code',
510 'name': 'company_id_name',
514 'name': 'company_id_remarks',
518 'name': 'company_id_owner_id',
522 'name': 'company_id_address',
526 'name': 'company_id_tel',
530 'name': 'company_id_fax',
534 'name': 'company_id_email',
538 'name': 'company_id_id',
542 'name': 'company_id_isOwner',
546 'name': 'company_id_logo_id',
550 'name': 'company_id_background_color',
554 'name': 'company_id_comptype',
558 'name': 'company_id_url',
562 'name': 'company_id_main_office_id',
566 'name': 'company_id_created_by',
570 'name': 'company_id_created_dt',
574 'name': 'company_id_updated_by',
578 'name': 'company_id_updated_dt',
582 'name': 'company_id_passwd',
586 'name': 'company_id_dispatch_port',
590 'name': 'company_id_province',
594 'name': 'company_id_country',
598 'name': 'project_id_id',
602 'name': 'project_id_name',
606 'name': 'project_id_remarks',
610 'name': 'project_id_owner_id',
614 'name': 'project_id_code',
618 'name': 'project_id_active',
622 'name': 'project_id_type',
626 'name': 'project_id_client_id',
630 'name': 'project_id_team_id',
634 'name': 'project_id_file_location',
638 'name': 'project_id_open_date',
642 'name': 'project_id_open_by',
646 'name': 'project_id_close_date',
650 'name': 'project_id_countries',
654 'name': 'project_id_languages',
658 'name': 'project_id_agency_id',
662 'name': 'owner_id_id',
666 'name': 'owner_id_office_id',
670 'name': 'owner_id_name',
674 'name': 'owner_id_phone',
678 'name': 'owner_id_fax',
682 'name': 'owner_id_email',
686 'name': 'owner_id_company_id',
690 'name': 'owner_id_role',
694 'name': 'owner_id_active',
698 'name': 'owner_id_remarks',
702 'name': 'owner_id_passwd',
706 'name': 'owner_id_owner_id',
710 'name': 'owner_id_lang',
714 'name': 'owner_id_no_reset_sent',
718 'name': 'owner_id_action_type',
722 'name': 'owner_id_project_id',
726 'name': 'owner_id_deleted_by',
730 'name': 'owner_id_deleted_dt',
741 select : function (combo, record, index)
743 _this.grid.footer.onClick('first');
745 render : function (_self)
747 _this.actionSel = _self;
751 displayField : 'action',
753 emptyText : "Select Action",
754 forceSelection : true,
756 loadingText : "Searching...",
760 qtip : "Select Action",
761 queryParam : 'query[action]',
762 selectOnFocus : true,
763 tpl : '<div class="x-grid-cell-text x-btn button"><b>{action}</b> </div>',
764 triggerAction : 'all',
766 valueField : 'action',
772 beforeload : function (_self, o)
774 o.params = o.params || {};
775 // staff can see all logs, other companies can only see their own.
776 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
777 o.params.company_id = Pman.Login.authUser.company_id;
779 o.params._distinct = 'action';
780 o.params._columns ='action';
784 sortInfo : { field : 'action' , direction : 'ASC' },
789 url : baseURL + '/Roo/Events.php'
796 totalProperty : 'total',
803 'name': 'person_name',
807 'name': 'event_when',
809 'dateFormat': 'Y-m-d'
836 'name': 'person_id_id',
840 'name': 'person_id_office_id',
844 'name': 'person_id_name',
848 'name': 'person_id_phone',
852 'name': 'person_id_fax',
856 'name': 'person_id_email',
860 'name': 'person_id_company_id',
864 'name': 'person_id_role',
868 'name': 'person_id_active',
872 'name': 'person_id_remarks',
876 'name': 'person_id_passwd',
880 'name': 'person_id_owner_id',
884 'name': 'person_id_lang',
888 'name': 'person_id_no_reset_sent',
892 'name': 'person_id_action_type',
896 'name': 'person_id_project_id',
900 'name': 'person_id_deleted_by',
904 'name': 'person_id_deleted_dt',
915 select : function (combo, record, index)
917 _this.grid.footer.onClick('first');
919 render : function (_self)
921 _this.affectSel = _self;
925 displayField : 'on_table',
927 emptyText : "Select Affects",
928 forceSelection : true,
930 loadingText : "Searching...",
934 qtip : "Select Action",
935 queryParam : 'query[on_table]',
936 selectOnFocus : true,
937 tpl : '<div class="x-grid-cell-text x-btn button"><b>{on_table}</b> </div>',
938 triggerAction : 'all',
940 valueField : 'action',
946 beforeload : function (_self, o)
948 o.params = o.params || {};
949 // staff can see all logs, other companies can only see their own.
950 if (Pman.Login.authUser.company_id_comptype != 'OWNER') {
951 o.params.company_id = Pman.Login.authUser.company_id;
953 o.params._distinct = 'on_table';
954 o.params._columns ='on_table';
958 sortInfo : { field : 'on_table' , direction : 'ASC' },
963 url : baseURL + '/Roo/Events.php'
968 totalProperty : 'total',
977 'name': 'person_name',
981 'name': 'event_when',
983 'dateFormat': 'Y-m-d'
1002 'name': 'person_id',
1010 'name': 'person_id_id',
1014 'name': 'person_id_office_id',
1018 'name': 'person_id_name',
1022 'name': 'person_id_phone',
1026 'name': 'person_id_fax',
1030 'name': 'person_id_email',
1034 'name': 'person_id_company_id',
1038 'name': 'person_id_role',
1042 'name': 'person_id_active',
1046 'name': 'person_id_remarks',
1050 'name': 'person_id_passwd',
1054 'name': 'person_id_owner_id',
1058 'name': 'person_id_lang',
1062 'name': 'person_id_no_reset_sent',
1066 'name': 'person_id_action_type',
1070 'name': 'person_id_project_id',
1074 'name': 'person_id_deleted_by',
1078 'name': 'person_id_deleted_dt',
1094 render : function (_self)
1096 _this.dateFrom = _self;
1098 change : function (_self, newValue, oldValue)
1100 _this.grid.footer.onClick('first');
1109 render : function (_self)
1111 _this.dateTo = _self;
1113 change : function (_self, newValue, oldValue)
1115 _this.grid.footer.onClick('first');
1124 xtype: 'ColumnModel',
1126 dataIndex : 'event_when',
1129 renderer : function(v) { return v ? v.dateFormat('d/m/Y H:i') : ''; }
1132 xtype: 'ColumnModel',
1134 dataIndex : 'on_table',
1135 header : 'Affected',
1137 renderer : function(v, x, r) {
1138 return v ? String.format('{0}({1})', v, r.data.on_id) : '';
1142 xtype: 'ColumnModel',
1144 dataIndex : 'remarks',
1147 renderer : function(v) { return String.format('<span qtip="{1}">{0}</span>', v, Roo.util.Format.htmlEncode(v)); }
1154 xtype: 'LayoutRegion',
1159 xtype: 'LayoutRegion',
1169 click : function() {
1170 _this.dialog.hide();
1179 click : function() {
1180 _this.dialog.hide();