X-Git-Url: http://git.roojs.org/?p=Pman.Admin;a=blobdiff_plain;f=Pman.Dialog.AdminEventLog.js;h=e650960bcc647e64c15dfdf1b3caa18893f1098e;hp=ee42858814f11452d39eea32910585f4d27acd5e;hb=HEAD;hpb=732966d721392d9b0fe33a892bc0900b996aa811 diff --git a/Pman.Dialog.AdminEventLog.js b/Pman.Dialog.AdminEventLog.js index ee42858..e650960 100644 --- a/Pman.Dialog.AdminEventLog.js +++ b/Pman.Dialog.AdminEventLog.js @@ -2,366 +2,331 @@ // Auto generated file - created by app.Builder.js- do not edit directly (at present!) +Roo.namespace('Pman.Dialog'); + Pman.Dialog.AdminEventLog = { - dialog : false, - callback: false, + _strings : { + '7a11042f53957727d8667732d7de1102' :"Ipaddr", + '231bc72756b5e6de492aaaa1577f61b1' :"Remarks", + '87f9f735a1d36793ceaecd4e47124b63' :"Events", + 'd9578744f1d4b13d40a51fbb8b9d6ea5' :"Person name", + 'c0a002606fb906d471e04fe02e5e53f9' :"Event history", + '6be4aa550791c310e098cd6c234af7d8' :"Event when", + 'd3d2e617335f08df83599665eef8a418' :"Close", + '7205d42d6d975c911bc1147259d78935' :"Displaying Events{0} - {1} of {2}", + '004bf6c9a40003140292e97330236c53' :"Action", + '90e4ac2e5a22e53df63b6b186d8727ba' :"No Events found" + }, - show : function(data, cb) - { - if (!this.dialog) { - this.create(); - } + dialog : false, + callback: false, - this.callback = cb; - this.data = data; - this.dialog.show(this.data._el); - if (this.form) { - this.form.reset(); - this.form.setValues(data); - this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data }); - } + show : function(data, cb) + { + if (!this.dialog) { + this.create(); + } - }, + this.callback = cb; + this.data = data; + this.dialog.show(this.data._el); + if (this.form) { + this.form.reset(); + this.form.setValues(data); + this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data }); + } + + }, - create : function() - { - var _this = this; - this.dialog = Roo.factory({ - xtype: 'LayoutDialog', - xns: Roo, - items : [ - { - xtype: 'GridPanel', - xns: Roo, - title : "Events", - fitToframe : true, - fitContainer : true, - tableName : 'Events', - background : true, - region : 'center', - listeners : { - activate : function() { - _this.panel = this; - if (_this.grid) { - _this.grid.footer.onClick('first'); - } - } - }, - grid : { - xtype: 'Grid', - xns: Roo.grid, - autoExpandColumn : 'person_name', - loadMask : true, - listeners : { - render : function() - { - _this.grid = this; - //_this.dialog = Pman.Dialog.FILL_IN - if (_this.panel.active) { - this.footer.onClick('first'); - } - }, - rowdblclick : function (_self, rowIndex, e) - { - if (!_this.dialog) return; - _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() { - _this.grid.footer.onClick('first'); - }); - } - }, - dataSource : { - xtype: 'Store', - xns: Roo.data, - remoteSort : true, - sortInfo : { field : 'person_name', direction: 'ASC' }, - proxy : { - xtype: 'HttpProxy', - xns: Roo.data, - method : 'GET', - url : baseURL + '/Roo/Events.php' - }, - reader : { - xtype: 'JsonReader', - xns: Roo.data, - totalProperty : 'total', - root : 'data', - id : 'id', - fields : [ - { - 'name': 'id', - 'type': 'int' - }, - { - 'name': 'person_name', - 'type': 'string' - }, - { - 'name': 'event_when', - 'type': 'date', - 'dateFormat': 'Y-m-d' - }, - { - 'name': 'action', - 'type': 'string' - }, - { - 'name': 'ipaddr', - 'type': 'string' - }, - { - 'name': 'on_id', - 'type': 'int' - }, - { - 'name': 'on_table', - 'type': 'string' - }, - { - 'name': 'person_id', - 'type': 'int' - }, - { - 'name': 'remarks', - 'type': 'string' - }, - { - 'name': 'person_table', - 'type': 'string' - }, - { - 'name': 'person_id_id', - 'type': 'int' - }, - { - 'name': 'person_id_office_id', - 'type': 'int' - }, - { - 'name': 'person_id_name', - 'type': 'string' - }, - { - 'name': 'person_id_phone', - 'type': 'string' - }, - { - 'name': 'person_id_fax', - 'type': 'string' - }, - { - 'name': 'person_id_email', - 'type': 'string' - }, - { - 'name': 'person_id_company_id', - 'type': 'int' - }, - { - 'name': 'person_id_role', - 'type': 'string' - }, - { - 'name': 'person_id_active', - 'type': 'int' - }, - { - 'name': 'person_id_remarks', - 'type': 'string' - }, - { - 'name': 'person_id_passwd', - 'type': 'string' - }, - { - 'name': 'person_id_owner_id', - 'type': 'int' - }, - { - 'name': 'person_id_lang', - 'type': 'string' - }, - { - 'name': 'person_id_no_reset_sent', - 'type': 'int' - }, - { - 'name': 'person_id_action_type', - 'type': 'string' - }, - { - 'name': 'person_id_project_id', - 'type': 'int' - }, - { - 'name': 'person_id_deleted_by', - 'type': 'int' - }, - { - 'name': 'person_id_deleted_dt', - 'type': 'date' - }, - { - 'name': 'person_id_firstname', - 'type': 'string' - }, - { - 'name': 'person_id_lastname', - 'type': 'string' - } - ] - } - }, - footer : { - xtype: 'PagingToolbar', - xns: Roo, - pageSize : 25, - displayInfo : true, - displayMsg : "Displaying Events{0} - {1} of {2}", - emptyMsg : "No Events found" - }, - toolbar : { - xtype: 'Toolbar', - xns: Roo, - items : [ - { - xtype: 'Button', - xns: Roo.Toolbar, - text : "Add", - cls : 'x-btn-text-icon', - icon : Roo.rootURL + 'images/default/dd/drop-add.gif', - listeners : { - click : function() - { - if (!_this.dialog) return; - _this.dialog.show( { id : 0 } , function() { - _this.grid.footer.onClick('first'); - }); - } - } - }, - { - xtype: 'Button', - xns: Roo.Toolbar, - text : "Edit", - cls : 'x-btn-text-icon', - icon : Roo.rootURL + 'images/default/tree/leaf.gif', - listeners : { - click : function() - { - var s = _this.grid.getSelectionModel().getSelections(); - if (!s.length || (s.length > 1)) { - Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row"); - return; - } - if (!_this.dialog) return; - _this.dialog.show(s[0].data, function() { - _this.grid.footer.onClick('first'); - }); - - } - } - }, - { - xtype: 'Button', - xns: Roo.Toolbar, - text : "Delete", - cls : 'x-btn-text-icon', - icon : rootURL + '/Pman/templates/images/trash.gif', - listeners : { - click : function() - { - Pman.genericDelete(_this, 'Events'); - } - } - } - ] - }, - colModel : [ - { - xtype: 'ColumnModel', - xns: Roo.grid, - header : 'Id', - width : 75, - dataIndex : 'id', - renderer : function(v) { return String.format('{0}', v); } - }, - { - xtype: 'ColumnModel', - xns: Roo.grid, - header : 'Person name', - width : 200, - dataIndex : 'person_name', - renderer : function(v) { return String.format('{0}', v); } - }, - { - xtype: 'ColumnModel', - xns: Roo.grid, - header : 'Event when', - width : 75, - dataIndex : 'event_when', - renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); } - }, - { - xtype: 'ColumnModel', - xns: Roo.grid, - header : 'Action', - width : 200, - dataIndex : 'action', - renderer : function(v) { return String.format('{0}', v); } - }, - { - xtype: 'ColumnModel', - xns: Roo.grid, - header : 'Ipaddr', - width : 200, - dataIndex : 'ipaddr', - renderer : function(v) { return String.format('{0}', v); } - }, - { - xtype: 'ColumnModel', - xns: Roo.grid, - header : 'On', - width : 75, - dataIndex : 'on_id', - renderer : function(v) { return String.format('{0}', v); } - }, - { - xtype: 'ColumnModel', - xns: Roo.grid, - header : 'On table', - width : 200, - dataIndex : 'on_table', - renderer : function(v) { return String.format('{0}', v); } - }, - { - xtype: 'ColumnModel', - xns: Roo.grid, - header : 'Person', - width : 75, - dataIndex : 'person_id', - renderer : function(v) { return String.format('{0}', v); } - }, - { - xtype: 'ColumnModel', - xns: Roo.grid, - header : 'Remarks', - width : 200, - dataIndex : 'remarks', - renderer : function(v) { return String.format('{0}', v); } - }, - { - xtype: 'ColumnModel', - xns: Roo.grid, - header : 'Person table', - width : 200, - dataIndex : 'person_table', - renderer : function(v) { return String.format('{0}', v); } - } - ] - } - } - ] - }); - } + create : function() + { + var _this = this; + this.dialog = Roo.factory({ + height : 500, + title : _this._strings['c0a002606fb906d471e04fe02e5e53f9'] /* Event history */, + width : 800, + xns : Roo, + '|xns' : 'Roo', + xtype : 'LayoutDialog', + listeners : { + show : function (_self) + { + _this.grid.footer.onClick('first'); + } + }, + center : { + xns : Roo, + '|xns' : 'Roo', + xtype : 'LayoutRegion' + }, + buttons : [ + { + text : _this._strings['d3d2e617335f08df83599665eef8a418'] /* Close */, + xns : Roo, + '|xns' : 'Roo', + xtype : 'Button', + listeners : { + click : function (_self, e) + { + _this.dialog.hide(); + } + } + } + ], + items : [ + { + background : false, + fitContainer : true, + fitToframe : true, + region : 'center', + tableName : 'Events', + title : _this._strings['87f9f735a1d36793ceaecd4e47124b63'] /* Events */, + xns : Roo, + '|xns' : 'Roo', + xtype : 'GridPanel', + listeners : { + activate : function() { + _this.panel = this; + if (_this.grid) { + _this.grid.footer.onClick('first'); + } + } + }, + grid : { + autoExpandColumn : 'remarks', + loadMask : true, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'Grid', + listeners : { + render : function() + { + _this.grid = this; + //_this.dialog = Pman.Dialog.FILL_IN + if (_this.panel.active) { + this.footer.onClick('first'); + } + } + }, + footer : { + displayInfo : true, + displayMsg : _this._strings['7205d42d6d975c911bc1147259d78935'] /* Displaying Events{0} - {1} of {2} */, + emptyMsg : _this._strings['90e4ac2e5a22e53df63b6b186d8727ba'] /* No Events found */, + pageSize : 25, + xns : Roo, + '|xns' : 'Roo', + xtype : 'PagingToolbar' + }, + dataSource : { + remoteSort : true, + sortInfo : { field : 'event_when', direction: 'DESC' }, + xns : Roo.data, + '|xns' : 'Roo.data', + xtype : 'Store', + listeners : { + beforeload : function (_self,o ) + { + if (!_this.data || !_this.data.on_id) { + return false; + } + o.params.on_table = _this.data.on_table; + o.params.on_id = _this.data.on_id; + + if (typeof(_this.data.person_table) != 'undefined') { + o.params.person_table =_this.data.person_table; + } + } + }, + proxy : { + method : 'GET', + url : baseURL + '/Roo/Events.php', + xns : Roo.data, + '|xns' : 'Roo.data', + xtype : 'HttpProxy' + }, + reader : { + fields : [ + { + 'name': 'id', + 'type': 'int' + }, + { + 'name': 'person_name', + 'type': 'string' + }, + { + 'name': 'event_when', + 'type': 'date', + 'dateFormat': 'Y-m-d' + }, + { + 'name': 'action', + 'type': 'string' + }, + { + 'name': 'ipaddr', + 'type': 'string' + }, + { + 'name': 'on_id', + 'type': 'int' + }, + { + 'name': 'on_table', + 'type': 'string' + }, + { + 'name': 'person_id', + 'type': 'int' + }, + { + 'name': 'remarks', + 'type': 'string' + }, + { + 'name': 'person_table', + 'type': 'string' + }, + { + 'name': 'person_id_id', + 'type': 'int' + }, + { + 'name': 'person_id_office_id', + 'type': 'int' + }, + { + 'name': 'person_id_name', + 'type': 'string' + }, + { + 'name': 'person_id_phone', + 'type': 'string' + }, + { + 'name': 'person_id_fax', + 'type': 'string' + }, + { + 'name': 'person_id_email', + 'type': 'string' + }, + { + 'name': 'person_id_company_id', + 'type': 'int' + }, + { + 'name': 'person_id_role', + 'type': 'string' + }, + { + 'name': 'person_id_active', + 'type': 'int' + }, + { + 'name': 'person_id_remarks', + 'type': 'string' + }, + { + 'name': 'person_id_passwd', + 'type': 'string' + }, + { + 'name': 'person_id_owner_id', + 'type': 'int' + }, + { + 'name': 'person_id_lang', + 'type': 'string' + }, + { + 'name': 'person_id_no_reset_sent', + 'type': 'int' + }, + { + 'name': 'person_id_action_type', + 'type': 'string' + }, + { + 'name': 'person_id_project_id', + 'type': 'int' + }, + { + 'name': 'person_id_deleted_by', + 'type': 'int' + }, + { + 'name': 'person_id_deleted_dt', + 'type': 'date' + }, + { + 'name': 'person_id_firstname', + 'type': 'string' + }, + { + 'name': 'person_id_lastname', + 'type': 'string' + } + ], + id : 'id', + root : 'data', + totalProperty : 'total', + xns : Roo.data, + '|xns' : 'Roo.data', + xtype : 'JsonReader' + } + }, + colModel : [ + { + dataIndex : 'event_when', + header : _this._strings['6be4aa550791c310e098cd6c234af7d8'] /* Event when */, + renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }, + width : 75, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' + }, + { + dataIndex : 'person_id_name', + header : _this._strings['d9578744f1d4b13d40a51fbb8b9d6ea5'] /* Person name */, + renderer : function(v) { return String.format('{0}', v); }, + width : 100, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' + }, + { + dataIndex : 'action', + header : _this._strings['004bf6c9a40003140292e97330236c53'] /* Action */, + renderer : function(v) { return String.format('{0}', v); }, + width : 80, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' + }, + { + dataIndex : 'ipaddr', + header : _this._strings['7a11042f53957727d8667732d7de1102'] /* Ipaddr */, + renderer : function(v) { return String.format('{0}', v); }, + width : 80, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' + }, + { + dataIndex : 'remarks', + header : _this._strings['231bc72756b5e6de492aaaa1577f61b1'] /* Remarks */, + renderer : function(v) { return String.format('{0}', v); }, + width : 200, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' + } + ] + } + } + ] + }); + } };