From: Alan Knowles Date: Mon, 27 Jun 2016 07:51:04 +0000 (+0800) Subject: sync X-Git-Url: http://git.roojs.org/?p=Pman.Admin;a=commitdiff_plain;h=8bded7eab2f8a199d1c2cbafa5ace85038076d33 sync --- diff --git a/Pman.Dialog.AdminEventLog.bjs b/Pman.Dialog.AdminEventLog.bjs index 835879e..4e048b9 100644 --- a/Pman.Dialog.AdminEventLog.bjs +++ b/Pman.Dialog.AdminEventLog.bjs @@ -1,147 +1,157 @@ { - "id": "roo-file-545", - "name": "Pman.Dialog.AdminEventLog", - "parent": "", - "title": "", - "path": "/home/alan/gitlive/Pman.Admin/Pman.Dialog.AdminEventLog.bjs", - "items": [ + "name" : "Pman.Dialog.AdminEventLog", + "parent" : "", + "title" : "", + "path" : "/home/alan/gitlive/Pman.Admin/Pman.Dialog.AdminEventLog.bjs", + "permname" : "", + "modOrder" : "001", + "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" + }, + "items" : [ + { + "listeners" : { + "show" : "function (_self)\n{\n _this.grid.footer.onClick('first');\n}" + }, + "title" : "Event history", + "xtype" : "LayoutDialog", + "width" : 800, + "$ xns" : "Roo", + "height" : 500, + "items" : [ + { + "xtype" : "LayoutRegion", + "$ xns" : "Roo", + "* prop" : "center" + }, + { + "listeners" : { + "|activate" : "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}" + }, + "fitToframe" : true, + "background" : false, + "region" : "center", + "title" : "Events", + "xtype" : "GridPanel", + "fitContainer" : true, + "$ xns" : "Roo", + "tableName" : "Events", + "items" : [ + { + "listeners" : { + "|render" : "function() \n{\n _this.grid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}" + }, + "autoExpandColumn" : "remarks", + "xtype" : "Grid", + "loadMask" : true, + "$ xns" : "Roo.grid", + "* prop" : "grid", + "items" : [ { - "listeners": { - "show": "function (_self)\n{\n _this.grid.footer.onClick('first');\n}" - }, - "height": 500, - "title": "Event history", - "width": 800, - "xtype": "LayoutDialog", - "|xns": "Roo", - "items": [ - { - "|xns": "Roo", - "xtype": "LayoutRegion", - "*prop": "center" - }, - { - "listeners": { - "|activate": "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}" - }, - "background": false, - "fitContainer": true, - "fitToframe": true, - "region": "center", - "tableName": "Events", - "title": "Events", - "xtype": "GridPanel", - "|xns": "Roo", - "items": [ - { - "listeners": { - "|render": "function() \n{\n _this.grid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}", - "|rowdblclick": "function (_self, rowIndex, e)\n{\n if (!_this.dialog) return;\n _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {\n _this.grid.footer.onClick('first');\n }); \n}\n" - }, - "*prop": "grid", - "autoExpandColumn": "remarks", - "loadMask": true, - "xtype": "Grid", - "|xns": "Roo.grid", - "items": [ - { - "listeners": { - "beforeload": "function (_self,o )\n{\n if (!_this.data || !_this.data.on_id) {\n return false;\n }\n o.params.on_table = _this.data.on_table;\n o.params.on_id = _this.data.on_id;\n \n if (typeof(_this.data.person_table) != 'undefined') {\n o.params.person_table =_this.data.person_table;\n }\n}" - }, - "*prop": "dataSource", - "remoteSort": true, - "xtype": "Store", - "|sortInfo": "{ field : 'event_when', direction: 'DESC' }", - "|xns": "Roo.data", - "items": [ - { - "*prop": "proxy", - "xtype": "HttpProxy", - "method": "GET", - "|url": "baseURL + '/Roo/Events.php'", - "|xns": "Roo.data" - }, - { - "|xns": "Roo.data", - "xtype": "JsonReader", - "totalProperty": "total", - "root": "data", - "*prop": "reader", - "id": "id", - "|fields": "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'person_name',\n 'type': 'string'\n },\n {\n 'name': 'event_when',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'action',\n 'type': 'string'\n },\n {\n 'name': 'ipaddr',\n 'type': 'string'\n },\n {\n 'name': 'on_id',\n 'type': 'int'\n },\n {\n 'name': 'on_table',\n 'type': 'string'\n },\n {\n 'name': 'person_id',\n 'type': 'int'\n },\n {\n 'name': 'remarks',\n 'type': 'string'\n },\n {\n 'name': 'person_table',\n 'type': 'string'\n },\n {\n 'name': 'person_id_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_office_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_name',\n 'type': 'string'\n },\n {\n 'name': 'person_id_phone',\n 'type': 'string'\n },\n {\n 'name': 'person_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'person_id_email',\n 'type': 'string'\n },\n {\n 'name': 'person_id_company_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_role',\n 'type': 'string'\n },\n {\n 'name': 'person_id_active',\n 'type': 'int'\n },\n {\n 'name': 'person_id_remarks',\n 'type': 'string'\n },\n {\n 'name': 'person_id_passwd',\n 'type': 'string'\n },\n {\n 'name': 'person_id_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_lang',\n 'type': 'string'\n },\n {\n 'name': 'person_id_no_reset_sent',\n 'type': 'int'\n },\n {\n 'name': 'person_id_action_type',\n 'type': 'string'\n },\n {\n 'name': 'person_id_project_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_deleted_by',\n 'type': 'int'\n },\n {\n 'name': 'person_id_deleted_dt',\n 'type': 'date'\n },\n {\n 'name': 'person_id_firstname',\n 'type': 'string'\n },\n {\n 'name': 'person_id_lastname',\n 'type': 'string'\n }\n]" - } - ] - }, - { - "*prop": "footer", - "xtype": "PagingToolbar", - "pageSize": 25, - "displayInfo": true, - "displayMsg": "Displaying Events{0} - {1} of {2}", - "emptyMsg": "No Events found", - "|xns": "Roo" - }, - { - "xtype": "ColumnModel", - "header": "Event when", - "width": 75, - "dataIndex": "event_when", - "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }", - "|xns": "Roo.grid", - "*prop": "colModel[]" - }, - { - "*prop": "colModel[]", - "dataIndex": "person_id_name", - "header": "Person name", - "width": 100, - "xtype": "ColumnModel", - "|renderer": "function(v) { return String.format('{0}', v); }", - "|xns": "Roo.grid" - }, - { - "*prop": "colModel[]", - "dataIndex": "action", - "header": "Action", - "width": 80, - "xtype": "ColumnModel", - "|renderer": "function(v) { return String.format('{0}', v); }", - "|xns": "Roo.grid" - }, - { - "*prop": "colModel[]", - "dataIndex": "ipaddr", - "header": "Ipaddr", - "width": 80, - "xtype": "ColumnModel", - "|renderer": "function(v) { return String.format('{0}', v); }", - "|xns": "Roo.grid" - }, - { - "xtype": "ColumnModel", - "header": "Remarks", - "width": 200, - "dataIndex": "remarks", - "|renderer": "function(v) { return String.format('{0}', v); }", - "|xns": "Roo.grid", - "*prop": "colModel[]" - } - ] - } - ] - }, - { - "listeners": { - "click": "function (_self, e)\n{\n _this.dialog.hide();\n}" - }, - "*prop": "buttons[]", - "text": "Close", - "xtype": "Button", - "|xns": "Roo" - } - ] + "listeners" : { + "beforeload" : "function (_self,o )\n{\n if (!_this.data || !_this.data.on_id) {\n return false;\n }\n o.params.on_table = _this.data.on_table;\n o.params.on_id = _this.data.on_id;\n \n if (typeof(_this.data.person_table) != 'undefined') {\n o.params.person_table =_this.data.person_table;\n }\n}" + }, + "xtype" : "Store", + "remoteSort" : true, + "$ sortInfo" : "{ field : 'event_when', direction: 'DESC' }", + "$ xns" : "Roo.data", + "* prop" : "dataSource", + "items" : [ + { + "$ url" : "baseURL + '/Roo/Events.php'", + "method" : "GET", + "xtype" : "HttpProxy", + "$ xns" : "Roo.data", + "* prop" : "proxy" + }, + { + "id" : "id", + "root" : "data", + "xtype" : "JsonReader", + "$ xns" : "Roo.data", + "$ fields" : "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'person_name',\n 'type': 'string'\n },\n {\n 'name': 'event_when',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'action',\n 'type': 'string'\n },\n {\n 'name': 'ipaddr',\n 'type': 'string'\n },\n {\n 'name': 'on_id',\n 'type': 'int'\n },\n {\n 'name': 'on_table',\n 'type': 'string'\n },\n {\n 'name': 'person_id',\n 'type': 'int'\n },\n {\n 'name': 'remarks',\n 'type': 'string'\n },\n {\n 'name': 'person_table',\n 'type': 'string'\n },\n {\n 'name': 'person_id_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_office_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_name',\n 'type': 'string'\n },\n {\n 'name': 'person_id_phone',\n 'type': 'string'\n },\n {\n 'name': 'person_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'person_id_email',\n 'type': 'string'\n },\n {\n 'name': 'person_id_company_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_role',\n 'type': 'string'\n },\n {\n 'name': 'person_id_active',\n 'type': 'int'\n },\n {\n 'name': 'person_id_remarks',\n 'type': 'string'\n },\n {\n 'name': 'person_id_passwd',\n 'type': 'string'\n },\n {\n 'name': 'person_id_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_lang',\n 'type': 'string'\n },\n {\n 'name': 'person_id_no_reset_sent',\n 'type': 'int'\n },\n {\n 'name': 'person_id_action_type',\n 'type': 'string'\n },\n {\n 'name': 'person_id_project_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_deleted_by',\n 'type': 'int'\n },\n {\n 'name': 'person_id_deleted_dt',\n 'type': 'date'\n },\n {\n 'name': 'person_id_firstname',\n 'type': 'string'\n },\n {\n 'name': 'person_id_lastname',\n 'type': 'string'\n }\n]", + "* prop" : "reader", + "totalProperty" : "total" + } + ] + }, + { + "pageSize" : 25, + "xtype" : "PagingToolbar", + "emptyMsg" : "No Events found", + "$ xns" : "Roo", + "displayInfo" : true, + "displayMsg" : "Displaying Events{0} - {1} of {2}", + "* prop" : "footer" + }, + { + "xtype" : "ColumnModel", + "width" : 75, + "header" : "Event when", + "$ renderer" : "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "event_when" + }, + { + "xtype" : "ColumnModel", + "header" : "Person name", + "width" : 100, + "$ renderer" : "function(v) { return String.format('{0}', v); }", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "person_id_name" + }, + { + "xtype" : "ColumnModel", + "header" : "Action", + "width" : 80, + "$ renderer" : "function(v) { return String.format('{0}', v); }", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "action" + }, + { + "xtype" : "ColumnModel", + "header" : "Ipaddr", + "width" : 80, + "$ renderer" : "function(v) { return String.format('{0}', v); }", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "ipaddr" + }, + { + "xtype" : "ColumnModel", + "width" : 200, + "header" : "Remarks", + "$ renderer" : "function(v) { return String.format('{0}', v); }", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "remarks" } - ], - "permname": "", - "modOrder": "001" + ] + } + ] + }, + { + "listeners" : { + "click" : "function (_self, e)\n{\n _this.dialog.hide();\n}" + }, + "text" : "Close", + "xtype" : "Button", + "$ xns" : "Roo", + "* prop" : "buttons[]" + } + ] + } + ] } \ No newline at end of file diff --git a/Pman.Dialog.AdminEventLog.js b/Pman.Dialog.AdminEventLog.js index e07598e..e650960 100644 --- a/Pman.Dialog.AdminEventLog.js +++ b/Pman.Dialog.AdminEventLog.js @@ -2,309 +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, - listeners : { - show : function (_self) - { - _this.grid.footer.onClick('first'); - } - }, - height : 500, - title : "Event history", - width : 800, - items : [ - { - xtype: 'GridPanel', - xns: Roo, - listeners : { - activate : function() { - _this.panel = this; - if (_this.grid) { - _this.grid.footer.onClick('first'); - } - } - }, - background : false, - fitContainer : true, - fitToframe : true, - region : 'center', - tableName : 'Events', - title : "Events", - grid : { - xtype: 'Grid', - xns: Roo.grid, - 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'); - }); - } - }, - autoExpandColumn : 'remarks', - loadMask : true, - dataSource : { - xtype: 'Store', - xns: Roo.data, - 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; - } - } - }, - remoteSort : true, - sortInfo : { field : 'event_when', direction: 'DESC' }, - 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" - }, - colModel : [ - { - 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, - dataIndex : 'person_id_name', - header : 'Person name', - width : 100, - renderer : function(v) { return String.format('{0}', v); } - }, - { - xtype: 'ColumnModel', - xns: Roo.grid, - dataIndex : 'action', - header : 'Action', - width : 80, - renderer : function(v) { return String.format('{0}', v); } - }, - { - xtype: 'ColumnModel', - xns: Roo.grid, - dataIndex : 'ipaddr', - header : 'Ipaddr', - width : 80, - 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); } - } - ] - } - } - ], - center : { - xtype: 'LayoutRegion', - xns: Roo - }, - buttons : [ - { - xtype: 'Button', - xns: Roo, - listeners : { - click : function (_self, e) - { - _this.dialog.hide(); - } - }, - text : "Close" - } - ] - }); - } + 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' + } + ] + } + } + ] + }); + } }; diff --git a/Pman.Tab.AdminCompanies.bjs b/Pman.Tab.AdminCompanies.bjs index 480c0cc..0e42218 100644 --- a/Pman.Tab.AdminCompanies.bjs +++ b/Pman.Tab.AdminCompanies.bjs @@ -2,7 +2,7 @@ "name" : "Pman.Tab.AdminCompanies", "parent" : "Pman.Tab.Admin", "title" : "Pman.Tab.AdminCompanies", - "path" : "/home/edward/gitlive/Pman.Admin/Pman.Tab.AdminCompanies.bjs", + "path" : "/home/alan/gitlive/Pman.Admin/Pman.Tab.AdminCompanies.bjs", "permname" : "Admin.Companies", "modOrder" : "030", "strings" : { @@ -24,8 +24,8 @@ "items" : [ { "region" : "center", - "xtype" : "NestedLayoutPanel", "title" : "Companies", + "xtype" : "NestedLayoutPanel", "$ xns" : "Roo", "items" : [ { @@ -50,9 +50,9 @@ "listeners" : { "|activate" : "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}" }, + "fitToframe" : true, "background" : true, "region" : "center", - "fitToframe" : true, "title" : "Companies", "xtype" : "GridPanel", "fitContainer" : true, @@ -61,7 +61,7 @@ "items" : [ { "listeners" : { - "|rowdblclick" : "function (_self, rowIndex, e)\n{\n if (!_this.dialog) return;\n _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {\n _this.grid.footer.onClick('first');\n }); \n \n \n}\n", + "|rowdblclick" : "function (_self, rowIndex, e)\n{\n if (!_this.dialog) {\n return;\n }\n _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {\n _this.grid.footer.onClick('first');\n }); \n \n \n}\n", "|render" : "function() \n{\n _this.grid = this; \n _this.dialog = Pman.Dialog.Companies;\n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}", "rowclick" : "function (_self, rowIndex, e)\n{\n try { Pman.Tab.AdminOffice.grid.footer.onClick('refresh'); } catch(e) {}\n}" }, @@ -87,8 +87,8 @@ "load" : "function (This, o, arg)\n{\n \n}" }, "$ url" : "baseURL + '/Roo/Companies.php'", - "xtype" : "HttpProxy", "method" : "GET", + "xtype" : "HttpProxy", "$ xns" : "Roo.data", "* prop" : "proxy" }, @@ -150,7 +150,7 @@ }, { "listeners" : { - "|click" : "function()\n{\n if (!_this.dialog) return;\n _this.dialog.show( { id : 0 } , function() {\n _this.grid.footer.onClick('first');\n }); \n}\n" + "|click" : "function()\n{\n if (!_this.dialog) {\n return;\n }\n _this.dialog.show( { id : 0 } , function() {\n _this.grid.footer.onClick('first');\n }); \n}\n" }, "text" : "Add", "xtype" : "Button", @@ -160,7 +160,7 @@ }, { "listeners" : { - "|click" : "function()\n{\n var s = _this.grid.getSelectionModel().getSelections();\n if (!s.length || (s.length > 1)) {\n Roo.MessageBox.alert(\"Error\", s.length ? \"Select only one Row\" : \"Select a Row\");\n return;\n }\n if (!_this.dialog) return;\n _this.dialog.show(s[0].data, function() {\n _this.grid.footer.onClick('first');\n }); \n \n}\n" + "|click" : "function()\n{\n var s = _this.grid.getSelectionModel().getSelections();\n if (!s.length || (s.length > 1)) {\n Roo.MessageBox.alert(\"Error\", s.length ? \"Select only one Row\" : \"Select a Row\");\n return;\n }\n if (!_this.dialog) {\n return;\n }\n _this.dialog.show(s[0].data, function() {\n _this.grid.footer.onClick('first');\n }); \n \n}\n" }, "text" : "Edit", "xtype" : "Button", @@ -212,8 +212,8 @@ }, { "xtype" : "ColumnModel", - "header" : "Tel", "width" : 100, + "header" : "Tel", "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", @@ -221,8 +221,8 @@ }, { "xtype" : "ColumnModel", - "header" : "Fax", "width" : 100, + "header" : "Fax", "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", @@ -250,8 +250,8 @@ }, { "xtype" : "ColumnModel", - "width" : 200, "header" : "Remarks", + "width" : 200, "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", diff --git a/Pman.Tab.AdminCompanies.js b/Pman.Tab.AdminCompanies.js index 37f129b..e512d8b 100644 --- a/Pman.Tab.AdminCompanies.js +++ b/Pman.Tab.AdminCompanies.js @@ -97,7 +97,9 @@ Pman.Tab.AdminCompanies = new Roo.XComponent({ }, rowdblclick : function (_self, rowIndex, e) { - if (!_this.dialog) return; + if (!_this.dialog) { + return; + } _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() { _this.grid.footer.onClick('first'); }); @@ -182,7 +184,9 @@ Pman.Tab.AdminCompanies = new Roo.XComponent({ listeners : { click : function() { - if (!_this.dialog) return; + if (!_this.dialog) { + return; + } _this.dialog.show( { id : 0 } , function() { _this.grid.footer.onClick('first'); }); @@ -204,7 +208,9 @@ Pman.Tab.AdminCompanies = new Roo.XComponent({ Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row"); return; } - if (!_this.dialog) return; + if (!_this.dialog) { + return; + } _this.dialog.show(s[0].data, function() { _this.grid.footer.onClick('first'); }); diff --git a/Pman.Tab.AdminContacts.bjs b/Pman.Tab.AdminContacts.bjs index 88734dd..35069dd 100644 --- a/Pman.Tab.AdminContacts.bjs +++ b/Pman.Tab.AdminContacts.bjs @@ -2,7 +2,7 @@ "name" : "Pman.Tab.AdminContacts", "parent" : "Pman.Tab.AdminContactsManager", "title" : "Pman.Tab.AdminContacts", - "path" : "/home/edward/gitlive/Pman.Admin/Pman.Tab.AdminContacts.bjs", + "path" : "/home/alan/gitlive/Pman.Admin/Pman.Tab.AdminContacts.bjs", "permname" : "Core.Person", "modOrder" : "001", "strings" : { @@ -37,8 +37,8 @@ "|activate" : "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}" }, "autoScroll" : true, - "background" : true, "fitToframe" : true, + "background" : true, "region" : "center", "title" : "Person", "xtype" : "GridPanel", @@ -48,9 +48,9 @@ "items" : [ { "listeners" : { - "|rowdblclick" : "function (_self, rowIndex, e)\n{\n if (!_this.dialog) return;\n _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {\n _this.grid.footer.onClick('first');\n }); \n}\n", - "cellclick" : "function (_self, rowIndex, columnIndex, e)\n{\n\n var di = this.colModel.getDataIndex(columnIndex);\n if (di != 'active') {\n return;\n }\n \n var rec = _this.grid.ds.getAt(rowIndex);\n \n rec.set('active', rec.data.active ? 0 : 1);\n rec.commit();\n \n \n}", - "|render" : "function() \n{\n _this.grid = this; \n if (!_this.dialog) {\n _this.dialog = Pman.Dialog.PersonEdit;\n \n }\n //_this.dialog = Pman.Dialog.FILL_IN\n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}" + "|rowdblclick" : "function (_self, rowIndex, e)\n{\n if (!_this.dialog) {\n return;\n }\n _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {\n _this.grid.footer.onClick('first');\n }); \n}\n", + "|render" : "function() \n{\n _this.grid = this; \n if (!_this.dialog) {\n _this.dialog = Pman.Dialog.PersonEdit;\n \n }\n //_this.dialog = Pman.Dialog.FILL_IN\n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}", + "cellclick" : "function (_self, rowIndex, columnIndex, e)\n{\n\n var di = this.colModel.getDataIndex(columnIndex);\n if (di != 'active') {\n return;\n }\n \n var rec = _this.grid.ds.getAt(rowIndex);\n \n rec.set('active', rec.data.active ? 0 : 1);\n rec.commit();\n \n \n}" }, "autoExpandColumn" : "name", "xtype" : "Grid", @@ -73,8 +73,8 @@ "items" : [ { "$ url" : "baseURL + '/Roo/Person.php'", - "method" : "GET", "xtype" : "HttpProxy", + "method" : "GET", "$ xns" : "Roo.data", "* prop" : "proxy" }, @@ -83,7 +83,6 @@ "root" : "data", "xtype" : "JsonReader", "$ xns" : "Roo.data", - "$ fields" : "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'office_id',\n 'type': 'int'\n },\n {\n 'name': 'name',\n 'type': 'string'\n },\n {\n 'name': 'phone',\n 'type': 'string'\n },\n {\n 'name': 'fax',\n 'type': 'string'\n },\n {\n 'name': 'email',\n 'type': 'string'\n },\n {\n 'name': 'company_id',\n 'type': 'int'\n },\n {\n 'name': 'role',\n 'type': 'string'\n },\n {\n 'name': 'active',\n 'type': 'int'\n },\n {\n 'name': 'remarks',\n 'type': 'string'\n },\n {\n 'name': 'passwd',\n 'type': 'string'\n },\n {\n 'name': 'owner_id',\n 'type': 'int'\n },\n {\n 'name': 'lang',\n 'type': 'string'\n },\n {\n 'name': 'no_reset_sent',\n 'type': 'int'\n },\n {\n 'name': 'action_type',\n 'type': 'string'\n },\n {\n 'name': 'project_id',\n 'type': 'int'\n },\n {\n 'name': 'office_id_id',\n 'type': 'int'\n },\n {\n 'name': 'office_id_company_id',\n 'type': 'int'\n },\n {\n 'name': 'office_id_name',\n 'type': 'string'\n },\n {\n 'name': 'office_id_address',\n 'type': 'string'\n },\n {\n 'name': 'office_id_phone',\n 'type': 'string'\n },\n {\n 'name': 'office_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'office_id_email',\n 'type': 'string'\n },\n {\n 'name': 'office_id_role',\n 'type': 'string'\n },\n {\n 'name': 'company_id_code',\n 'type': 'string'\n },\n {\n 'name': 'company_id_name',\n 'type': 'string'\n },\n {\n 'name': 'company_id_remarks',\n 'type': 'string'\n },\n {\n 'name': 'company_id_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'company_id_address',\n 'type': 'string'\n },\n {\n 'name': 'company_id_tel',\n 'type': 'string'\n },\n {\n 'name': 'company_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'company_id_email',\n 'type': 'string'\n },\n {\n 'name': 'company_id_id',\n 'type': 'int'\n },\n {\n 'name': 'company_id_isOwner',\n 'type': 'int'\n },\n {\n 'name': 'company_id_logo_id',\n 'type': 'int'\n },\n {\n 'name': 'company_id_background_color',\n 'type': 'string'\n },\n {\n 'name': 'company_id_comptype',\n 'type': 'string'\n },\n {\n 'name': 'company_id_url',\n 'type': 'string'\n },\n {\n 'name': 'company_id_main_office_id',\n 'type': 'int'\n },\n {\n 'name': 'company_id_created_by',\n 'type': 'int'\n },\n {\n 'name': 'company_id_created_dt',\n 'type': 'date'\n },\n {\n 'name': 'company_id_updated_by',\n 'type': 'int'\n },\n {\n 'name': 'company_id_updated_dt',\n 'type': 'date'\n },\n {\n 'name': 'company_id_passwd',\n 'type': 'string'\n },\n {\n 'name': 'project_id_id',\n 'type': 'int'\n },\n {\n 'name': 'project_id_name',\n 'type': 'string'\n },\n {\n 'name': 'project_id_remarks',\n 'type': 'string'\n },\n {\n 'name': 'project_id_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'project_id_code',\n 'type': 'string'\n },\n {\n 'name': 'project_id_active',\n 'type': 'int'\n },\n {\n 'name': 'project_id_type',\n 'type': 'string'\n },\n {\n 'name': 'project_id_client_id',\n 'type': 'int'\n },\n {\n 'name': 'project_id_team_id',\n 'type': 'int'\n },\n {\n 'name': 'project_id_file_location',\n 'type': 'string'\n },\n {\n 'name': 'project_id_open_date',\n 'type': 'date'\n },\n {\n 'name': 'project_id_open_by',\n 'type': 'int'\n },\n {\n 'name': 'project_id_close_date',\n 'type': 'date'\n },\n {\n 'name': 'project_id_countries',\n 'type': 'string'\n },\n {\n 'name': 'project_id_languages',\n 'type': 'string'\n },\n {\n 'name': 'project_id_agency_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_office_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_name',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_phone',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_email',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_company_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_role',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_active',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_remarks',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_passwd',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_lang',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_no_reset_sent',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_action_type',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_project_id',\n 'type': 'int'\n }\n]", "* prop" : "reader", "totalProperty" : "total" } @@ -162,8 +161,8 @@ "items" : [ { "$ url" : "baseURL + '/Roo/Companies.php'", - "method" : "GET", "xtype" : "HttpProxy", + "method" : "GET", "$ xns" : "Roo.data", "* prop" : "proxy" }, @@ -315,8 +314,8 @@ }, { "xtype" : "ColumnModel", - "header" : "Role", "width" : 100, + "header" : "Role", "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", @@ -324,8 +323,8 @@ }, { "xtype" : "ColumnModel", - "header" : "Phone", "width" : 100, + "header" : "Phone", "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", @@ -333,8 +332,8 @@ }, { "xtype" : "ColumnModel", - "header" : "Fax", "width" : 100, + "header" : "Fax", "$ renderer" : "function(v) { return String.format('{0}', v); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", @@ -352,8 +351,8 @@ }, { "xtype" : "ColumnModel", - "header" : "Active", "width" : 75, + "header" : "Active", "$ renderer" : "function(v) { \n var state = v> 0 ? '-checked' : '';\n\n return '';\n \n }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", diff --git a/Pman.Tab.AdminContacts.js b/Pman.Tab.AdminContacts.js index dee7bfd..c69825b 100644 --- a/Pman.Tab.AdminContacts.js +++ b/Pman.Tab.AdminContacts.js @@ -45,462 +45,101 @@ Pman.Tab.AdminContacts = new Roo.XComponent({ var _this = this; var MODULE = this; return { + autoScroll : true, + background : true, + fitContainer : true, + fitToframe : true, + region : 'center', + tableName : 'Person', + title : _this._strings['40bed7cf9b3d4bb3a3d7a7e3eb18c5eb'] /* Person */, + xns : Roo, + '|xns' : 'Roo', + xtype : 'GridPanel', + listeners : { + activate : function() { + _this.panel = this; + if (_this.grid) { + _this.grid.footer.onClick('first'); + } + } + }, grid : { - dataSource : { - proxy : { - '|xns' : 'Roo.data', - method : 'GET', - url : baseURL + '/Roo/Person.php', - xns : Roo.data, - xtype : 'HttpProxy' - }, - reader : { - '|xns' : 'Roo.data', - fields : [ - { - 'name': 'id', - 'type': 'int' - }, - { - 'name': 'office_id', - 'type': 'int' - }, - { - 'name': 'name', - 'type': 'string' - }, - { - 'name': 'phone', - 'type': 'string' - }, - { - 'name': 'fax', - 'type': 'string' - }, - { - 'name': 'email', - 'type': 'string' - }, - { - 'name': 'company_id', - 'type': 'int' - }, - { - 'name': 'role', - 'type': 'string' - }, - { - 'name': 'active', - 'type': 'int' - }, - { - 'name': 'remarks', - 'type': 'string' - }, - { - 'name': 'passwd', - 'type': 'string' - }, - { - 'name': 'owner_id', - 'type': 'int' - }, - { - 'name': 'lang', - 'type': 'string' - }, - { - 'name': 'no_reset_sent', - 'type': 'int' - }, - { - 'name': 'action_type', - 'type': 'string' - }, - { - 'name': 'project_id', - 'type': 'int' - }, - { - 'name': 'office_id_id', - 'type': 'int' - }, - { - 'name': 'office_id_company_id', - 'type': 'int' - }, - { - 'name': 'office_id_name', - 'type': 'string' - }, - { - 'name': 'office_id_address', - 'type': 'string' - }, - { - 'name': 'office_id_phone', - 'type': 'string' - }, - { - 'name': 'office_id_fax', - 'type': 'string' - }, - { - 'name': 'office_id_email', - 'type': 'string' - }, - { - 'name': 'office_id_role', - 'type': 'string' - }, - { - 'name': 'company_id_code', - 'type': 'string' - }, - { - 'name': 'company_id_name', - 'type': 'string' - }, - { - 'name': 'company_id_remarks', - 'type': 'string' - }, - { - 'name': 'company_id_owner_id', - 'type': 'int' - }, - { - 'name': 'company_id_address', - 'type': 'string' - }, - { - 'name': 'company_id_tel', - 'type': 'string' - }, - { - 'name': 'company_id_fax', - 'type': 'string' - }, - { - 'name': 'company_id_email', - 'type': 'string' - }, - { - 'name': 'company_id_id', - 'type': 'int' - }, - { - 'name': 'company_id_isOwner', - 'type': 'int' - }, - { - 'name': 'company_id_logo_id', - 'type': 'int' - }, - { - 'name': 'company_id_background_color', - 'type': 'string' - }, - { - 'name': 'company_id_comptype', - 'type': 'string' - }, - { - 'name': 'company_id_url', - 'type': 'string' - }, - { - 'name': 'company_id_main_office_id', - 'type': 'int' - }, - { - 'name': 'company_id_created_by', - 'type': 'int' - }, - { - 'name': 'company_id_created_dt', - 'type': 'date' - }, - { - 'name': 'company_id_updated_by', - 'type': 'int' - }, - { - 'name': 'company_id_updated_dt', - 'type': 'date' - }, - { - 'name': 'company_id_passwd', - 'type': 'string' - }, - { - 'name': 'project_id_id', - 'type': 'int' - }, - { - 'name': 'project_id_name', - 'type': 'string' - }, - { - 'name': 'project_id_remarks', - 'type': 'string' - }, - { - 'name': 'project_id_owner_id', - 'type': 'int' - }, - { - 'name': 'project_id_code', - 'type': 'string' - }, - { - 'name': 'project_id_active', - 'type': 'int' - }, - { - 'name': 'project_id_type', - 'type': 'string' - }, - { - 'name': 'project_id_client_id', - 'type': 'int' - }, - { - 'name': 'project_id_team_id', - 'type': 'int' - }, - { - 'name': 'project_id_file_location', - 'type': 'string' - }, - { - 'name': 'project_id_open_date', - 'type': 'date' - }, - { - 'name': 'project_id_open_by', - 'type': 'int' - }, - { - 'name': 'project_id_close_date', - 'type': 'date' - }, - { - 'name': 'project_id_countries', - 'type': 'string' - }, - { - 'name': 'project_id_languages', - 'type': 'string' - }, - { - 'name': 'project_id_agency_id', - 'type': 'int' - }, - { - 'name': 'owner_id_id', - 'type': 'int' - }, - { - 'name': 'owner_id_office_id', - 'type': 'int' - }, - { - 'name': 'owner_id_name', - 'type': 'string' - }, - { - 'name': 'owner_id_phone', - 'type': 'string' - }, - { - 'name': 'owner_id_fax', - 'type': 'string' - }, - { - 'name': 'owner_id_email', - 'type': 'string' - }, - { - 'name': 'owner_id_company_id', - 'type': 'int' - }, - { - 'name': 'owner_id_role', - 'type': 'string' - }, - { - 'name': 'owner_id_active', - 'type': 'int' - }, - { - 'name': 'owner_id_remarks', - 'type': 'string' - }, - { - 'name': 'owner_id_passwd', - 'type': 'string' - }, - { - 'name': 'owner_id_owner_id', - 'type': 'int' - }, - { - 'name': 'owner_id_lang', - 'type': 'string' - }, - { - 'name': 'owner_id_no_reset_sent', - 'type': 'int' - }, - { - 'name': 'owner_id_action_type', - 'type': 'string' - }, - { - 'name': 'owner_id_project_id', - 'type': 'int' - } - ], - id : 'id', - root : 'data', - totalProperty : 'total', - xns : Roo.data, - xtype : 'JsonReader' - }, - '|xns' : 'Roo.data', - remoteSort : true, - sortInfo : { field : 'name', direction: 'ASC' }, - xns : Roo.data, - xtype : 'Store', - listeners : { - beforeload : function (_self, o) - { - if(!_this.active_company_button.pressed){ - o.params['!company_id_comptype'] = 'OWNER'; - } - - o.params['query[search]'] = _this.searchBox.getValue(); - - if (!_this.activeButton) {return; false;} - - if (_this.companyCombo && _this.companyCombo.getValue()) { - o.params.company_id = _this.companyCombo.getValue(); - } - - - o.params.active = _this.activeButton.pressed ? 0 : 1; - - if(_this.active_company_button.pressed){ - o.params.company_id = 0; - } - - var c = Pman.Tab.AdminContactsManager.layout.getRegion('west').getActivePanel(); - - if (!c) { - return false; - } - - var tms = c.grid.getSelectionModel().getSelected(); - - if (!tms) { - return false; - } - - if(c.tableName == 'Groups'){ - o.params['query[in_group]'] = tms.data.id; - o.params['query[type]'] = 2; // group type.. - }else{ - o.params['query[in_country]'] = (tms.data.country*1 == -1) ? '' : tms.data.country; - o.params['query[in_group]'] = 0; - o.params['query[type]'] = 2; - } - /* - if (Pman.Tab.AdminContactsGroup && Pman.Tab.AdminContactsGroup.grid) { - - - - } - - if(Pman.Tab.AdminCountries && Pman.Tab.AdminCountries.grid){ - var tms = Pman.Tab.AdminCountries.grid.getSelectionModel().getSelected(); + autoExpandColumn : 'name', + ddGroup : 'groupDD', + enableDrag : true, + loadMask : true, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'Grid', + listeners : { + cellclick : function (_self, rowIndex, columnIndex, e) + { + + var di = this.colModel.getDataIndex(columnIndex); + if (di != 'active') { + return; + } - if (!tms) { - return false; - } + var rec = _this.grid.ds.getAt(rowIndex); + + rec.set('active', rec.data.active ? 0 : 1); + rec.commit(); - } - */ - //o.params['query[name]'] = _this.searchBox.getValue(); - - }, - update : function (_self, record, operation) - { - if (operation != 'commit') { - return; - } - // only used to change active status. - - new Pman.Request({ - url : baseURL + '/Roo/Person.php', - method :'POST', - params : { - id : record.data.id, - active: record.data.active - - }, - success : function() { - // do nothing - - _this.grid.ds.remove(record); - - }, - failure : function() - { - Roo.MessageBox.alert("Error", "saving failed", function() { - _this.grid.footer.onClick('first'); - }); - } - }); - } - }, - items : [ - - ] - + + }, + render : function() + { + _this.grid = this; + if (!_this.dialog) { + _this.dialog = Pman.Dialog.PersonEdit; + + } + //_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), function() { + _this.grid.footer.onClick('first'); + }); + } }, footer : { - '|xns' : 'Roo', displayInfo : true, - displayMsg : _this._strings['8444e81d652b084d70c71cd7d19ac0cf'], - emptyMsg : _this._strings['f1174ecbbc232f948717979daf04cf08'], + displayMsg : _this._strings['8444e81d652b084d70c71cd7d19ac0cf'] /* Displaying Person{0} - {1} of {2} */, + emptyMsg : _this._strings['f1174ecbbc232f948717979daf04cf08'] /* No Person found */, pageSize : 25, xns : Roo, + '|xns' : 'Roo', xtype : 'PagingToolbar', - items : [ + items : [ { - '|xns' : 'Roo.Toolbar', - text : _this._strings['4110db87ce3ac86d603d03d691616b1e'], + text : _this._strings['4110db87ce3ac86d603d03d691616b1e'] /* Drag person to add or remove from group */, xns : Roo.Toolbar, + '|xns' : 'Roo.Toolbar', xtype : 'TextItem' } ] - }, toolbar : { - '|xns' : 'Roo', xns : Roo, + '|xns' : 'Roo', xtype : 'Toolbar', - items : [ + items : [ { - '|xns' : 'Roo.Toolbar', - text : _this._strings['13348442cc6a27032d2b4aa28b75a5d3'], + text : _this._strings['13348442cc6a27032d2b4aa28b75a5d3'] /* Search */, xns : Roo.Toolbar, + '|xns' : 'Roo.Toolbar', xtype : 'TextItem' }, { - '|xns' : 'Roo.form', xns : Roo.form, + '|xns' : 'Roo.form', xtype : 'TextField', listeners : { render : function (_self) @@ -523,51 +162,17 @@ Pman.Tab.AdminContacts = new Roo.XComponent({ } }, { - store : { - proxy : { - '|xns' : 'Roo.data', - method : 'GET', - url : baseURL + '/Roo/Companies.php', - xns : Roo.data, - xtype : 'HttpProxy' - }, - reader : { - '|xns' : 'Roo.data', - fields : [{"name":"id","type":"int"},{"name":"code","type":"string"}], - id : 'id', - root : 'data', - totalProperty : 'total', - xns : Roo.data, - xtype : 'JsonReader' - }, - '|xns' : 'Roo.data', - remoteSort : true, - sortInfo : { direction : 'ASC', field: 'name' }, - xns : Roo.data, - xtype : 'Store', - listeners : { - beforeload : function (_self, o){ - o.params = o.params || {}; - // set more here - } - }, - items : [ - - ] - - }, - '|xns' : 'Roo.form', displayField : 'name', editable : true, - emptyText : _this._strings['99b344c8ae43e3e7213862b8f35c4e51'], + emptyText : _this._strings['99b344c8ae43e3e7213862b8f35c4e51'] /* Select Company */, forceSelection : true, hiddenName : 'company_id', listWidth : 400, - loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'], + loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */, minChars : 2, name : 'company_name', pageSize : 20, - qtip : _this._strings['9675747b5ab12d05f18518761e68a533'], + qtip : _this._strings['9675747b5ab12d05f18518761e68a533'] /* Select Companies */, queryParam : 'query[name]', selectOnFocus : true, tpl : '
{name}
', @@ -576,6 +181,7 @@ Pman.Tab.AdminContacts = new Roo.XComponent({ valueField : 'id', width : 150, xns : Roo.form, + '|xns' : 'Roo.form', xtype : 'ComboBox', listeners : { render : function (_self) @@ -587,16 +193,41 @@ Pman.Tab.AdminContacts = new Roo.XComponent({ _this.grid.footer.onClick.defer(300,_this.grid.footer,[ 'first'] ); } }, - items : [ - - ] - + store : { + remoteSort : true, + sortInfo : { direction : 'ASC', field: 'name' }, + xns : Roo.data, + '|xns' : 'Roo.data', + xtype : 'Store', + listeners : { + beforeload : function (_self, o){ + o.params = o.params || {}; + // set more here + } + }, + proxy : { + method : 'GET', + url : baseURL + '/Roo/Companies.php', + xns : Roo.data, + '|xns' : 'Roo.data', + xtype : 'HttpProxy' + }, + reader : { + fields : [{"name":"id","type":"int"},{"name":"code","type":"string"}], + id : 'id', + root : 'data', + totalProperty : 'total', + xns : Roo.data, + '|xns' : 'Roo.data', + xtype : 'JsonReader' + } + } }, { - '|xns' : 'Roo.Toolbar', cls : 'x-btn-icon', icon : rootURL + '/Pman/templates/images/search.gif', xns : Roo.Toolbar, + '|xns' : 'Roo.Toolbar', xtype : 'Button', listeners : { click : function (_self, e) @@ -606,10 +237,10 @@ Pman.Tab.AdminContacts = new Roo.XComponent({ } }, { - '|xns' : 'Roo.Toolbar', cls : 'x-btn-icon', icon : rootURL + '/Pman/templates/images/edit-clear.gif', xns : Roo.Toolbar, + '|xns' : 'Roo.Toolbar', xtype : 'Button', listeners : { click : function (_self, e) @@ -620,10 +251,10 @@ Pman.Tab.AdminContacts = new Roo.XComponent({ } }, { - '|xns' : 'Roo.Toolbar', enableToggle : true, - text : _this._strings['d4d25ad0a12e8d30e9d8d35230f6d1d3'], + text : _this._strings['d4d25ad0a12e8d30e9d8d35230f6d1d3'] /* Show Removed */, xns : Roo.Toolbar, + '|xns' : 'Roo.Toolbar', xtype : 'Button', listeners : { render : function (_self) @@ -640,10 +271,10 @@ Pman.Tab.AdminContacts = new Roo.XComponent({ } }, { - '|xns' : 'Roo.Toolbar', enableToggle : true, - text : _this._strings['b47a519aebda8fdb4b59bdae6eb2bff0'], + text : _this._strings['b47a519aebda8fdb4b59bdae6eb2bff0'] /* Show No Company */, xns : Roo.Toolbar, + '|xns' : 'Roo.Toolbar', xtype : 'Button', listeners : { render : function (_self) @@ -660,9 +291,9 @@ Pman.Tab.AdminContacts = new Roo.XComponent({ } }, { - '|xns' : 'Roo.Toolbar', - text : _this._strings['ec3249f16ee5880d4c1acb752e5c925f'], + text : _this._strings['ec3249f16ee5880d4c1acb752e5c925f'] /* Switch to Selected User */, xns : Roo.Toolbar, + '|xns' : 'Roo.Toolbar', xtype : 'Button', listeners : { click : function (_self, e) @@ -691,16 +322,16 @@ Pman.Tab.AdminContacts = new Roo.XComponent({ } }, { - '|xns' : 'Roo.Toolbar', xns : Roo.Toolbar, + '|xns' : 'Roo.Toolbar', xtype : 'Fill' }, { - '|xns' : 'Roo.Toolbar', cls : 'x-btn-text-icon', icon : Roo.rootURL + 'images/default/dd/drop-add.gif', - text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'], + text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */, xns : Roo.Toolbar, + '|xns' : 'Roo.Toolbar', xtype : 'Button', listeners : { click : function() @@ -713,11 +344,11 @@ Pman.Tab.AdminContacts = new Roo.XComponent({ } }, { - '|xns' : 'Roo.Toolbar', cls : 'x-btn-text-icon', icon : Roo.rootURL + 'images/default/dd/drop-add.gif', - text : _this._strings['a93806efd0cc7a149f0f03e2b9a0f862'], + text : _this._strings['a93806efd0cc7a149f0f03e2b9a0f862'] /* Bulk Add */, xns : Roo.Toolbar, + '|xns' : 'Roo.Toolbar', xtype : 'Button', listeners : { click : function() @@ -730,11 +361,11 @@ Pman.Tab.AdminContacts = new Roo.XComponent({ } }, { - '|xns' : 'Roo.Toolbar', cls : 'x-btn-text-icon', icon : Roo.rootURL + 'images/default/tree/leaf.gif', - text : _this._strings['7dce122004969d56ae2e0245cb754d35'], + text : _this._strings['7dce122004969d56ae2e0245cb754d35'] /* Edit */, xns : Roo.Toolbar, + '|xns' : 'Roo.Toolbar', xtype : 'Button', listeners : { click : function() @@ -753,11 +384,11 @@ Pman.Tab.AdminContacts = new Roo.XComponent({ } }, { - '|xns' : 'Roo.Toolbar', cls : 'x-btn-text-icon', icon : rootURL + '/Pman/templates/images/trash.gif', - text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'], + text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */, xns : Roo.Toolbar, + '|xns' : 'Roo.Toolbar', xtype : 'Button', listeners : { click : function() @@ -767,188 +398,231 @@ Pman.Tab.AdminContacts = new Roo.XComponent({ } } ] - }, - '|xns' : 'Roo.grid', - autoExpandColumn : 'name', - ddGroup : 'groupDD', - enableDrag : true, - loadMask : true, - xns : Roo.grid, - xtype : 'Grid', - colModel : [ - { - '|xns' : 'Roo.grid', - dataIndex : 'project_id_code', - header : _this._strings['9e727fdd3aec8274f46685441900280d'], - hidden : true, - renderer : function(v,x,r) { - return String.format('{1}', - r.data.project_id_name, - v); - }, - sortable : true, - width : 75, - xns : Roo.grid, - xtype : 'ColumnModel' - }, -{ - '|xns' : 'Roo.grid', - dataIndex : 'company_id_comptype', - header : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'], - renderer : function(v,x,r) { - if (r.data.office_id) { - return String.format('{0} - {1}', v, r.data.office_id_name); - } - return String.format('{0}', v); + dataSource : { + remoteSort : true, + sortInfo : { field : 'name', direction: 'ASC' }, + xns : Roo.data, + '|xns' : 'Roo.data', + xtype : 'Store', + listeners : { + beforeload : function (_self, o) + { + if(!_this.active_company_button.pressed){ + o.params['!company_id_comptype'] = 'OWNER'; + } + + o.params['query[search]'] = _this.searchBox.getValue(); + + if (!_this.activeButton) {return; false;} + + if (_this.companyCombo && _this.companyCombo.getValue()) { + o.params.company_id = _this.companyCombo.getValue(); + } + + + o.params.active = _this.activeButton.pressed ? 0 : 1; + + if(_this.active_company_button.pressed){ + o.params.company_id = 0; + } + + var c = Pman.Tab.AdminContactsManager.layout.getRegion('west').getActivePanel(); + + if (!c) { + return false; + } + + var tms = c.grid.getSelectionModel().getSelected(); + + if (!tms) { + return false; + } + + if(c.tableName == 'Groups'){ + o.params['query[in_group]'] = tms.data.id; + o.params['query[type]'] = 2; // group type.. + }else{ + o.params['query[in_country]'] = (tms.data.country*1 == -1) ? '' : tms.data.country; + o.params['query[in_group]'] = 0; + o.params['query[type]'] = 2; + } + /* + if (Pman.Tab.AdminContactsGroup && Pman.Tab.AdminContactsGroup.grid) { + + + + } + + if(Pman.Tab.AdminCountries && Pman.Tab.AdminCountries.grid){ + var tms = Pman.Tab.AdminCountries.grid.getSelectionModel().getSelected(); + + if (!tms) { + return false; + } + + } + */ + //o.params['query[name]'] = _this.searchBox.getValue(); + }, - sortable : true, - width : 50, - xns : Roo.grid, - xtype : 'ColumnModel' - }, -{ - '|xns' : 'Roo.grid', - dataIndex : 'company_id_name', - header : _this._strings['1c76cbfe21c6f44c1d1e59d54f3e4420'], - renderer : function(v,x,r) { - if (r.data.office_id) { - return String.format('{0} - {1}', v, r.data.office_id_name); - } - return String.format('{0}', v); + update : function (_self, record, operation) + { + if (operation != 'commit') { + return; + } + // only used to change active status. + + new Pman.Request({ + url : baseURL + '/Roo/Person.php', + method :'POST', + params : { + id : record.data.id, + active: record.data.active + + }, + success : function() { + // do nothing + + _this.grid.ds.remove(record); + + }, + failure : function() + { + Roo.MessageBox.alert("Error", "saving failed", function() { + _this.grid.footer.onClick('first'); + }); + } + }); + } + }, + proxy : { + method : 'GET', + url : baseURL + '/Roo/Person.php', + xns : Roo.data, + '|xns' : 'Roo.data', + xtype : 'HttpProxy' + }, + reader : { + id : 'id', + root : 'data', + totalProperty : 'total', + xns : Roo.data, + '|xns' : 'Roo.data', + xtype : 'JsonReader' + } + }, + colModel : [ + { + dataIndex : 'project_id_code', + header : _this._strings['9e727fdd3aec8274f46685441900280d'] /* Project */, + hidden : true, + renderer : function(v,x,r) { + return String.format('{1}', + r.data.project_id_name, + v); }, - sortable : true, - width : 150, - xns : Roo.grid, - xtype : 'ColumnModel' - }, -{ - '|xns' : 'Roo.grid', - dataIndex : 'name', - header : _this._strings['49ee3087348e8d44e1feda1917443987'], - renderer : function(v) { return String.format('{0}', v); }, - sortable : true, - width : 200, - xns : Roo.grid, - xtype : 'ColumnModel' - }, -{ - '|xns' : 'Roo.grid', - dataIndex : 'role', - header : _this._strings['bbbabdbe1b262f75d99d62880b953be1'], - renderer : function(v) { return String.format('{0}', v); }, - width : 100, - xns : Roo.grid, - xtype : 'ColumnModel' - }, -{ - '|xns' : 'Roo.grid', - dataIndex : 'phone', - header : _this._strings['bcc254b55c4a1babdf1dcb82c207506b'], - renderer : function(v) { return String.format('{0}', v); }, - width : 100, - xns : Roo.grid, - xtype : 'ColumnModel' - }, -{ - '|xns' : 'Roo.grid', - dataIndex : 'fax', - header : _this._strings['9810aa2b9f44401be4bf73188ef2b67d'], - renderer : function(v) { return String.format('{0}', v); }, - width : 100, - xns : Roo.grid, - xtype : 'ColumnModel' + sortable : true, + width : 75, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' + }, + { + dataIndex : 'company_id_comptype', + header : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'] /* Type */, + renderer : function(v,x,r) { + if (r.data.office_id) { + return String.format('{0} - {1}', v, r.data.office_id_name); + } + return String.format('{0}', v); }, -{ - '|xns' : 'Roo.grid', - dataIndex : 'email', - header : _this._strings['ce8ae9da5b7cd6c3df2929543a9af92d'], - renderer : function(v) { - return (v.length && v.indexOf('@') > 0 ) ? - String.format('{0}',v) : v; - }, - sortable : true, - width : 200, - xns : Roo.grid, - xtype : 'ColumnModel' + sortable : true, + width : 50, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' + }, + { + dataIndex : 'company_id_name', + header : _this._strings['1c76cbfe21c6f44c1d1e59d54f3e4420'] /* Company */, + renderer : function(v,x,r) { + if (r.data.office_id) { + return String.format('{0} - {1}', v, r.data.office_id_name); + } + return String.format('{0}', v); }, -{ - '|xns' : 'Roo.grid', - dataIndex : 'active', - header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'], - renderer : function(v) { - var state = v> 0 ? '-checked' : ''; - - return ''; - - }, - width : 75, - xns : Roo.grid, - xtype : 'ColumnModel' - } - ], - listeners : { - cellclick : function (_self, rowIndex, columnIndex, e) - { + sortable : true, + width : 150, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' + }, + { + dataIndex : 'name', + header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */, + renderer : function(v) { return String.format('{0}', v); }, + sortable : true, + width : 200, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' + }, + { + dataIndex : 'role', + header : _this._strings['bbbabdbe1b262f75d99d62880b953be1'] /* Role */, + renderer : function(v) { return String.format('{0}', v); }, + width : 100, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' + }, + { + dataIndex : 'phone', + header : _this._strings['bcc254b55c4a1babdf1dcb82c207506b'] /* Phone */, + renderer : function(v) { return String.format('{0}', v); }, + width : 100, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' + }, + { + dataIndex : 'fax', + header : _this._strings['9810aa2b9f44401be4bf73188ef2b67d'] /* Fax */, + renderer : function(v) { return String.format('{0}', v); }, + width : 100, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' + }, + { + dataIndex : 'email', + header : _this._strings['ce8ae9da5b7cd6c3df2929543a9af92d'] /* Email */, + renderer : function(v) { + return (v.length && v.indexOf('@') > 0 ) ? + String.format('{0}',v) : v; + }, + sortable : true, + width : 200, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' + }, + { + dataIndex : 'active', + header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'] /* Active */, + renderer : function(v) { + var state = v> 0 ? '-checked' : ''; - var di = this.colModel.getDataIndex(columnIndex); - if (di != 'active') { - return; - } - - var rec = _this.grid.ds.getAt(rowIndex); - - rec.set('active', rec.data.active ? 0 : 1); - rec.commit(); - - - }, - render : function() - { - _this.grid = this; - if (!_this.dialog) { - _this.dialog = Pman.Dialog.PersonEdit; - - } - //_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), function() { - _this.grid.footer.onClick('first'); - }); - } - }, - items : [ - - ] - - }, - '|xns' : 'Roo', - autoScroll : true, - background : true, - fitContainer : true, - fitToframe : true, - region : 'center', - tableName : 'Person', - title : _this._strings['40bed7cf9b3d4bb3a3d7a7e3eb18c5eb'], - xns : Roo, - xtype : 'GridPanel', - listeners : { - activate : function() { - _this.panel = this; - if (_this.grid) { - _this.grid.footer.onClick('first'); - } + return ''; + + }, + width : 75, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' } - }, - items : [ - - ] - + ] + } }; } }); diff --git a/Pman.Tab.AdminContactsGroup.bjs b/Pman.Tab.AdminContactsGroup.bjs index 6aa982b..0f11a72 100644 --- a/Pman.Tab.AdminContactsGroup.bjs +++ b/Pman.Tab.AdminContactsGroup.bjs @@ -19,9 +19,9 @@ "listeners" : { "|activate" : "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.ds.load({});\n }\n}" }, + "region" : "west", "fitToframe" : true, "background" : true, - "region" : "west", "title" : "Groups", "xtype" : "GridPanel", "fitContainer" : true, @@ -30,12 +30,12 @@ "items" : [ { "listeners" : { - "|rowdblclick" : "function (_self, rowIndex, e)\n{\n if (!_this.dialog) return;\n var s = this.getDataSource().getAt(rowIndex);\n if (s.data.id < 1 ) {\n return;\n }\n _this.dialog.show( s.data, function() {\n _this.ds.load({});\n }); \n}\n", + "|rowdblclick" : "function (_self, rowIndex, e)\n{\n if (!_this.dialog) { \n return; \n }\n var s = this.getDataSource().getAt(rowIndex);\n if (s.data.id < 1 ) {\n return;\n }\n _this.dialog.show( s.data, function() {\n _this.ds.load({});\n }); \n}\n", "|render" : "function() \n{\n _this.grid = this; \n _this.dialog = Pman.Dialog.Groups;\n if (_this.panel.active) {\n _this.grid.ds.load({});\n }\n}" }, "autoExpandColumn" : "name", - "enableDrop" : true, "xtype" : "Grid", + "enableDrop" : true, "ddGroup" : "groupDD", "loadMask" : true, "$ xns" : "Roo.grid", @@ -54,8 +54,8 @@ "items" : [ { "$ url" : "baseURL + '/Roo/Groups.php'", - "method" : "GET", "xtype" : "HttpProxy", + "method" : "GET", "$ xns" : "Roo.data", "* prop" : "proxy" }, @@ -87,7 +87,7 @@ "items" : [ { "listeners" : { - "|click" : "function()\n{\n if (!_this.dialog) return;\n _this.dialog.show( { id : 0, type: 2 } , function() {\n _this.grid.ds.load({});\n }); \n}\n" + "|click" : "function()\n{\n if (!_this.dialog) {\n return;\n }\n _this.dialog.show( { id : 0, type: 2 } , function() {\n _this.grid.ds.load({});\n }); \n}\n" }, "text" : "Add", "xtype" : "Item", @@ -97,7 +97,7 @@ }, { "listeners" : { - "|click" : "function()\n{\n var s = _this.grid.getSelectionModel().getSelections();\n if (!s.length || (s.length > 1)) {\n Roo.MessageBox.alert(\"Error\", s.length ? \"Select only one Row\" : \"Select a Row\");\n return;\n }\n if (s[0].data.id < 1 ) {\n return;\n }\n if (!_this.dialog) return;\n _this.dialog.show(s[0].data, function() {\n _this.grid.ds.load({});\n }); \n \n}\n" + "|click" : "function()\n{\n var s = _this.grid.getSelectionModel().getSelections();\n if (!s.length || (s.length > 1)) {\n Roo.MessageBox.alert(\"Error\", s.length ? \"Select only one Row\" : \"Select a Row\");\n return;\n }\n if (s[0].data.id < 1 ) {\n return;\n }\n if (!_this.dialog) {\n return;\n }\n _this.dialog.show(s[0].data, function() {\n _this.grid.ds.load({});\n }); \n \n}\n" }, "text" : "Edit", "xtype" : "Item", @@ -135,8 +135,8 @@ }, { "xtype" : "ColumnModel", - "header" : "Name", "width" : 200, + "header" : "Name", "$ renderer" : "function(v,x,r) { \n if (r.data.id == -1) {\n return '' + \"Not in a Group\" + '';\n }\n if ((r.data.id == 0) && (_this.type == 0)) {\n return '' + \"All Staff (Default Permissions)\" + '';\n }\n if ((r.data.id == 0) && (_this.type == 2)) {\n return '' + \"Everybody\" + '';\n }\n if (r.data.id == 0) {\n return '' + \"All Staff\" + '';\n }\n if (v == 'Administrators') {\n return '' + \"Adminstrators\" + '';\n }\n if (r.data.leader) {\n return v + ' (' + r.data.leader_name + ')';\n }\n \n return v;\n}", "$ xns" : "Roo.grid", "* prop" : "colModel[]", diff --git a/Pman.Tab.AdminContactsGroup.js b/Pman.Tab.AdminContactsGroup.js index bfe914a..d92291d 100644 --- a/Pman.Tab.AdminContactsGroup.js +++ b/Pman.Tab.AdminContactsGroup.js @@ -64,7 +64,9 @@ Pman.Tab.AdminContactsGroup = new Roo.XComponent({ }, rowdblclick : function (_self, rowIndex, e) { - if (!_this.dialog) return; + if (!_this.dialog) { + return; + } var s = this.getDataSource().getAt(rowIndex); if (s.data.id < 1 ) { return; @@ -99,7 +101,9 @@ Pman.Tab.AdminContactsGroup = new Roo.XComponent({ listeners : { click : function() { - if (!_this.dialog) return; + if (!_this.dialog) { + return; + } _this.dialog.show( { id : 0, type: 2 } , function() { _this.grid.ds.load({}); }); @@ -124,7 +128,9 @@ Pman.Tab.AdminContactsGroup = new Roo.XComponent({ if (s[0].data.id < 1 ) { return; } - if (!_this.dialog) return; + if (!_this.dialog) { + return; + } _this.dialog.show(s[0].data, function() { _this.grid.ds.load({}); }); diff --git a/Pman.Tab.AdminNotifyRecur.bjs b/Pman.Tab.AdminNotifyRecur.bjs index e4e7c22..c7f0432 100644 --- a/Pman.Tab.AdminNotifyRecur.bjs +++ b/Pman.Tab.AdminNotifyRecur.bjs @@ -1,229 +1,246 @@ { - "id": "roo-file-256", - "name": "Pman.Tab.AdminNotifyRecur", - "parent": "Pman.Tab.AdminWatchNotify", - "title": "Pman.Tab.AdminNotifyRecur", - "path": "/home/alan/gitlive/Pman.Admin/Pman.Tab.AdminNotifyRecur.bjs", - "items": [ + "name" : "Pman.Tab.AdminNotifyRecur", + "parent" : "Pman.Tab.AdminWatchNotify", + "title" : "Pman.Tab.AdminNotifyRecur", + "path" : "/home/alan/gitlive/Pman.Admin/Pman.Tab.AdminNotifyRecur.bjs", + "permname" : "", + "modOrder" : "800", + "strings" : { + "04df30d61712300fd31c24e2c7c8f9bc" : "Select core_notify", + "be3c26f9baf09972ddc410c5c7c63403" : "Displaying core_notify_recur{0} - {1} of {2}", + "808e3eefe289c698ec4def4a54ac36af" : "Last Notification created", + "13a831874352b548ac7b5e63a860aa1b" : "Tz", + "c348b06d2667edd048ded3c1b1878cc1" : "Recurrent Notifications", + "c956c97343a45cca5d492e70c56daa8e" : "Select person", + "25af45209313b11d55424103567a1347" : "Dtend", + "1243daf593fa297e07ab03bf06d925af" : "Searching...", + "effad6ff1d36887ce57d05300912bf61" : "No core_notify_recur found", + "83b9a425d6b152330823ab8357f441ae" : "Dtstart", + "ac2c474467a60fa4e2c88158a6d2abf9" : "Freq day", + "40bed7cf9b3d4bb3a3d7a7e3eb18c5eb" : "Person", + "6ffde0d71e2b678e619e4a642d0b22a6" : "Freq hour", + "4c3880bb027f159e801041b1021e88e8" : "Method", + "d8d80ec41fc8cca7569ac2d2937bd97b" : "Affects", + "84307c751e4541f54714472e3df742dd" : "Freq" + }, + "items" : [ + { + "listeners" : { + "|activate" : "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}" + }, + "fitToframe" : true, + "background" : true, + "region" : "center", + "title" : "Recurrent Notifications", + "xtype" : "GridPanel", + "fitContainer" : true, + "$ xns" : "Roo", + "tableName" : "core_notify_recur", + "items" : [ + { + "listeners" : { + "|rowdblclick" : "function (_self, rowIndex, e)\n{\n if (!_this.dialog) { return; }\n _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {\n _this.grid.footer.onClick('first');\n }); \n}\n", + "|render" : "function() \n{\n _this.grid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}" + }, + "autoExpandColumn" : "person_id_name", + "xtype" : "Grid", + "loadMask" : true, + "$ xns" : "Roo.grid", + "* prop" : "grid", + "items" : [ + { + "xtype" : "Toolbar", + "$ xns" : "Roo", + "* prop" : "toolbar", + "items" : [ { - "listeners": { - "|activate": "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}" + "listeners" : { + "render" : "function (_self)\n{\n _this.personCombo = _self;\n}", + "select" : "function (combo, record, index)\n{\n (function() { _this.grid.footer.onClick('first'); }).defer(100);\n}" + }, + "listWidth" : 400, + "triggerAction" : "all", + "forceSelection" : true, + "selectOnFocus" : true, + "pageSize" : 20, + "displayField" : "person_id_name", + "emptyText" : "Select person", + "hiddenName" : "id", + "minChars" : 2, + "valueField" : "person_id", + "xtype" : "ComboBox", + "allowBlank" : true, + "editable" : true, + "width" : 300, + "$ xns" : "Roo.form", + "name" : "name", + "qtip" : "Select core_notify", + "queryParam" : "query[person_id_name]", + "tpl" : "
{person_id_name} {person_id_email}
", + "loadingText" : "Searching...", + "items" : [ + { + "listeners" : { + "|beforeload" : "function (_self, o){\n o.params = o.params || {};\n o.params._distinct='person_id';\n o.params._columns='person_id,person_id_name,person_id_email';\n o.params['!person_id_name'] = '';\n \n // set more here\n}\n" + }, + "xtype" : "Store", + "remoteSort" : true, + "$ sortInfo" : "{ direction : 'ASC', field: 'person_id_name' }", + "$ xns" : "Roo.data", + "* prop" : "store", + "items" : [ + { + "$ url" : "baseURL + '/Roo/core_notify_recur.php'", + "xtype" : "HttpProxy", + "method" : "GET", + "$ xns" : "Roo.data", + "* prop" : "proxy" }, - "background": true, - "fitContainer": true, - "fitToframe": true, - "region": "center", - "tableName": "core_notify_recur", - "title": "Recurrent Notifications", - "xtype": "GridPanel", - "|xns": "Roo", - "items": [ - { - "listeners": { - "|render": "function() \n{\n _this.grid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}", - "|rowdblclick": "function (_self, rowIndex, e)\n{\n if (!_this.dialog) return;\n _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {\n _this.grid.footer.onClick('first');\n }); \n}\n" - }, - "*prop": "grid", - "autoExpandColumn": "person_id_name", - "loadMask": true, - "xtype": "Grid", - "|xns": "Roo.grid", - "items": [ - { - "|xns": "Roo", - "xtype": "Toolbar", - "*prop": "toolbar", - "items": [ - { - "listeners": { - "select": "function (combo, record, index)\n{\n (function() { _this.grid.footer.onClick('first'); }).defer(100);\n}", - "render": "function (_self)\n{\n _this.personCombo = _self;\n}" - }, - "allowBlank": true, - "displayField": "person_id_name", - "editable": true, - "emptyText": "Select person", - "forceSelection": true, - "hiddenName": "id", - "listWidth": 400, - "loadingText": "Searching...", - "minChars": 2, - "name": "name", - "pageSize": 20, - "qtip": "Select core_notify", - "queryParam": "query[person_id_name]", - "selectOnFocus": true, - "tpl": "
{person_id_name} {person_id_email}
", - "triggerAction": "all", - "valueField": "person_id", - "width": 300, - "xtype": "ComboBox", - "|xns": "Roo.form", - "items": [ - { - "listeners": { - "|beforeload": "function (_self, o){\n o.params = o.params || {};\n o.params._distinct='person_id';\n o.params._columns='person_id,person_id_name,person_id_email';\n o.params['!person_id_name'] = '';\n \n // set more here\n}\n" - }, - "*prop": "store", - "remoteSort": true, - "xtype": "Store", - "|sortInfo": "{ direction : 'ASC', field: 'person_id_name' }", - "|xns": "Roo.data", - "items": [ - { - "*prop": "proxy", - "method": "GET", - "xtype": "HttpProxy", - "|url": "baseURL + '/Roo/core_notify_recur.php'", - "|xns": "Roo.data" - }, - { - "*prop": "reader", - "xtype": "JsonReader", - "|xns": "Roo.data", - "id": "id", - "root": "data", - "totalProperty": "total", - "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"ontable\",\"type\":\"string\"}]" - } - ] - } - ] - } - ] - }, - { - "listeners": { - "beforeload": "function (_self, options)\n{\n if (!_this.personCombo) {\n return false;\n }\n var p = _this.personCombo.getValue();\n if (p*1) { \n options.params.person_id = p;\n }\n}" - }, - "*prop": "dataSource", - "remoteSort": true, - "xtype": "Store", - "|sortInfo": "{ field : 'person_id_name', direction: 'ASC' }", - "|xns": "Roo.data", - "items": [ - { - "*prop": "proxy", - "xtype": "HttpProxy", - "method": "GET", - "|url": "baseURL + '/Roo/core_notify_recur.php'", - "|xns": "Roo.data" - }, - { - "|xns": "Roo.data", - "xtype": "JsonReader", - "totalProperty": "total", - "root": "data", - "*prop": "reader", - "id": "id", - "|fields": "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'person_id',\n 'type': 'int'\n },\n {\n 'name': 'dtstart',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'dtend',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'max_applied_dt',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'updated_dt',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'last_applied_dt',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'tz',\n 'type': 'string'\n },\n {\n 'name': 'freq',\n 'type': 'string'\n },\n {\n 'name': 'freq_day',\n 'type': 'string'\n },\n {\n 'name': 'freq_hour',\n 'type': 'string'\n },\n {\n 'name': 'onid',\n 'type': 'int'\n },\n {\n 'name': 'ontable',\n 'type': 'string'\n },\n {\n 'name': 'last_event_id',\n 'type': 'int'\n },\n {\n 'name': 'method',\n 'type': 'string'\n }\n]" - } - ] - }, - { - "*prop": "footer", - "xtype": "PagingToolbar", - "pageSize": 25, - "displayInfo": true, - "displayMsg": "Displaying core_notify_recur{0} - {1} of {2}", - "emptyMsg": "No core_notify_recur found", - "|xns": "Roo" - }, - { - "*prop": "colModel[]", - "dataIndex": "person_id_name", - "header": "Person", - "width": 75, - "xtype": "ColumnModel", - "|renderer": "function(v,x,r) { \n return String.format('{0} {1}', v,r.data.person_id_email); \n}", - "|xns": "Roo.grid" - }, - { - "xtype": "ColumnModel", - "header": "Dtstart", - "width": 75, - "dataIndex": "dtstart", - "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }", - "|xns": "Roo.grid", - "*prop": "colModel[]" - }, - { - "xtype": "ColumnModel", - "header": "Dtend", - "width": 75, - "dataIndex": "dtend", - "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }", - "|xns": "Roo.grid", - "*prop": "colModel[]" - }, - { - "*prop": "colModel[]", - "dataIndex": "last_applied_dt", - "header": "Last Notification created", - "width": 75, - "xtype": "ColumnModel", - "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }", - "|xns": "Roo.grid" - }, - { - "*prop": "colModel[]", - "dataIndex": "tz", - "header": "Tz", - "width": 75, - "xtype": "ColumnModel", - "|renderer": "function(v) { return String.format('{0}', v); }", - "|xns": "Roo.grid" - }, - { - "*prop": "colModel[]", - "dataIndex": "freq", - "header": "Freq", - "width": 100, - "xtype": "ColumnModel", - "|renderer": "function(v) { return String.format('{0}', v); }", - "|xns": "Roo.grid" - }, - { - "*prop": "colModel[]", - "dataIndex": "freq_day", - "header": "Freq day", - "width": 200, - "xtype": "ColumnModel", - "|renderer": "function(v) { return String.format('{0}', v); }", - "|xns": "Roo.grid" - }, - { - "xtype": "ColumnModel", - "header": "Freq hour", - "width": 200, - "dataIndex": "freq_hour", - "|renderer": "function(v) { return String.format('{0}', v); }", - "|xns": "Roo.grid", - "*prop": "colModel[]" - }, - { - "*prop": "colModel[]", - "dataIndex": "onid", - "header": "Affects", - "width": 75, - "xtype": "ColumnModel", - "|renderer": "function(v,x,r) { return String.format('{1}:{0}', v,r.data.ontable); }", - "|xns": "Roo.grid" - }, - { - "*prop": "colModel[]", - "dataIndex": "method", - "header": "Method", - "width": 75, - "xtype": "ColumnModel", - "|renderer": "function(v) { return String.format('{0}', v); }", - "|xns": "Roo.grid" - } - ] - } - ] + { + "id" : "id", + "root" : "data", + "xtype" : "JsonReader", + "$ xns" : "Roo.data", + "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"ontable\",\"type\":\"string\"}]", + "* prop" : "reader", + "totalProperty" : "total" + } + ] + } + ] } - ], - "permname": "", - "modOrder": "800" + ] + }, + { + "listeners" : { + "beforeload" : "function (_self, options)\n{\n if (!_this.personCombo) {\n return false;\n }\n var p = _this.personCombo.getValue();\n if (p*1) { \n options.params.person_id = p;\n }\n}" + }, + "xtype" : "Store", + "remoteSort" : true, + "$ sortInfo" : "{ field : 'person_id_name', direction: 'ASC' }", + "$ xns" : "Roo.data", + "* prop" : "dataSource", + "items" : [ + { + "$ url" : "baseURL + '/Roo/core_notify_recur.php'", + "method" : "GET", + "xtype" : "HttpProxy", + "$ xns" : "Roo.data", + "* prop" : "proxy" + }, + { + "id" : "id", + "root" : "data", + "xtype" : "JsonReader", + "$ xns" : "Roo.data", + "$ fields" : "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'person_id',\n 'type': 'int'\n },\n {\n 'name': 'dtstart',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'dtend',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'max_applied_dt',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'updated_dt',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'last_applied_dt',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'tz',\n 'type': 'string'\n },\n {\n 'name': 'freq',\n 'type': 'string'\n },\n {\n 'name': 'freq_day',\n 'type': 'string'\n },\n {\n 'name': 'freq_hour',\n 'type': 'string'\n },\n {\n 'name': 'onid',\n 'type': 'int'\n },\n {\n 'name': 'ontable',\n 'type': 'string'\n },\n {\n 'name': 'last_event_id',\n 'type': 'int'\n },\n {\n 'name': 'method',\n 'type': 'string'\n }\n]", + "* prop" : "reader", + "totalProperty" : "total" + } + ] + }, + { + "pageSize" : 25, + "xtype" : "PagingToolbar", + "emptyMsg" : "No core_notify_recur found", + "$ xns" : "Roo", + "displayInfo" : true, + "displayMsg" : "Displaying core_notify_recur{0} - {1} of {2}", + "* prop" : "footer" + }, + { + "xtype" : "ColumnModel", + "header" : "Person", + "width" : 75, + "$ renderer" : "function(v,x,r) { \n return String.format('{0} {1}', v,r.data.person_id_email); \n}", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "person_id_name" + }, + { + "xtype" : "ColumnModel", + "width" : 75, + "header" : "Dtstart", + "$ renderer" : "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "dtstart" + }, + { + "xtype" : "ColumnModel", + "width" : 75, + "header" : "Dtend", + "$ renderer" : "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "dtend" + }, + { + "xtype" : "ColumnModel", + "header" : "Last Notification created", + "width" : 75, + "$ renderer" : "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "last_applied_dt" + }, + { + "xtype" : "ColumnModel", + "header" : "Tz", + "width" : 75, + "$ renderer" : "function(v) { return String.format('{0}', v); }", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "tz" + }, + { + "xtype" : "ColumnModel", + "header" : "Freq", + "width" : 100, + "$ renderer" : "function(v) { return String.format('{0}', v); }", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "freq" + }, + { + "xtype" : "ColumnModel", + "header" : "Freq day", + "width" : 200, + "$ renderer" : "function(v) { return String.format('{0}', v); }", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "freq_day" + }, + { + "xtype" : "ColumnModel", + "width" : 200, + "header" : "Freq hour", + "$ renderer" : "function(v) { return String.format('{0}', v); }", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "freq_hour" + }, + { + "xtype" : "ColumnModel", + "header" : "Affects", + "width" : 75, + "$ renderer" : "function(v,x,r) { return String.format('{1}:{0}', v,r.data.ontable); }", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "onid" + }, + { + "xtype" : "ColumnModel", + "header" : "Method", + "width" : 75, + "$ renderer" : "function(v) { return String.format('{0}', v); }", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "method" + } + ] + } + ] + } + ] } \ No newline at end of file diff --git a/Pman.Tab.AdminNotifyRecur.js b/Pman.Tab.AdminNotifyRecur.js index e4f6cd3..20c41f8 100644 --- a/Pman.Tab.AdminNotifyRecur.js +++ b/Pman.Tab.AdminNotifyRecur.js @@ -2,316 +2,358 @@ // Auto generated file - created by app.Builder.js- do not edit directly (at present!) +Roo.namespace('Pman.Tab'); + Pman.Tab.AdminNotifyRecur = new Roo.XComponent({ - part : ["Admin","NotifyRecur"], - order : '800-Pman.Tab.AdminNotifyRecur', - region : 'center', - parent : 'Pman.Tab.AdminWatchNotify', - name : "Pman.Tab.AdminNotifyRecur", - disabled : false, - permname : '', - _tree : function() - { - var _this = this; - var MODULE = this; - return { - xtype: 'GridPanel', - xns: Roo, - listeners : { - activate : function() { - _this.panel = this; - if (_this.grid) { - _this.grid.footer.onClick('first'); - } - } - }, - background : true, - fitContainer : true, - fitToframe : true, - region : 'center', - tableName : 'core_notify_recur', - title : "Recurrent Notifications", - grid : { - xtype: 'Grid', - xns: Roo.grid, - 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'); - }); - } - }, - autoExpandColumn : 'person_id_name', - loadMask : true, - toolbar : { - xtype: 'Toolbar', - xns: Roo, - items : [ - { - xtype: 'ComboBox', - xns: Roo.form, - listeners : { - select : function (combo, record, index) - { - (function() { _this.grid.footer.onClick('first'); }).defer(100); - }, - render : function (_self) - { - _this.personCombo = _self; - } - }, - allowBlank : true, - displayField : 'person_id_name', - editable : true, - emptyText : "Select person", - forceSelection : true, - hiddenName : 'id', - listWidth : 400, - loadingText : "Searching...", - minChars : 2, - name : 'name', - pageSize : 20, - qtip : "Select core_notify", - queryParam : 'query[person_id_name]', - selectOnFocus : true, - tpl : '
{person_id_name} {person_id_email}
', - triggerAction : 'all', - valueField : 'person_id', - width : 300, - store : { - xtype: 'Store', - xns: Roo.data, - listeners : { - beforeload : function (_self, o){ - o.params = o.params || {}; - o.params._distinct='person_id'; - o.params._columns='person_id,person_id_name,person_id_email'; - o.params['!person_id_name'] = ''; - - // set more here - } - }, - remoteSort : true, - sortInfo : { direction : 'ASC', field: 'person_id_name' }, - proxy : { - xtype: 'HttpProxy', - xns: Roo.data, - method : 'GET', - url : baseURL + '/Roo/core_notify_recur.php' - }, - reader : { - xtype: 'JsonReader', - xns: Roo.data, - id : 'id', - root : 'data', - totalProperty : 'total', - fields : [{"name":"id","type":"int"},{"name":"ontable","type":"string"}] - } - } - } - ] - }, - dataSource : { - xtype: 'Store', - xns: Roo.data, - listeners : { - beforeload : function (_self, options) - { - if (!_this.personCombo) { - return false; - } - var p = _this.personCombo.getValue(); - if (p*1) { - options.params.person_id = p; - } - } - }, - remoteSort : true, - sortInfo : { field : 'person_id_name', direction: 'ASC' }, - proxy : { - xtype: 'HttpProxy', - xns: Roo.data, - method : 'GET', - url : baseURL + '/Roo/core_notify_recur.php' - }, - reader : { - xtype: 'JsonReader', - xns: Roo.data, - totalProperty : 'total', - root : 'data', - id : 'id', - fields : [ - { - 'name': 'id', - 'type': 'int' - }, - { - 'name': 'person_id', - 'type': 'int' - }, - { - 'name': 'dtstart', - 'type': 'date', - 'dateFormat': 'Y-m-d' - }, - { - 'name': 'dtend', - 'type': 'date', - 'dateFormat': 'Y-m-d' - }, - { - 'name': 'max_applied_dt', - 'type': 'date', - 'dateFormat': 'Y-m-d' - }, - { - 'name': 'updated_dt', - 'type': 'date', - 'dateFormat': 'Y-m-d' - }, - { - 'name': 'last_applied_dt', - 'type': 'date', - 'dateFormat': 'Y-m-d' - }, - { - 'name': 'tz', - 'type': 'string' - }, - { - 'name': 'freq', - 'type': 'string' - }, - { - 'name': 'freq_day', - 'type': 'string' - }, - { - 'name': 'freq_hour', - 'type': 'string' - }, - { - 'name': 'onid', - 'type': 'int' - }, - { - 'name': 'ontable', - 'type': 'string' - }, - { - 'name': 'last_event_id', - 'type': 'int' - }, - { - 'name': 'method', - 'type': 'string' - } - ] - } - }, - footer : { - xtype: 'PagingToolbar', - xns: Roo, - pageSize : 25, - displayInfo : true, - displayMsg : "Displaying core_notify_recur{0} - {1} of {2}", - emptyMsg : "No core_notify_recur found" - }, - colModel : [ - { - xtype: 'ColumnModel', - xns: Roo.grid, - dataIndex : 'person_id_name', - header : 'Person', - width : 75, - renderer : function(v,x,r) { - return String.format('{0} {1}', v,r.data.person_id_email); - } - }, - { - xtype: 'ColumnModel', - xns: Roo.grid, - header : 'Dtstart', - width : 75, - dataIndex : 'dtstart', - renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); } - }, - { - xtype: 'ColumnModel', - xns: Roo.grid, - header : 'Dtend', - width : 75, - dataIndex : 'dtend', - renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); } - }, - { - xtype: 'ColumnModel', - xns: Roo.grid, - dataIndex : 'last_applied_dt', - header : 'Last Notification created', - width : 75, - renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); } - }, - { - xtype: 'ColumnModel', - xns: Roo.grid, - dataIndex : 'tz', - header : 'Tz', - width : 75, - renderer : function(v) { return String.format('{0}', v); } - }, - { - xtype: 'ColumnModel', - xns: Roo.grid, - dataIndex : 'freq', - header : 'Freq', - width : 100, - renderer : function(v) { return String.format('{0}', v); } - }, - { - xtype: 'ColumnModel', - xns: Roo.grid, - dataIndex : 'freq_day', - header : 'Freq day', - width : 200, - renderer : function(v) { return String.format('{0}', v); } - }, - { - xtype: 'ColumnModel', - xns: Roo.grid, - header : 'Freq hour', - width : 200, - dataIndex : 'freq_hour', - renderer : function(v) { return String.format('{0}', v); } - }, - { - xtype: 'ColumnModel', - xns: Roo.grid, - dataIndex : 'onid', - header : 'Affects', - width : 75, - renderer : function(v,x,r) { return String.format('{1}:{0}', v,r.data.ontable); } - }, - { - xtype: 'ColumnModel', - xns: Roo.grid, - dataIndex : 'method', - header : 'Method', - width : 75, - renderer : function(v) { return String.format('{0}', v); } - } - ] - } - }; - } + + _strings : { + '04df30d61712300fd31c24e2c7c8f9bc' :"Select core_notify", + 'be3c26f9baf09972ddc410c5c7c63403' :"Displaying core_notify_recur{0} - {1} of {2}", + '808e3eefe289c698ec4def4a54ac36af' :"Last Notification created", + '13a831874352b548ac7b5e63a860aa1b' :"Tz", + 'c348b06d2667edd048ded3c1b1878cc1' :"Recurrent Notifications", + 'c956c97343a45cca5d492e70c56daa8e' :"Select person", + '25af45209313b11d55424103567a1347' :"Dtend", + '1243daf593fa297e07ab03bf06d925af' :"Searching...", + 'effad6ff1d36887ce57d05300912bf61' :"No core_notify_recur found", + '83b9a425d6b152330823ab8357f441ae' :"Dtstart", + 'ac2c474467a60fa4e2c88158a6d2abf9' :"Freq day", + '40bed7cf9b3d4bb3a3d7a7e3eb18c5eb' :"Person", + '6ffde0d71e2b678e619e4a642d0b22a6' :"Freq hour", + '4c3880bb027f159e801041b1021e88e8' :"Method", + 'd8d80ec41fc8cca7569ac2d2937bd97b' :"Affects", + '84307c751e4541f54714472e3df742dd' :"Freq" + }, + + part : ["Admin", "NotifyRecur" ], + order : '800-Pman.Tab.AdminNotifyRecur', + region : 'center', + parent : 'Pman.Tab.AdminWatchNotify', + name : "Pman.Tab.AdminNotifyRecur", + disabled : false, + permname : '', + _tree : function() + { + var _this = this; + var MODULE = this; + return { + background : true, + fitContainer : true, + fitToframe : true, + region : 'center', + tableName : 'core_notify_recur', + title : _this._strings['c348b06d2667edd048ded3c1b1878cc1'] /* Recurrent Notifications */, + xns : Roo, + '|xns' : 'Roo', + xtype : 'GridPanel', + listeners : { + activate : function() { + _this.panel = this; + if (_this.grid) { + _this.grid.footer.onClick('first'); + } + } + }, + grid : { + autoExpandColumn : 'person_id_name', + 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'); + } + }, + rowdblclick : function (_self, rowIndex, e) + { + if (!_this.dialog) { return; } + _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() { + _this.grid.footer.onClick('first'); + }); + } + }, + footer : { + displayInfo : true, + displayMsg : _this._strings['be3c26f9baf09972ddc410c5c7c63403'] /* Displaying core_notify_recur{0} - {1} of {2} */, + emptyMsg : _this._strings['effad6ff1d36887ce57d05300912bf61'] /* No core_notify_recur found */, + pageSize : 25, + xns : Roo, + '|xns' : 'Roo', + xtype : 'PagingToolbar' + }, + toolbar : { + xns : Roo, + '|xns' : 'Roo', + xtype : 'Toolbar', + items : [ + { + allowBlank : true, + displayField : 'person_id_name', + editable : true, + emptyText : _this._strings['c956c97343a45cca5d492e70c56daa8e'] /* Select person */, + forceSelection : true, + hiddenName : 'id', + listWidth : 400, + loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */, + minChars : 2, + name : 'name', + pageSize : 20, + qtip : _this._strings['04df30d61712300fd31c24e2c7c8f9bc'] /* Select core_notify */, + queryParam : 'query[person_id_name]', + selectOnFocus : true, + tpl : '
{person_id_name} {person_id_email}
', + triggerAction : 'all', + valueField : 'person_id', + width : 300, + xns : Roo.form, + '|xns' : 'Roo.form', + xtype : 'ComboBox', + listeners : { + render : function (_self) + { + _this.personCombo = _self; + }, + select : function (combo, record, index) + { + (function() { _this.grid.footer.onClick('first'); }).defer(100); + } + }, + store : { + remoteSort : true, + sortInfo : { direction : 'ASC', field: 'person_id_name' }, + xns : Roo.data, + '|xns' : 'Roo.data', + xtype : 'Store', + listeners : { + beforeload : function (_self, o){ + o.params = o.params || {}; + o.params._distinct='person_id'; + o.params._columns='person_id,person_id_name,person_id_email'; + o.params['!person_id_name'] = ''; + + // set more here + } + }, + proxy : { + method : 'GET', + url : baseURL + '/Roo/core_notify_recur.php', + xns : Roo.data, + '|xns' : 'Roo.data', + xtype : 'HttpProxy' + }, + reader : { + fields : [{"name":"id","type":"int"},{"name":"ontable","type":"string"}], + id : 'id', + root : 'data', + totalProperty : 'total', + xns : Roo.data, + '|xns' : 'Roo.data', + xtype : 'JsonReader' + } + } + } + ] + }, + dataSource : { + remoteSort : true, + sortInfo : { field : 'person_id_name', direction: 'ASC' }, + xns : Roo.data, + '|xns' : 'Roo.data', + xtype : 'Store', + listeners : { + beforeload : function (_self, options) + { + if (!_this.personCombo) { + return false; + } + var p = _this.personCombo.getValue(); + if (p*1) { + options.params.person_id = p; + } + } + }, + proxy : { + method : 'GET', + url : baseURL + '/Roo/core_notify_recur.php', + xns : Roo.data, + '|xns' : 'Roo.data', + xtype : 'HttpProxy' + }, + reader : { + fields : [ + { + 'name': 'id', + 'type': 'int' + }, + { + 'name': 'person_id', + 'type': 'int' + }, + { + 'name': 'dtstart', + 'type': 'date', + 'dateFormat': 'Y-m-d' + }, + { + 'name': 'dtend', + 'type': 'date', + 'dateFormat': 'Y-m-d' + }, + { + 'name': 'max_applied_dt', + 'type': 'date', + 'dateFormat': 'Y-m-d' + }, + { + 'name': 'updated_dt', + 'type': 'date', + 'dateFormat': 'Y-m-d' + }, + { + 'name': 'last_applied_dt', + 'type': 'date', + 'dateFormat': 'Y-m-d' + }, + { + 'name': 'tz', + 'type': 'string' + }, + { + 'name': 'freq', + 'type': 'string' + }, + { + 'name': 'freq_day', + 'type': 'string' + }, + { + 'name': 'freq_hour', + 'type': 'string' + }, + { + 'name': 'onid', + 'type': 'int' + }, + { + 'name': 'ontable', + 'type': 'string' + }, + { + 'name': 'last_event_id', + 'type': 'int' + }, + { + 'name': 'method', + 'type': 'string' + } + ], + id : 'id', + root : 'data', + totalProperty : 'total', + xns : Roo.data, + '|xns' : 'Roo.data', + xtype : 'JsonReader' + } + }, + colModel : [ + { + dataIndex : 'person_id_name', + header : _this._strings['40bed7cf9b3d4bb3a3d7a7e3eb18c5eb'] /* Person */, + renderer : function(v,x,r) { + return String.format('{0} {1}', v,r.data.person_id_email); + }, + width : 75, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' + }, + { + dataIndex : 'dtstart', + header : _this._strings['83b9a425d6b152330823ab8357f441ae'] /* Dtstart */, + renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }, + width : 75, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' + }, + { + dataIndex : 'dtend', + header : _this._strings['25af45209313b11d55424103567a1347'] /* Dtend */, + renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }, + width : 75, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' + }, + { + dataIndex : 'last_applied_dt', + header : _this._strings['808e3eefe289c698ec4def4a54ac36af'] /* Last Notification created */, + renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }, + width : 75, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' + }, + { + dataIndex : 'tz', + header : _this._strings['13a831874352b548ac7b5e63a860aa1b'] /* Tz */, + renderer : function(v) { return String.format('{0}', v); }, + width : 75, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' + }, + { + dataIndex : 'freq', + header : _this._strings['84307c751e4541f54714472e3df742dd'] /* Freq */, + renderer : function(v) { return String.format('{0}', v); }, + width : 100, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' + }, + { + dataIndex : 'freq_day', + header : _this._strings['ac2c474467a60fa4e2c88158a6d2abf9'] /* Freq day */, + renderer : function(v) { return String.format('{0}', v); }, + width : 200, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' + }, + { + dataIndex : 'freq_hour', + header : _this._strings['6ffde0d71e2b678e619e4a642d0b22a6'] /* Freq hour */, + renderer : function(v) { return String.format('{0}', v); }, + width : 200, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' + }, + { + dataIndex : 'onid', + header : _this._strings['d8d80ec41fc8cca7569ac2d2937bd97b'] /* Affects */, + renderer : function(v,x,r) { return String.format('{1}:{0}', v,r.data.ontable); }, + width : 75, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' + }, + { + dataIndex : 'method', + header : _this._strings['4c3880bb027f159e801041b1021e88e8'] /* Method */, + renderer : function(v) { return String.format('{0}', v); }, + width : 75, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' + } + ] + } + }; } }); diff --git a/Pman.Tab.AdminProjectManager.bjs b/Pman.Tab.AdminProjectManager.bjs index c4e8b10..82d8628 100644 --- a/Pman.Tab.AdminProjectManager.bjs +++ b/Pman.Tab.AdminProjectManager.bjs @@ -1,274 +1,287 @@ { - "id": "roo-file-95", - "name": "Pman.Tab.AdminProjectManager", - "parent": "Pman.Tab.Admin", - "title": "Pman.Tab.AdminProjectManager", - "path": "/home/alan/gitlive/Pman.Admin/Pman.Tab.AdminProjectManager.bjs", - "items": [ + "name" : "Pman.Tab.AdminProjectManager", + "parent" : "Pman.Tab.Admin", + "title" : "Pman.Tab.AdminProjectManager", + "path" : "/home/alan/gitlive/Pman.Admin/Pman.Tab.AdminProjectManager.bjs", + "permname" : "Core.Projects_All", + "modOrder" : "002", + "strings" : { + "54e1d44609e3abed11f6e1eb6ae54988" : "Projects", + "8115b8afd5b2953d9fa63eb0db9559fc" : "No Projects found", + "ec211f7c20af43e742bf2570c3cb84f9" : "Add", + "13348442cc6a27032d2b4aa28b75a5d3" : "Search", + "7dce122004969d56ae2e0245cb754d35" : "Edit", + "577d7068826de925ea2aec01dbadf5e4" : "Client", + "917d465e9a9e8b16a8da50a1ca8156ca" : "Show:", + "0f111c111475c934057e6f8bb8314d56" : "Non-Projects", + "03f4a47830f97377a35321051685071e" : "Closed", + "f45e7cfb0824b6d381ade7d81bb81615" : "Displaying Projects {0} - {1} of {2}", + "b1c94ca2fbc3e78fc30069c8d0f01680" : "All", + "a1fa27779242b4902f7ae3bdd5c6d508" : "Type", + "ca0dbad92a874b2f69b549293387925e" : "Code", + "49ee3087348e8d44e1feda1917443987" : "Name", + "93573647a6041adaabd942e88cc29e23" : "Projects / Members" + }, + "items" : [ + { + "region" : "center", + "fitToFrame" : true, + "title" : "Projects / Members", + "xtype" : "NestedLayoutPanel", + "fitContainer" : true, + "$ xns" : "Roo", + "items" : [ + { + "xtype" : "BorderLayout", + "$ xns" : "Roo", + "* prop" : "layout", + "items" : [ + { + "xtype" : "LayoutRegion", + "$ xns" : "Roo", + "* prop" : "center" + }, + { + "xtype" : "LayoutRegion", + "width" : 300, + "$ xns" : "Roo", + "split" : true, + "* prop" : "east" + }, + { + "listeners" : { + "|activate" : "function() {\n _this.panel = this;\n try {\n _this.dialog = Pman.Dialog.CoreProject ; \n } catch(e) {}\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}" + }, + "fitToframe" : true, + "background" : true, + "region" : "center", + "title" : "Projects", + "xtype" : "GridPanel", + "fitContainer" : true, + "$ xns" : "Roo", + "tableName" : "Projects", + "items" : [ { - "fitContainer": true, - "fitToFrame": true, - "region": "center", - "title": "Projects / Members", - "xtype": "NestedLayoutPanel", - "|xns": "Roo", - "items": [ - { - "|xns": "Roo", - "xtype": "BorderLayout", - "*prop": "layout", - "items": [ - { - "|xns": "Roo", - "xtype": "LayoutRegion", - "*prop": "center" - }, - { - "*prop": "east", - "split": true, - "width": 300, - "xtype": "LayoutRegion", - "|xns": "Roo" - }, - { - "listeners": { - "|activate": "function() {\n _this.panel = this;\n try {\n _this.dialog = Pman.Dialog.CoreProject ; \n } catch(e) {}\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}" - }, - "background": true, - "fitContainer": true, - "fitToframe": true, - "region": "center", - "tableName": "Projects", - "title": "Projects", - "xtype": "GridPanel", - "|xns": "Roo", - "items": [ - { - "listeners": { - "|render": "function() \n{\n _this.grid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}", - "|rowdblclick": "function (_self, rowIndex, e)\n{\n if (!_this.dialog) return;\n _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {\n _this.grid.footer.onClick('first');\n }); \n}\n" - }, - "*prop": "grid", - "autoExpandColumn": "name", - "filter": "P,U", - "loadMask": true, - "xtype": "Grid", - "|getTypes": "function() {\n return [\n [ 'U' , \"Project (Unconfirmed)\" ],\n [ 'P' , \"Project\" ],\n [ 'C' , \"Project (Closed)\" ],\n [ 'N' , \"Non-Project\" ],\n [ 'X' , \"Non-Project (Closed)\" ]\n\n ];\n}\n", - "|typeToString": "function(v)\n{\n var ar = this.getTypes();\n var ret = '';\n Roo.each(ar, function(a) {\n if (a[0] == v) {\n ret = a[1];\n return false;\n }\n });\n return ret;\n}\n", - "|xns": "Roo.grid", - "items": [ - { - "listeners": { - "beforeload": "function (_self, o)\n{\n if (!_this.searchBox) {\n return false;\n } \n o.params = o.params ? o.params : {};\n o.params['query[project_search]'] = _this.searchBox.getValue();\n o.params['query[project_filter]'] = _this.grid.filter;\n}" - }, - "*prop": "dataSource", - "remoteSort": true, - "xtype": "Store", - "|sortInfo": "{ field : 'code', direction: 'ASC' }", - "|xns": "Roo.data", - "items": [ - { - "*prop": "proxy", - "xtype": "HttpProxy", - "method": "GET", - "|url": "baseURL + '/Roo/Projects.php'", - "|xns": "Roo.data" - }, - { - "|xns": "Roo.data", - "xtype": "JsonReader", - "totalProperty": "total", - "root": "data", - "*prop": "reader", - "id": "id", - "|fields": "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'name',\n 'type': 'string'\n },\n {\n 'name': 'remarks',\n 'type': 'string'\n },\n {\n 'name': 'owner_id',\n 'type': 'int'\n },\n {\n 'name': 'code',\n 'type': 'string'\n },\n {\n 'name': 'active',\n 'type': 'int'\n },\n {\n 'name': 'type',\n 'type': 'string'\n },\n {\n 'name': 'client_id',\n 'type': 'int'\n },\n {\n 'name': 'team_id',\n 'type': 'int'\n },\n {\n 'name': 'file_location',\n 'type': 'string'\n },\n {\n 'name': 'open_date',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'open_by',\n 'type': 'int'\n },\n {\n 'name': 'close_date',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'countries',\n 'type': 'string'\n },\n {\n 'name': 'languages',\n 'type': 'string'\n },\n {\n 'name': 'agency_id',\n 'type': 'int'\n },\n {\n 'name': 'client_id_code',\n 'type': 'string'\n },\n {\n 'name': 'client_id_name',\n 'type': 'string'\n },\n {\n 'name': 'client_id_remarks',\n 'type': 'string'\n },\n {\n 'name': 'client_id_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'client_id_address',\n 'type': 'string'\n },\n {\n 'name': 'client_id_tel',\n 'type': 'string'\n },\n {\n 'name': 'client_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'client_id_email',\n 'type': 'string'\n },\n {\n 'name': 'client_id_id',\n 'type': 'int'\n },\n {\n 'name': 'client_id_isOwner',\n 'type': 'int'\n },\n {\n 'name': 'client_id_logo_id',\n 'type': 'int'\n },\n {\n 'name': 'client_id_background_color',\n 'type': 'string'\n },\n {\n 'name': 'client_id_comptype',\n 'type': 'string'\n },\n {\n 'name': 'client_id_url',\n 'type': 'string'\n },\n {\n 'name': 'client_id_main_office_id',\n 'type': 'int'\n },\n {\n 'name': 'client_id_created_by',\n 'type': 'int'\n },\n {\n 'name': 'client_id_created_dt',\n 'type': 'date'\n },\n {\n 'name': 'client_id_updated_by',\n 'type': 'int'\n },\n {\n 'name': 'client_id_updated_dt',\n 'type': 'date'\n },\n {\n 'name': 'client_id_passwd',\n 'type': 'string'\n },\n {\n 'name': 'agency_id_code',\n 'type': 'string'\n },\n {\n 'name': 'agency_id_name',\n 'type': 'string'\n },\n {\n 'name': 'agency_id_remarks',\n 'type': 'string'\n },\n {\n 'name': 'agency_id_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'agency_id_address',\n 'type': 'string'\n },\n {\n 'name': 'agency_id_tel',\n 'type': 'string'\n },\n {\n 'name': 'agency_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'agency_id_email',\n 'type': 'string'\n },\n {\n 'name': 'agency_id_id',\n 'type': 'int'\n },\n {\n 'name': 'agency_id_isOwner',\n 'type': 'int'\n },\n {\n 'name': 'agency_id_logo_id',\n 'type': 'int'\n },\n {\n 'name': 'agency_id_background_color',\n 'type': 'string'\n },\n {\n 'name': 'agency_id_comptype',\n 'type': 'string'\n },\n {\n 'name': 'agency_id_url',\n 'type': 'string'\n },\n {\n 'name': 'agency_id_main_office_id',\n 'type': 'int'\n },\n {\n 'name': 'agency_id_created_by',\n 'type': 'int'\n },\n {\n 'name': 'agency_id_created_dt',\n 'type': 'date'\n },\n {\n 'name': 'agency_id_updated_by',\n 'type': 'int'\n },\n {\n 'name': 'agency_id_updated_dt',\n 'type': 'date'\n },\n {\n 'name': 'agency_id_passwd',\n 'type': 'string'\n },\n {\n 'name': 'team_id_id',\n 'type': 'int'\n },\n {\n 'name': 'team_id_name',\n 'type': 'string'\n },\n {\n 'name': 'team_id_type',\n 'type': 'int'\n },\n {\n 'name': 'team_id_leader',\n 'type': 'int'\n },\n {\n 'name': 'open_by_id',\n 'type': 'int'\n },\n {\n 'name': 'open_by_office_id',\n 'type': 'int'\n },\n {\n 'name': 'open_by_name',\n 'type': 'string'\n },\n {\n 'name': 'open_by_phone',\n 'type': 'string'\n },\n {\n 'name': 'open_by_fax',\n 'type': 'string'\n },\n {\n 'name': 'open_by_email',\n 'type': 'string'\n },\n {\n 'name': 'open_by_company_id',\n 'type': 'int'\n },\n {\n 'name': 'open_by_role',\n 'type': 'string'\n },\n {\n 'name': 'open_by_active',\n 'type': 'int'\n },\n {\n 'name': 'open_by_remarks',\n 'type': 'string'\n },\n {\n 'name': 'open_by_passwd',\n 'type': 'string'\n },\n {\n 'name': 'open_by_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'open_by_lang',\n 'type': 'string'\n },\n {\n 'name': 'open_by_no_reset_sent',\n 'type': 'int'\n },\n {\n 'name': 'open_by_action_type',\n 'type': 'string'\n },\n {\n 'name': 'open_by_project_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_office_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_name',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_phone',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_email',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_company_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_role',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_active',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_remarks',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_passwd',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_lang',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_no_reset_sent',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_action_type',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_project_id',\n 'type': 'int'\n }\n]" - } - ] - }, - { - "*prop": "footer", - "displayInfo": true, - "displayMsg": "Displaying Projects {0} - {1} of {2}", - "emptyMsg": "No Projects found", - "pageSize": 25, - "xtype": "PagingToolbar", - "|xns": "Roo" - }, - { - "*prop": "toolbar", - "xtype": "Toolbar", - "|xns": "Roo", - "items": [ - { - "listeners": { - "|click": "function()\n{\n if (!_this.dialog) return;\n _this.dialog.show( { id : 0 } , function() {\n _this.grid.footer.onClick('first');\n }); \n}\n" - }, - "cls": "x-btn-text-icon", - "text": "Add", - "xtype": "Button", - "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'", - "|xns": "Roo.Toolbar" - }, - { - "text": "Edit", - "xtype": "Button", - "cls": "x-btn-text-icon", - "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'", - "listeners": { - "|click": "function()\n{\n var s = _this.grid.getSelectionModel().getSelections();\n if (!s.length || (s.length > 1)) {\n Roo.MessageBox.alert(\"Error\", s.length ? \"Select only one Row\" : \"Select a Row\");\n return;\n }\n if (!_this.dialog) return;\n _this.dialog.show(s[0].data, function() {\n _this.grid.footer.onClick('first');\n }); \n \n}\n" - }, - "|xns": "Roo.Toolbar" - }, - { - "|xns": "Roo.Toolbar", - "xtype": "Separator" - }, - { - "text": "Search", - "xtype": "TextItem", - "|xns": "Roo.Toolbar" - }, - { - "listeners": { - "render": "function (_self)\n{\n _this.searchBox = _self;\n}", - "specialkey": "function (_self, e)\n{\n if(e.getKey() == 13) {\n _this.grid.footer.onClick('first');\n }\n}" - }, - "xtype": "TextField", - "|xns": "Roo.form" - }, - { - "listeners": { - "|click": "function (_self, e)\n{\n_this.grid.footer.onClick('first');\n}" - }, - "cls": "x-btn-icon", - "xtype": "Button", - "|icon": "rootURL + '/Pman/templates/images/search.gif'", - "|xns": "Roo.Toolbar" - }, - { - "listeners": { - "|click": "function (_self, e)\n{\n_this.searchBox.setValue('');\n _this.grid.footer.onClick('first');\n}" - }, - "cls": "x-btn-icon", - "xtype": "Button", - "|icon": "rootURL + '/Pman/templates/images/edit-clear.gif'", - "|xns": "Roo.Toolbar" - }, - { - "|xns": "Roo.Toolbar", - "xtype": "Separator" - }, - { - "text": "Show:", - "xtype": "TextItem", - "|xns": "Roo.Toolbar" - }, - { - "listeners": { - "toggle": "function (_self,st)\n{\n if (st) { _this.grid.filter = 'P,N,U'; } \n _this.grid.footer.onClick('first');\n \n}" - }, - "enableToggle": true, - "pressed": false, - "text": "All", - "toggleGroup": "pgrp", - "xtype": "Button", - "|xns": "Roo.Toolbar" - }, - { - "listeners": { - "toggle": "function (_self,st)\n{\n if (st) { _this.grid.filter = 'P,U'; } \n _this.grid.footer.onClick('first');\n \n}" - }, - "enableToggle": true, - "pressed": true, - "text": "Projects", - "toggleGroup": "pgrp", - "xtype": "Button", - "|xns": "Roo.Toolbar" - }, - { - "listeners": { - "toggle": "function (_self,st)\n{\n if (st) { _this.grid.filter = 'N'; } \n _this.grid.footer.onClick('first');\n \n}" - }, - "enableToggle": true, - "pressed": false, - "text": "Non-Projects", - "toggleGroup": "pgrp", - "xtype": "Button", - "|xns": "Roo.Toolbar" - }, - { - "listeners": { - "toggle": "function (_self, st)\n{\n if (st) { _this.grid.filter = 'X,C'; } \n _this.grid.footer.onClick('first');\n \n}" - }, - "enableToggle": true, - "pressed": false, - "text": "Closed", - "toggleGroup": "pgrp", - "xtype": "Button", - "|xns": "Roo.Toolbar" - } - ] - }, - { - "*prop": "colModel[]", - "dataIndex": "type", - "header": "Type", - "width": 70, - "xtype": "ColumnModel", - "|renderer": "function(v) { return _this.grid.typeToString(v);}", - "|xns": "Roo.grid", - "sortable": true, - "listeners": {} - }, - { - "*prop": "colModel[]", - "dataIndex": "client_id_name", - "header": "Client", - "width": 75, - "xtype": "ColumnModel", - "|renderer": "function(v) { return String.format('{0}', v); }", - "|xns": "Roo.grid" - }, - { - "*prop": "colModel[]", - "dataIndex": "code", - "header": "Code", - "width": 120, - "xtype": "ColumnModel", - "|renderer": "function(v) { return String.format('{0}', v); }", - "|xns": "Roo.grid", - "sortable": true, - "listeners": {} - }, - { - "*prop": "colModel[]", - "dataIndex": "name", - "header": "Name", - "width": 200, - "xtype": "ColumnModel", - "|renderer": "function(v) { return String.format('{0}', v); }", - "|xns": "Roo.grid", - "sortable": true, - "listeners": {} - }, - { - "listeners": { - "afterselectionchange": "function (_self)\n{\n // load project members.\n}" - }, - "*prop": "sm", - "singleSelect": true, - "xtype": "RowSelectionModel", - "|xns": "Roo.grid" - } - ] - } - ] - } - ] - } - ] + "listeners" : { + "|rowdblclick" : "function (_self, rowIndex, e)\n{\n if (!_this.dialog) {\n return;\n }\n _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {\n _this.grid.footer.onClick('first');\n }); \n}\n", + "|render" : "function() \n{\n _this.grid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}" + }, + "filter" : "P,U", + "autoExpandColumn" : "name", + "xtype" : "Grid", + "$ getTypes" : "function() {\n return [\n [ 'U' , \"Project (Unconfirmed)\" ],\n [ 'P' , \"Project\" ],\n [ 'C' , \"Project (Closed)\" ],\n [ 'N' , \"Non-Project\" ],\n [ 'X' , \"Non-Project (Closed)\" ]\n\n ];\n}\n", + "loadMask" : true, + "$ typeToString" : "function(v)\n{\n var ar = this.getTypes();\n var ret = '';\n Roo.each(ar, function(a) {\n if (a[0] == v) {\n ret = a[1];\n return false;\n }\n });\n return ret;\n}\n", + "$ xns" : "Roo.grid", + "* prop" : "grid", + "items" : [ + { + "listeners" : { + "beforeload" : "function (_self, o)\n{\n if (!_this.searchBox) {\n return false;\n } \n o.params = o.params ? o.params : {};\n o.params['query[project_search]'] = _this.searchBox.getValue();\n o.params['query[project_filter]'] = _this.grid.filter;\n}" + }, + "xtype" : "Store", + "remoteSort" : true, + "$ sortInfo" : "{ field : 'code', direction: 'ASC' }", + "$ xns" : "Roo.data", + "* prop" : "dataSource", + "items" : [ + { + "$ url" : "baseURL + '/Roo/Projects.php'", + "method" : "GET", + "xtype" : "HttpProxy", + "$ xns" : "Roo.data", + "* prop" : "proxy" + }, + { + "id" : "id", + "root" : "data", + "xtype" : "JsonReader", + "$ xns" : "Roo.data", + "$ fields" : "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'name',\n 'type': 'string'\n },\n {\n 'name': 'remarks',\n 'type': 'string'\n },\n {\n 'name': 'owner_id',\n 'type': 'int'\n },\n {\n 'name': 'code',\n 'type': 'string'\n },\n {\n 'name': 'active',\n 'type': 'int'\n },\n {\n 'name': 'type',\n 'type': 'string'\n },\n {\n 'name': 'client_id',\n 'type': 'int'\n },\n {\n 'name': 'team_id',\n 'type': 'int'\n },\n {\n 'name': 'file_location',\n 'type': 'string'\n },\n {\n 'name': 'open_date',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'open_by',\n 'type': 'int'\n },\n {\n 'name': 'close_date',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'countries',\n 'type': 'string'\n },\n {\n 'name': 'languages',\n 'type': 'string'\n },\n {\n 'name': 'agency_id',\n 'type': 'int'\n },\n {\n 'name': 'client_id_code',\n 'type': 'string'\n },\n {\n 'name': 'client_id_name',\n 'type': 'string'\n },\n {\n 'name': 'client_id_remarks',\n 'type': 'string'\n },\n {\n 'name': 'client_id_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'client_id_address',\n 'type': 'string'\n },\n {\n 'name': 'client_id_tel',\n 'type': 'string'\n },\n {\n 'name': 'client_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'client_id_email',\n 'type': 'string'\n },\n {\n 'name': 'client_id_id',\n 'type': 'int'\n },\n {\n 'name': 'client_id_isOwner',\n 'type': 'int'\n },\n {\n 'name': 'client_id_logo_id',\n 'type': 'int'\n },\n {\n 'name': 'client_id_background_color',\n 'type': 'string'\n },\n {\n 'name': 'client_id_comptype',\n 'type': 'string'\n },\n {\n 'name': 'client_id_url',\n 'type': 'string'\n },\n {\n 'name': 'client_id_main_office_id',\n 'type': 'int'\n },\n {\n 'name': 'client_id_created_by',\n 'type': 'int'\n },\n {\n 'name': 'client_id_created_dt',\n 'type': 'date'\n },\n {\n 'name': 'client_id_updated_by',\n 'type': 'int'\n },\n {\n 'name': 'client_id_updated_dt',\n 'type': 'date'\n },\n {\n 'name': 'client_id_passwd',\n 'type': 'string'\n },\n {\n 'name': 'agency_id_code',\n 'type': 'string'\n },\n {\n 'name': 'agency_id_name',\n 'type': 'string'\n },\n {\n 'name': 'agency_id_remarks',\n 'type': 'string'\n },\n {\n 'name': 'agency_id_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'agency_id_address',\n 'type': 'string'\n },\n {\n 'name': 'agency_id_tel',\n 'type': 'string'\n },\n {\n 'name': 'agency_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'agency_id_email',\n 'type': 'string'\n },\n {\n 'name': 'agency_id_id',\n 'type': 'int'\n },\n {\n 'name': 'agency_id_isOwner',\n 'type': 'int'\n },\n {\n 'name': 'agency_id_logo_id',\n 'type': 'int'\n },\n {\n 'name': 'agency_id_background_color',\n 'type': 'string'\n },\n {\n 'name': 'agency_id_comptype',\n 'type': 'string'\n },\n {\n 'name': 'agency_id_url',\n 'type': 'string'\n },\n {\n 'name': 'agency_id_main_office_id',\n 'type': 'int'\n },\n {\n 'name': 'agency_id_created_by',\n 'type': 'int'\n },\n {\n 'name': 'agency_id_created_dt',\n 'type': 'date'\n },\n {\n 'name': 'agency_id_updated_by',\n 'type': 'int'\n },\n {\n 'name': 'agency_id_updated_dt',\n 'type': 'date'\n },\n {\n 'name': 'agency_id_passwd',\n 'type': 'string'\n },\n {\n 'name': 'team_id_id',\n 'type': 'int'\n },\n {\n 'name': 'team_id_name',\n 'type': 'string'\n },\n {\n 'name': 'team_id_type',\n 'type': 'int'\n },\n {\n 'name': 'team_id_leader',\n 'type': 'int'\n },\n {\n 'name': 'open_by_id',\n 'type': 'int'\n },\n {\n 'name': 'open_by_office_id',\n 'type': 'int'\n },\n {\n 'name': 'open_by_name',\n 'type': 'string'\n },\n {\n 'name': 'open_by_phone',\n 'type': 'string'\n },\n {\n 'name': 'open_by_fax',\n 'type': 'string'\n },\n {\n 'name': 'open_by_email',\n 'type': 'string'\n },\n {\n 'name': 'open_by_company_id',\n 'type': 'int'\n },\n {\n 'name': 'open_by_role',\n 'type': 'string'\n },\n {\n 'name': 'open_by_active',\n 'type': 'int'\n },\n {\n 'name': 'open_by_remarks',\n 'type': 'string'\n },\n {\n 'name': 'open_by_passwd',\n 'type': 'string'\n },\n {\n 'name': 'open_by_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'open_by_lang',\n 'type': 'string'\n },\n {\n 'name': 'open_by_no_reset_sent',\n 'type': 'int'\n },\n {\n 'name': 'open_by_action_type',\n 'type': 'string'\n },\n {\n 'name': 'open_by_project_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_office_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_name',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_phone',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_email',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_company_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_role',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_active',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_remarks',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_passwd',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_lang',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_no_reset_sent',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_action_type',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_project_id',\n 'type': 'int'\n }\n]", + "* prop" : "reader", + "totalProperty" : "total" + } + ] + }, + { + "pageSize" : 25, + "xtype" : "PagingToolbar", + "emptyMsg" : "No Projects found", + "$ xns" : "Roo", + "displayMsg" : "Displaying Projects {0} - {1} of {2}", + "displayInfo" : true, + "* prop" : "footer" + }, + { + "xtype" : "Toolbar", + "$ xns" : "Roo", + "* prop" : "toolbar", + "items" : [ + { + "listeners" : { + "|click" : "function()\n{\n if (!_this.dialog) {\n return;\n }\n _this.dialog.show( { id : 0 } , function() {\n _this.grid.footer.onClick('first');\n }); \n}\n" + }, + "text" : "Add", + "xtype" : "Button", + "cls" : "x-btn-text-icon", + "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'", + "$ xns" : "Roo.Toolbar" + }, + { + "listeners" : { + "|click" : "function()\n{\n var s = _this.grid.getSelectionModel().getSelections();\n if (!s.length || (s.length > 1)) {\n Roo.MessageBox.alert(\"Error\", s.length ? \"Select only one Row\" : \"Select a Row\");\n return;\n }\n if (!_this.dialog) {\n return;\n }\n _this.dialog.show(s[0].data, function() {\n _this.grid.footer.onClick('first');\n }); \n \n}\n" + }, + "text" : "Edit", + "xtype" : "Button", + "cls" : "x-btn-text-icon", + "$ icon" : "Roo.rootURL + 'images/default/tree/leaf.gif'", + "$ xns" : "Roo.Toolbar" + }, + { + "xtype" : "Separator", + "$ xns" : "Roo.Toolbar" + }, + { + "text" : "Search", + "xtype" : "TextItem", + "$ xns" : "Roo.Toolbar" + }, + { + "listeners" : { + "specialkey" : "function (_self, e)\n{\n if(e.getKey() == 13) {\n _this.grid.footer.onClick('first');\n }\n}", + "render" : "function (_self)\n{\n _this.searchBox = _self;\n}" + }, + "xtype" : "TextField", + "$ xns" : "Roo.form" + }, + { + "listeners" : { + "|click" : "function (_self, e)\n{\n_this.grid.footer.onClick('first');\n}" + }, + "xtype" : "Button", + "cls" : "x-btn-icon", + "$ icon" : "rootURL + '/Pman/templates/images/search.gif'", + "$ xns" : "Roo.Toolbar" + }, + { + "listeners" : { + "|click" : "function (_self, e)\n{\n_this.searchBox.setValue('');\n _this.grid.footer.onClick('first');\n}" + }, + "xtype" : "Button", + "cls" : "x-btn-icon", + "$ icon" : "rootURL + '/Pman/templates/images/edit-clear.gif'", + "$ xns" : "Roo.Toolbar" + }, + { + "xtype" : "Separator", + "$ xns" : "Roo.Toolbar" + }, + { + "text" : "Show:", + "xtype" : "TextItem", + "$ xns" : "Roo.Toolbar" + }, + { + "listeners" : { + "toggle" : "function (_self,st)\n{\n if (st) { _this.grid.filter = 'P,N,U'; } \n _this.grid.footer.onClick('first');\n \n}" + }, + "text" : "All", + "enableToggle" : true, + "toggleGroup" : "pgrp", + "pressed" : false, + "xtype" : "Button", + "$ xns" : "Roo.Toolbar" + }, + { + "listeners" : { + "toggle" : "function (_self,st)\n{\n if (st) { _this.grid.filter = 'P,U'; } \n _this.grid.footer.onClick('first');\n \n}" + }, + "text" : "Projects", + "enableToggle" : true, + "toggleGroup" : "pgrp", + "pressed" : true, + "xtype" : "Button", + "$ xns" : "Roo.Toolbar" + }, + { + "listeners" : { + "toggle" : "function (_self,st)\n{\n if (st) { _this.grid.filter = 'N'; } \n _this.grid.footer.onClick('first');\n \n}" + }, + "text" : "Non-Projects", + "enableToggle" : true, + "toggleGroup" : "pgrp", + "pressed" : false, + "xtype" : "Button", + "$ xns" : "Roo.Toolbar" + }, + { + "listeners" : { + "toggle" : "function (_self, st)\n{\n if (st) { _this.grid.filter = 'X,C'; } \n _this.grid.footer.onClick('first');\n \n}" + }, + "text" : "Closed", + "enableToggle" : true, + "toggleGroup" : "pgrp", + "pressed" : false, + "xtype" : "Button", + "$ xns" : "Roo.Toolbar" + } + ] + }, + { + "xtype" : "ColumnModel", + "sortable" : true, + "header" : "Type", + "width" : 70, + "$ renderer" : "function(v) { return _this.grid.typeToString(v);}", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "type" + }, + { + "xtype" : "ColumnModel", + "header" : "Client", + "width" : 75, + "$ renderer" : "function(v) { return String.format('{0}', v); }", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "client_id_name" + }, + { + "xtype" : "ColumnModel", + "sortable" : true, + "header" : "Code", + "width" : 120, + "$ renderer" : "function(v) { return String.format('{0}', v); }", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "code" + }, + { + "xtype" : "ColumnModel", + "sortable" : true, + "header" : "Name", + "width" : 200, + "$ renderer" : "function(v) { return String.format('{0}', v); }", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "name" + }, + { + "listeners" : { + "afterselectionchange" : "function (_self)\n{\n // load project members.\n}" + }, + "xtype" : "RowSelectionModel", + "singleSelect" : true, + "$ xns" : "Roo.grid", + "* prop" : "sm" + } + ] } - ], - "permname": "Core.Projects_All", - "modOrder": "002" + ] + } + ] + } + ] + } + ] } \ No newline at end of file diff --git a/Pman.Tab.AdminProjectManager.js b/Pman.Tab.AdminProjectManager.js index be927f3..43fdab7 100644 --- a/Pman.Tab.AdminProjectManager.js +++ b/Pman.Tab.AdminProjectManager.js @@ -2,752 +2,788 @@ // Auto generated file - created by app.Builder.js- do not edit directly (at present!) +Roo.namespace('Pman.Tab'); +Pman.Tab.AdminProjectManager = new Roo.XComponent({ -// register the module first -Pman.on('beforeload', function() -{ - Pman.register({ - part : ["Admin","ProjectManager"], - modKey : '002-Pman.Tab.AdminProjectManager', - module : Pman.Tab.AdminProjectManager, - region : 'center', - parent : Pman.Tab.Admin, - name : "Pman.Tab.AdminProjectManager", - disabled : false, - permname: 'Core.Projects_All' - }); -}); - -Pman.Tab.AdminProjectManager = new Roo.util.Observable({ - - panel : false, - disabled : false, - parentLayout: false, - - add : function(parentLayout, region) - { - - var _this = this; - this.parentLayout = parentLayout; + _strings : { + '54e1d44609e3abed11f6e1eb6ae54988' :"Projects", + '8115b8afd5b2953d9fa63eb0db9559fc' :"No Projects found", + 'ec211f7c20af43e742bf2570c3cb84f9' :"Add", + '13348442cc6a27032d2b4aa28b75a5d3' :"Search", + '7dce122004969d56ae2e0245cb754d35' :"Edit", + '577d7068826de925ea2aec01dbadf5e4' :"Client", + '917d465e9a9e8b16a8da50a1ca8156ca' :"Show:", + '0f111c111475c934057e6f8bb8314d56' :"Non-Projects", + '03f4a47830f97377a35321051685071e' :"Closed", + 'f45e7cfb0824b6d381ade7d81bb81615' :"Displaying Projects {0} - {1} of {2}", + 'b1c94ca2fbc3e78fc30069c8d0f01680' :"All", + 'a1fa27779242b4902f7ae3bdd5c6d508' :"Type", + 'ca0dbad92a874b2f69b549293387925e' :"Code", + '49ee3087348e8d44e1feda1917443987' :"Name", + '93573647a6041adaabd942e88cc29e23' :"Projects / Members" + }, - this.panel = parentLayout.addxtype({ - xtype: 'NestedLayoutPanel', - xns: Roo, - fitContainer : true, - fitToFrame : true, - region : 'center', - title : "Projects / Members", - layout : { - xtype: 'BorderLayout', - xns: Roo, - items : [ - { - xtype: 'GridPanel', - xns: Roo, - listeners : { - activate : function() { - _this.panel = this; - try { - _this.dialog = Pman.Dialog.CoreProject ; - } catch(e) {} - if (_this.grid) { - _this.grid.footer.onClick('first'); - } - } - }, - background : true, - fitContainer : true, - fitToframe : true, - region : 'center', - tableName : 'Projects', - title : "Projects", - grid : { - xtype: 'Grid', - xns: Roo.grid, - 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'); - }); - } - }, - autoExpandColumn : 'name', - filter : 'P,U', - loadMask : true, - getTypes : function() { - return [ - [ 'U' , "Project (Unconfirmed)" ], - [ 'P' , "Project" ], - [ 'C' , "Project (Closed)" ], - [ 'N' , "Non-Project" ], - [ 'X' , "Non-Project (Closed)" ] - - ]; - }, - typeToString : function(v) - { - var ar = this.getTypes(); - var ret = ''; - Roo.each(ar, function(a) { - if (a[0] == v) { - ret = a[1]; - return false; - } - }); - return ret; - }, - dataSource : { - xtype: 'Store', - xns: Roo.data, - listeners : { - beforeload : function (_self, o) - { - if (!_this.searchBox) { - return false; - } - o.params = o.params ? o.params : {}; - o.params['query[project_search]'] = _this.searchBox.getValue(); - o.params['query[project_filter]'] = _this.grid.filter; - } - }, - remoteSort : true, - sortInfo : { field : 'code', direction: 'ASC' }, - proxy : { - xtype: 'HttpProxy', - xns: Roo.data, - method : 'GET', - url : baseURL + '/Roo/Projects.php' - }, - reader : { - xtype: 'JsonReader', - xns: Roo.data, - totalProperty : 'total', - root : 'data', - id : 'id', - fields : [ - { - 'name': 'id', - 'type': 'int' - }, - { - 'name': 'name', - 'type': 'string' - }, - { - 'name': 'remarks', - 'type': 'string' - }, - { - 'name': 'owner_id', - 'type': 'int' - }, - { - 'name': 'code', - 'type': 'string' - }, - { - 'name': 'active', - 'type': 'int' - }, - { - 'name': 'type', - 'type': 'string' - }, - { - 'name': 'client_id', - 'type': 'int' - }, - { - 'name': 'team_id', - 'type': 'int' - }, - { - 'name': 'file_location', - 'type': 'string' - }, - { - 'name': 'open_date', - 'type': 'date', - 'dateFormat': 'Y-m-d' - }, - { - 'name': 'open_by', - 'type': 'int' - }, - { - 'name': 'close_date', - 'type': 'date', - 'dateFormat': 'Y-m-d' - }, - { - 'name': 'countries', - 'type': 'string' - }, - { - 'name': 'languages', - 'type': 'string' - }, - { - 'name': 'agency_id', - 'type': 'int' - }, - { - 'name': 'client_id_code', - 'type': 'string' - }, - { - 'name': 'client_id_name', - 'type': 'string' - }, - { - 'name': 'client_id_remarks', - 'type': 'string' - }, - { - 'name': 'client_id_owner_id', - 'type': 'int' - }, - { - 'name': 'client_id_address', - 'type': 'string' - }, - { - 'name': 'client_id_tel', - 'type': 'string' - }, - { - 'name': 'client_id_fax', - 'type': 'string' - }, - { - 'name': 'client_id_email', - 'type': 'string' - }, - { - 'name': 'client_id_id', - 'type': 'int' - }, - { - 'name': 'client_id_isOwner', - 'type': 'int' - }, - { - 'name': 'client_id_logo_id', - 'type': 'int' - }, - { - 'name': 'client_id_background_color', - 'type': 'string' - }, - { - 'name': 'client_id_comptype', - 'type': 'string' - }, - { - 'name': 'client_id_url', - 'type': 'string' - }, - { - 'name': 'client_id_main_office_id', - 'type': 'int' - }, - { - 'name': 'client_id_created_by', - 'type': 'int' - }, - { - 'name': 'client_id_created_dt', - 'type': 'date' - }, - { - 'name': 'client_id_updated_by', - 'type': 'int' - }, - { - 'name': 'client_id_updated_dt', - 'type': 'date' - }, - { - 'name': 'client_id_passwd', - 'type': 'string' - }, - { - 'name': 'agency_id_code', - 'type': 'string' - }, - { - 'name': 'agency_id_name', - 'type': 'string' - }, - { - 'name': 'agency_id_remarks', - 'type': 'string' - }, - { - 'name': 'agency_id_owner_id', - 'type': 'int' - }, - { - 'name': 'agency_id_address', - 'type': 'string' - }, - { - 'name': 'agency_id_tel', - 'type': 'string' - }, - { - 'name': 'agency_id_fax', - 'type': 'string' - }, - { - 'name': 'agency_id_email', - 'type': 'string' - }, - { - 'name': 'agency_id_id', - 'type': 'int' - }, - { - 'name': 'agency_id_isOwner', - 'type': 'int' - }, - { - 'name': 'agency_id_logo_id', - 'type': 'int' - }, - { - 'name': 'agency_id_background_color', - 'type': 'string' - }, - { - 'name': 'agency_id_comptype', - 'type': 'string' - }, - { - 'name': 'agency_id_url', - 'type': 'string' - }, - { - 'name': 'agency_id_main_office_id', - 'type': 'int' - }, - { - 'name': 'agency_id_created_by', - 'type': 'int' - }, - { - 'name': 'agency_id_created_dt', - 'type': 'date' - }, - { - 'name': 'agency_id_updated_by', - 'type': 'int' - }, - { - 'name': 'agency_id_updated_dt', - 'type': 'date' - }, - { - 'name': 'agency_id_passwd', - 'type': 'string' - }, - { - 'name': 'team_id_id', - 'type': 'int' - }, - { - 'name': 'team_id_name', - 'type': 'string' - }, - { - 'name': 'team_id_type', - 'type': 'int' - }, - { - 'name': 'team_id_leader', - 'type': 'int' - }, - { - 'name': 'open_by_id', - 'type': 'int' - }, - { - 'name': 'open_by_office_id', - 'type': 'int' - }, - { - 'name': 'open_by_name', - 'type': 'string' - }, - { - 'name': 'open_by_phone', - 'type': 'string' - }, - { - 'name': 'open_by_fax', - 'type': 'string' - }, - { - 'name': 'open_by_email', - 'type': 'string' - }, - { - 'name': 'open_by_company_id', - 'type': 'int' - }, - { - 'name': 'open_by_role', - 'type': 'string' - }, - { - 'name': 'open_by_active', - 'type': 'int' - }, - { - 'name': 'open_by_remarks', - 'type': 'string' - }, - { - 'name': 'open_by_passwd', - 'type': 'string' - }, - { - 'name': 'open_by_owner_id', - 'type': 'int' - }, - { - 'name': 'open_by_lang', - 'type': 'string' - }, - { - 'name': 'open_by_no_reset_sent', - 'type': 'int' - }, - { - 'name': 'open_by_action_type', - 'type': 'string' - }, - { - 'name': 'open_by_project_id', - 'type': 'int' - }, - { - 'name': 'owner_id_id', - 'type': 'int' - }, - { - 'name': 'owner_id_office_id', - 'type': 'int' - }, - { - 'name': 'owner_id_name', - 'type': 'string' - }, - { - 'name': 'owner_id_phone', - 'type': 'string' - }, - { - 'name': 'owner_id_fax', - 'type': 'string' - }, - { - 'name': 'owner_id_email', - 'type': 'string' - }, - { - 'name': 'owner_id_company_id', - 'type': 'int' - }, - { - 'name': 'owner_id_role', - 'type': 'string' - }, - { - 'name': 'owner_id_active', - 'type': 'int' - }, - { - 'name': 'owner_id_remarks', - 'type': 'string' - }, - { - 'name': 'owner_id_passwd', - 'type': 'string' - }, - { - 'name': 'owner_id_owner_id', - 'type': 'int' - }, - { - 'name': 'owner_id_lang', - 'type': 'string' - }, - { - 'name': 'owner_id_no_reset_sent', - 'type': 'int' - }, - { - 'name': 'owner_id_action_type', - 'type': 'string' - }, - { - 'name': 'owner_id_project_id', - 'type': 'int' - } - ] - } - }, - footer : { - xtype: 'PagingToolbar', - xns: Roo, - displayInfo : true, - displayMsg : "Displaying Projects {0} - {1} of {2}", - emptyMsg : "No Projects found", - pageSize : 25 - }, - toolbar : { - xtype: 'Toolbar', - xns: Roo, - items : [ - { - xtype: 'Button', - xns: Roo.Toolbar, - listeners : { - click : function() - { - if (!_this.dialog) return; - _this.dialog.show( { id : 0 } , function() { - _this.grid.footer.onClick('first'); - }); - } - }, - cls : 'x-btn-text-icon', - text : "Add", - icon : Roo.rootURL + 'images/default/dd/drop-add.gif' - }, - { - 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: 'Separator', - xns: Roo.Toolbar - }, - { - xtype: 'TextItem', - xns: Roo.Toolbar, - text : "Search" - }, - { - xtype: 'TextField', - xns: Roo.form, - listeners : { - render : function (_self) - { - _this.searchBox = _self; - }, - specialkey : function (_self, e) - { - if(e.getKey() == 13) { - _this.grid.footer.onClick('first'); - } - } - } - }, - { - xtype: 'Button', - xns: Roo.Toolbar, - listeners : { - click : function (_self, e) - { - _this.grid.footer.onClick('first'); - } - }, - cls : 'x-btn-icon', - icon : rootURL + '/Pman/templates/images/search.gif' - }, - { - xtype: 'Button', - xns: Roo.Toolbar, - listeners : { - click : function (_self, e) - { - _this.searchBox.setValue(''); - _this.grid.footer.onClick('first'); - } - }, - cls : 'x-btn-icon', - icon : rootURL + '/Pman/templates/images/edit-clear.gif' - }, - { - xtype: 'Separator', - xns: Roo.Toolbar - }, - { - xtype: 'TextItem', - xns: Roo.Toolbar, - text : "Show:" - }, - { - xtype: 'Button', - xns: Roo.Toolbar, - listeners : { - toggle : function (_self,st) - { - if (st) { _this.grid.filter = 'P,N,U'; } - _this.grid.footer.onClick('first'); - - } - }, - enableToggle : true, - pressed : false, - text : "All", - toggleGroup : 'pgrp' - }, - { - xtype: 'Button', - xns: Roo.Toolbar, - listeners : { - toggle : function (_self,st) - { - if (st) { _this.grid.filter = 'P,U'; } - _this.grid.footer.onClick('first'); - - } - }, - enableToggle : true, - pressed : true, - text : "Projects", - toggleGroup : 'pgrp' - }, - { - xtype: 'Button', - xns: Roo.Toolbar, - listeners : { - toggle : function (_self,st) - { - if (st) { _this.grid.filter = 'N'; } - _this.grid.footer.onClick('first'); - - } - }, - enableToggle : true, - pressed : false, - text : "Non-Projects", - toggleGroup : 'pgrp' - }, - { - xtype: 'Button', - xns: Roo.Toolbar, - listeners : { - toggle : function (_self, st) - { - if (st) { _this.grid.filter = 'X,C'; } - _this.grid.footer.onClick('first'); - - } - }, - enableToggle : true, - pressed : false, - text : "Closed", - toggleGroup : 'pgrp' - } - ] - }, - colModel : [ - { - xtype: 'ColumnModel', - xns: Roo.grid, - dataIndex : 'type', - header : 'Type', - width : 70, - renderer : function(v) { return _this.grid.typeToString(v);}, - sortable : true - }, - { - xtype: 'ColumnModel', - xns: Roo.grid, - dataIndex : 'client_id_name', - header : 'Client', - width : 75, - renderer : function(v) { return String.format('{0}', v); } - }, - { - xtype: 'ColumnModel', - xns: Roo.grid, - dataIndex : 'code', - header : 'Code', - width : 120, - renderer : function(v) { return String.format('{0}', v); }, - sortable : true - }, - { - xtype: 'ColumnModel', - xns: Roo.grid, - dataIndex : 'name', - header : 'Name', - width : 200, - renderer : function(v) { return String.format('{0}', v); }, - sortable : true - } - ], - sm : { - xtype: 'RowSelectionModel', - xns: Roo.grid, - listeners : { - afterselectionchange : function (_self) - { - // load project members. - } - }, - singleSelect : true - } - } - } - ], - center : { - xtype: 'LayoutRegion', - xns: Roo - }, - east : { - xtype: 'LayoutRegion', - xns: Roo, - split : true, - width : 300 + part : ["Admin", "ProjectManager" ], + order : '002-Pman.Tab.AdminProjectManager', + region : 'center', + parent : 'Pman.Tab.Admin', + name : "Pman.Tab.AdminProjectManager", + disabled : false, + permname : 'Core.Projects_All', + _tree : function() + { + var _this = this; + var MODULE = this; + return { + fitContainer : true, + fitToFrame : true, + region : 'center', + title : _this._strings['93573647a6041adaabd942e88cc29e23'] /* Projects / Members */, + xns : Roo, + '|xns' : 'Roo', + xtype : 'NestedLayoutPanel', + layout : { + xns : Roo, + '|xns' : 'Roo', + xtype : 'BorderLayout', + center : { + xns : Roo, + '|xns' : 'Roo', + xtype : 'LayoutRegion' + }, + east : { + split : true, + width : 300, + xns : Roo, + '|xns' : 'Roo', + xtype : 'LayoutRegion' + }, + items : [ + { + background : true, + fitContainer : true, + fitToframe : true, + region : 'center', + tableName : 'Projects', + title : _this._strings['54e1d44609e3abed11f6e1eb6ae54988'] /* Projects */, + xns : Roo, + '|xns' : 'Roo', + xtype : 'GridPanel', + listeners : { + activate : function() { + _this.panel = this; + try { + _this.dialog = Pman.Dialog.CoreProject ; + } catch(e) {} + if (_this.grid) { + _this.grid.footer.onClick('first'); + } + } + }, + grid : { + autoExpandColumn : 'name', + filter : 'P,U', + getTypes : function() { + return [ + [ 'U' , "Project (Unconfirmed)" ], + [ 'P' , "Project" ], + [ 'C' , "Project (Closed)" ], + [ 'N' , "Non-Project" ], + [ 'X' , "Non-Project (Closed)" ] + + ]; + }, + loadMask : true, + typeToString : function(v) + { + var ar = this.getTypes(); + var ret = ''; + Roo.each(ar, function(a) { + if (a[0] == v) { + ret = a[1]; + return false; + } + }); + return ret; + }, + 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'); + } + }, + rowdblclick : function (_self, rowIndex, e) + { + if (!_this.dialog) { + return; + } + _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() { + _this.grid.footer.onClick('first'); + }); + } + }, + footer : { + displayInfo : true, + displayMsg : _this._strings['f45e7cfb0824b6d381ade7d81bb81615'] /* Displaying Projects {0} - {1} of {2} */, + emptyMsg : _this._strings['8115b8afd5b2953d9fa63eb0db9559fc'] /* No Projects found */, + pageSize : 25, + xns : Roo, + '|xns' : 'Roo', + xtype : 'PagingToolbar' + }, + toolbar : { + xns : Roo, + '|xns' : 'Roo', + xtype : 'Toolbar', + items : [ + { + cls : 'x-btn-text-icon', + icon : Roo.rootURL + 'images/default/dd/drop-add.gif', + text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */, + xns : Roo.Toolbar, + '|xns' : 'Roo.Toolbar', + xtype : 'Button', + listeners : { + click : function() + { + if (!_this.dialog) { + return; } + _this.dialog.show( { id : 0 } , function() { + _this.grid.footer.onClick('first'); + }); } - }); - this.layout = this.panel.layout; - - } + } + }, + { + cls : 'x-btn-text-icon', + icon : Roo.rootURL + 'images/default/tree/leaf.gif', + text : _this._strings['7dce122004969d56ae2e0245cb754d35'] /* Edit */, + xns : Roo.Toolbar, + '|xns' : 'Roo.Toolbar', + xtype : 'Button', + 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'); + }); + + } + } + }, + { + xns : Roo.Toolbar, + '|xns' : 'Roo.Toolbar', + xtype : 'Separator' + }, + { + text : _this._strings['13348442cc6a27032d2b4aa28b75a5d3'] /* Search */, + xns : Roo.Toolbar, + '|xns' : 'Roo.Toolbar', + xtype : 'TextItem' + }, + { + xns : Roo.form, + '|xns' : 'Roo.form', + xtype : 'TextField', + listeners : { + render : function (_self) + { + _this.searchBox = _self; + }, + specialkey : function (_self, e) + { + if(e.getKey() == 13) { + _this.grid.footer.onClick('first'); + } + } + } + }, + { + cls : 'x-btn-icon', + icon : rootURL + '/Pman/templates/images/search.gif', + xns : Roo.Toolbar, + '|xns' : 'Roo.Toolbar', + xtype : 'Button', + listeners : { + click : function (_self, e) + { + _this.grid.footer.onClick('first'); + } + } + }, + { + cls : 'x-btn-icon', + icon : rootURL + '/Pman/templates/images/edit-clear.gif', + xns : Roo.Toolbar, + '|xns' : 'Roo.Toolbar', + xtype : 'Button', + listeners : { + click : function (_self, e) + { + _this.searchBox.setValue(''); + _this.grid.footer.onClick('first'); + } + } + }, + { + xns : Roo.Toolbar, + '|xns' : 'Roo.Toolbar', + xtype : 'Separator' + }, + { + text : _this._strings['917d465e9a9e8b16a8da50a1ca8156ca'] /* Show: */, + xns : Roo.Toolbar, + '|xns' : 'Roo.Toolbar', + xtype : 'TextItem' + }, + { + enableToggle : true, + pressed : false, + text : _this._strings['b1c94ca2fbc3e78fc30069c8d0f01680'] /* All */, + toggleGroup : 'pgrp', + xns : Roo.Toolbar, + '|xns' : 'Roo.Toolbar', + xtype : 'Button', + listeners : { + toggle : function (_self,st) + { + if (st) { _this.grid.filter = 'P,N,U'; } + _this.grid.footer.onClick('first'); + + } + } + }, + { + enableToggle : true, + pressed : true, + text : _this._strings['54e1d44609e3abed11f6e1eb6ae54988'] /* Projects */, + toggleGroup : 'pgrp', + xns : Roo.Toolbar, + '|xns' : 'Roo.Toolbar', + xtype : 'Button', + listeners : { + toggle : function (_self,st) + { + if (st) { _this.grid.filter = 'P,U'; } + _this.grid.footer.onClick('first'); + + } + } + }, + { + enableToggle : true, + pressed : false, + text : _this._strings['0f111c111475c934057e6f8bb8314d56'] /* Non-Projects */, + toggleGroup : 'pgrp', + xns : Roo.Toolbar, + '|xns' : 'Roo.Toolbar', + xtype : 'Button', + listeners : { + toggle : function (_self,st) + { + if (st) { _this.grid.filter = 'N'; } + _this.grid.footer.onClick('first'); + + } + } + }, + { + enableToggle : true, + pressed : false, + text : _this._strings['03f4a47830f97377a35321051685071e'] /* Closed */, + toggleGroup : 'pgrp', + xns : Roo.Toolbar, + '|xns' : 'Roo.Toolbar', + xtype : 'Button', + listeners : { + toggle : function (_self, st) + { + if (st) { _this.grid.filter = 'X,C'; } + _this.grid.footer.onClick('first'); + + } + } + } + ] + }, + dataSource : { + remoteSort : true, + sortInfo : { field : 'code', direction: 'ASC' }, + xns : Roo.data, + '|xns' : 'Roo.data', + xtype : 'Store', + listeners : { + beforeload : function (_self, o) + { + if (!_this.searchBox) { + return false; + } + o.params = o.params ? o.params : {}; + o.params['query[project_search]'] = _this.searchBox.getValue(); + o.params['query[project_filter]'] = _this.grid.filter; + } + }, + proxy : { + method : 'GET', + url : baseURL + '/Roo/Projects.php', + xns : Roo.data, + '|xns' : 'Roo.data', + xtype : 'HttpProxy' + }, + reader : { + fields : [ + { + 'name': 'id', + 'type': 'int' + }, + { + 'name': 'name', + 'type': 'string' + }, + { + 'name': 'remarks', + 'type': 'string' + }, + { + 'name': 'owner_id', + 'type': 'int' + }, + { + 'name': 'code', + 'type': 'string' + }, + { + 'name': 'active', + 'type': 'int' + }, + { + 'name': 'type', + 'type': 'string' + }, + { + 'name': 'client_id', + 'type': 'int' + }, + { + 'name': 'team_id', + 'type': 'int' + }, + { + 'name': 'file_location', + 'type': 'string' + }, + { + 'name': 'open_date', + 'type': 'date', + 'dateFormat': 'Y-m-d' + }, + { + 'name': 'open_by', + 'type': 'int' + }, + { + 'name': 'close_date', + 'type': 'date', + 'dateFormat': 'Y-m-d' + }, + { + 'name': 'countries', + 'type': 'string' + }, + { + 'name': 'languages', + 'type': 'string' + }, + { + 'name': 'agency_id', + 'type': 'int' + }, + { + 'name': 'client_id_code', + 'type': 'string' + }, + { + 'name': 'client_id_name', + 'type': 'string' + }, + { + 'name': 'client_id_remarks', + 'type': 'string' + }, + { + 'name': 'client_id_owner_id', + 'type': 'int' + }, + { + 'name': 'client_id_address', + 'type': 'string' + }, + { + 'name': 'client_id_tel', + 'type': 'string' + }, + { + 'name': 'client_id_fax', + 'type': 'string' + }, + { + 'name': 'client_id_email', + 'type': 'string' + }, + { + 'name': 'client_id_id', + 'type': 'int' + }, + { + 'name': 'client_id_isOwner', + 'type': 'int' + }, + { + 'name': 'client_id_logo_id', + 'type': 'int' + }, + { + 'name': 'client_id_background_color', + 'type': 'string' + }, + { + 'name': 'client_id_comptype', + 'type': 'string' + }, + { + 'name': 'client_id_url', + 'type': 'string' + }, + { + 'name': 'client_id_main_office_id', + 'type': 'int' + }, + { + 'name': 'client_id_created_by', + 'type': 'int' + }, + { + 'name': 'client_id_created_dt', + 'type': 'date' + }, + { + 'name': 'client_id_updated_by', + 'type': 'int' + }, + { + 'name': 'client_id_updated_dt', + 'type': 'date' + }, + { + 'name': 'client_id_passwd', + 'type': 'string' + }, + { + 'name': 'agency_id_code', + 'type': 'string' + }, + { + 'name': 'agency_id_name', + 'type': 'string' + }, + { + 'name': 'agency_id_remarks', + 'type': 'string' + }, + { + 'name': 'agency_id_owner_id', + 'type': 'int' + }, + { + 'name': 'agency_id_address', + 'type': 'string' + }, + { + 'name': 'agency_id_tel', + 'type': 'string' + }, + { + 'name': 'agency_id_fax', + 'type': 'string' + }, + { + 'name': 'agency_id_email', + 'type': 'string' + }, + { + 'name': 'agency_id_id', + 'type': 'int' + }, + { + 'name': 'agency_id_isOwner', + 'type': 'int' + }, + { + 'name': 'agency_id_logo_id', + 'type': 'int' + }, + { + 'name': 'agency_id_background_color', + 'type': 'string' + }, + { + 'name': 'agency_id_comptype', + 'type': 'string' + }, + { + 'name': 'agency_id_url', + 'type': 'string' + }, + { + 'name': 'agency_id_main_office_id', + 'type': 'int' + }, + { + 'name': 'agency_id_created_by', + 'type': 'int' + }, + { + 'name': 'agency_id_created_dt', + 'type': 'date' + }, + { + 'name': 'agency_id_updated_by', + 'type': 'int' + }, + { + 'name': 'agency_id_updated_dt', + 'type': 'date' + }, + { + 'name': 'agency_id_passwd', + 'type': 'string' + }, + { + 'name': 'team_id_id', + 'type': 'int' + }, + { + 'name': 'team_id_name', + 'type': 'string' + }, + { + 'name': 'team_id_type', + 'type': 'int' + }, + { + 'name': 'team_id_leader', + 'type': 'int' + }, + { + 'name': 'open_by_id', + 'type': 'int' + }, + { + 'name': 'open_by_office_id', + 'type': 'int' + }, + { + 'name': 'open_by_name', + 'type': 'string' + }, + { + 'name': 'open_by_phone', + 'type': 'string' + }, + { + 'name': 'open_by_fax', + 'type': 'string' + }, + { + 'name': 'open_by_email', + 'type': 'string' + }, + { + 'name': 'open_by_company_id', + 'type': 'int' + }, + { + 'name': 'open_by_role', + 'type': 'string' + }, + { + 'name': 'open_by_active', + 'type': 'int' + }, + { + 'name': 'open_by_remarks', + 'type': 'string' + }, + { + 'name': 'open_by_passwd', + 'type': 'string' + }, + { + 'name': 'open_by_owner_id', + 'type': 'int' + }, + { + 'name': 'open_by_lang', + 'type': 'string' + }, + { + 'name': 'open_by_no_reset_sent', + 'type': 'int' + }, + { + 'name': 'open_by_action_type', + 'type': 'string' + }, + { + 'name': 'open_by_project_id', + 'type': 'int' + }, + { + 'name': 'owner_id_id', + 'type': 'int' + }, + { + 'name': 'owner_id_office_id', + 'type': 'int' + }, + { + 'name': 'owner_id_name', + 'type': 'string' + }, + { + 'name': 'owner_id_phone', + 'type': 'string' + }, + { + 'name': 'owner_id_fax', + 'type': 'string' + }, + { + 'name': 'owner_id_email', + 'type': 'string' + }, + { + 'name': 'owner_id_company_id', + 'type': 'int' + }, + { + 'name': 'owner_id_role', + 'type': 'string' + }, + { + 'name': 'owner_id_active', + 'type': 'int' + }, + { + 'name': 'owner_id_remarks', + 'type': 'string' + }, + { + 'name': 'owner_id_passwd', + 'type': 'string' + }, + { + 'name': 'owner_id_owner_id', + 'type': 'int' + }, + { + 'name': 'owner_id_lang', + 'type': 'string' + }, + { + 'name': 'owner_id_no_reset_sent', + 'type': 'int' + }, + { + 'name': 'owner_id_action_type', + 'type': 'string' + }, + { + 'name': 'owner_id_project_id', + 'type': 'int' + } + ], + id : 'id', + root : 'data', + totalProperty : 'total', + xns : Roo.data, + '|xns' : 'Roo.data', + xtype : 'JsonReader' + } + }, + sm : { + singleSelect : true, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'RowSelectionModel', + listeners : { + afterselectionchange : function (_self) + { + // load project members. + } + } + }, + colModel : [ + { + dataIndex : 'type', + header : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'] /* Type */, + renderer : function(v) { return _this.grid.typeToString(v);}, + sortable : true, + width : 70, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' + }, + { + dataIndex : 'client_id_name', + header : _this._strings['577d7068826de925ea2aec01dbadf5e4'] /* Client */, + renderer : function(v) { return String.format('{0}', v); }, + width : 75, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' + }, + { + dataIndex : 'code', + header : _this._strings['ca0dbad92a874b2f69b549293387925e'] /* Code */, + renderer : function(v) { return String.format('{0}', v); }, + sortable : true, + width : 120, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' + }, + { + dataIndex : 'name', + header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */, + renderer : function(v) { return String.format('{0}', v); }, + sortable : true, + width : 200, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' + } + ] + } + } + ] + } + }; } }); diff --git a/Pman.Tab.AdminProjectMembers.bjs b/Pman.Tab.AdminProjectMembers.bjs index 190bd00..0f2d906 100644 --- a/Pman.Tab.AdminProjectMembers.bjs +++ b/Pman.Tab.AdminProjectMembers.bjs @@ -1,169 +1,180 @@ { - "id": "roo-file-189", - "name": "Pman.Tab.AdminProjectMembers", - "parent": "Pman.Tab.AdminProjectManager", - "title": "Pman.Tab.AdminProjectMembers", - "path": "/home/alan/gitlive/Pman.Admin/Pman.Tab.AdminProjectMembers.bjs", - "items": [ + "name" : "Pman.Tab.AdminProjectMembers", + "parent" : "Pman.Tab.AdminProjectManager", + "title" : "Pman.Tab.AdminProjectMembers", + "path" : "/home/alan/gitlive/Pman.Admin/Pman.Tab.AdminProjectMembers.bjs", + "permname" : "", + "modOrder" : "001", + "strings" : { + "858ba4765e53c712ef672a9570474b1d" : "Member", + "ce8ae9da5b7cd6c3df2929543a9af92d" : "Email", + "1c76cbfe21c6f44c1d1e59d54f3e4420" : "Company", + "7cdc93ea9b163a546146172299bb0b38" : "Owners", + "ef53538ae41a651c7f72ab6cb1135d8c" : "Members", + "8f7f93630c366dc55aec88eb8e9640d0" : "Staff", + "6311ae17c1ee52b36e68aaf4ad066387" : "Other", + "40bed7cf9b3d4bb3a3d7a7e3eb18c5eb" : "Person", + "f1174ecbbc232f948717979daf04cf08" : "No Person found", + "49ee3087348e8d44e1feda1917443987" : "Name", + "d41d8cd98f00b204e9800998ecf8427e" : " " + }, + "items" : [ + { + "listeners" : { + "|activate" : "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}" + }, + "fitToframe" : true, + "background" : true, + "region" : "east", + "title" : "Person", + "xtype" : "GridPanel", + "fitContainer" : true, + "$ xns" : "Roo", + "tableName" : "Person", + "items" : [ + { + "listeners" : { + "|rowdblclick" : "function (_self, rowIndex, e)\n{\n if (!_this.dialog) {\n return;\n }\n _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {\n _this.grid.footer.onClick('first');\n }); \n}\n", + "|render" : "function() \n{\n _this.grid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}" + }, + "filter" : "S", + "autoExpandColumn" : "name", + "xtype" : "Grid", + "loadMask" : true, + "$ xns" : "Roo.grid", + "* prop" : "grid", + "items" : [ + { + "listeners" : { + "beforeload" : "function (_self, options)\n{\n if (!_this.memberBtn) {\n return false;\n }\n options.params['query[project_member_filter]'] = _this.memberBtn.pressed ? 1 :0;\n var pm = Pman ? Pman.Tab.AdminProjectManager :false;\n if (!pm || !pm.grid || !pm.grid.getSelectionModel().getSelected()) {\n return false;\n }\n var sel = pm.grid.getSelectionModel().getSelected();\n options.params['query[project_member_of]'] = sel.data.id; \n switch(_this.grid.filter) {\n case 'S': // staff\n options.params.company_id_comptype='OWNER';\n\n break;\n case 'O': // owner..\n options.params.company_id = sel.data.client_id;\n break;\n case 'A': // not owner or staff..\n options.params['!company_id'] = sel.data.client_id;\n options.params['!company_id_comptype'] ='OWNER';\n break; \n }\n \n}" + }, + "xtype" : "Store", + "remoteSort" : true, + "$ sortInfo" : "{ field : 'name', direction: 'ASC' }", + "$ xns" : "Roo.data", + "* prop" : "dataSource", + "items" : [ { - "listeners": { - "|activate": "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}" - }, - "background": true, - "fitContainer": true, - "fitToframe": true, - "region": "east", - "tableName": "Person", - "title": "Person", - "xtype": "GridPanel", - "|xns": "Roo", - "items": [ - { - "listeners": { - "|render": "function() \n{\n _this.grid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}", - "|rowdblclick": "function (_self, rowIndex, e)\n{\n if (!_this.dialog) return;\n _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {\n _this.grid.footer.onClick('first');\n }); \n}\n" - }, - "filter": "S", - "*prop": "grid", - "autoExpandColumn": "name", - "loadMask": true, - "xtype": "Grid", - "|xns": "Roo.grid", - "items": [ - { - "listeners": { - "beforeload": "function (_self, options)\n{\n if (!_this.memberBtn) {\n return false;\n }\n options.params['query[project_member_filter]'] = _this.memberBtn.pressed ? 1 :0;\n var pm = Pman ? Pman.Tab.AdminProjectManager :false;\n if (!pm || !pm.grid || !pm.grid.getSelectionModel().getSelected()) {\n return false;\n }\n var sel = pm.grid.getSelectionModel().getSelected();\n options.params['query[project_member_of]'] = sel.data.id; \n switch(_this.grid.filter) {\n case 'S': // staff\n options.params.company_id_comptype='OWNER';\n\n break;\n case 'O': // owner..\n options.params.company_id = sel.data.client_id;\n break;\n case 'A': // not owner or staff..\n options.params['!company_id'] = sel.data.client_id;\n options.params['!company_id_comptype'] ='OWNER';\n break; \n }\n \n}" - }, - "*prop": "dataSource", - "remoteSort": true, - "xtype": "Store", - "|sortInfo": "{ field : 'name', direction: 'ASC' }", - "|xns": "Roo.data", - "items": [ - { - "*prop": "proxy", - "xtype": "HttpProxy", - "method": "GET", - "|url": "baseURL + '/Roo/Person.php'", - "|xns": "Roo.data" - }, - { - "|xns": "Roo.data", - "xtype": "JsonReader", - "totalProperty": "total", - "root": "data", - "*prop": "reader", - "id": "id", - "|fields": "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'office_id',\n 'type': 'int'\n },\n {\n 'name': 'name',\n 'type': 'string'\n },\n {\n 'name': 'phone',\n 'type': 'string'\n },\n {\n 'name': 'fax',\n 'type': 'string'\n },\n {\n 'name': 'email',\n 'type': 'string'\n },\n {\n 'name': 'company_id',\n 'type': 'int'\n },\n {\n 'name': 'role',\n 'type': 'string'\n },\n {\n 'name': 'active',\n 'type': 'int'\n },\n {\n 'name': 'remarks',\n 'type': 'string'\n },\n {\n 'name': 'passwd',\n 'type': 'string'\n },\n {\n 'name': 'owner_id',\n 'type': 'int'\n },\n {\n 'name': 'lang',\n 'type': 'string'\n },\n {\n 'name': 'no_reset_sent',\n 'type': 'int'\n },\n {\n 'name': 'action_type',\n 'type': 'string'\n },\n {\n 'name': 'project_id',\n 'type': 'int'\n },\n {\n 'name': 'office_id_id',\n 'type': 'int'\n },\n {\n 'name': 'office_id_company_id',\n 'type': 'int'\n },\n {\n 'name': 'office_id_name',\n 'type': 'string'\n },\n {\n 'name': 'office_id_address',\n 'type': 'string'\n },\n {\n 'name': 'office_id_phone',\n 'type': 'string'\n },\n {\n 'name': 'office_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'office_id_email',\n 'type': 'string'\n },\n {\n 'name': 'office_id_role',\n 'type': 'string'\n },\n {\n 'name': 'company_id_code',\n 'type': 'string'\n },\n {\n 'name': 'company_id_name',\n 'type': 'string'\n },\n {\n 'name': 'company_id_remarks',\n 'type': 'string'\n },\n {\n 'name': 'company_id_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'company_id_address',\n 'type': 'string'\n },\n {\n 'name': 'company_id_tel',\n 'type': 'string'\n },\n {\n 'name': 'company_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'company_id_email',\n 'type': 'string'\n },\n {\n 'name': 'company_id_id',\n 'type': 'int'\n },\n {\n 'name': 'company_id_isOwner',\n 'type': 'int'\n },\n {\n 'name': 'company_id_logo_id',\n 'type': 'int'\n },\n {\n 'name': 'company_id_background_color',\n 'type': 'string'\n },\n {\n 'name': 'company_id_comptype',\n 'type': 'string'\n },\n {\n 'name': 'company_id_url',\n 'type': 'string'\n },\n {\n 'name': 'company_id_main_office_id',\n 'type': 'int'\n },\n {\n 'name': 'company_id_created_by',\n 'type': 'int'\n },\n {\n 'name': 'company_id_created_dt',\n 'type': 'date'\n },\n {\n 'name': 'company_id_updated_by',\n 'type': 'int'\n },\n {\n 'name': 'company_id_updated_dt',\n 'type': 'date'\n },\n {\n 'name': 'company_id_passwd',\n 'type': 'string'\n },\n {\n 'name': 'project_id_id',\n 'type': 'int'\n },\n {\n 'name': 'project_id_name',\n 'type': 'string'\n },\n {\n 'name': 'project_id_remarks',\n 'type': 'string'\n },\n {\n 'name': 'project_id_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'project_id_code',\n 'type': 'string'\n },\n {\n 'name': 'project_id_active',\n 'type': 'int'\n },\n {\n 'name': 'project_id_type',\n 'type': 'string'\n },\n {\n 'name': 'project_id_client_id',\n 'type': 'int'\n },\n {\n 'name': 'project_id_team_id',\n 'type': 'int'\n },\n {\n 'name': 'project_id_file_location',\n 'type': 'string'\n },\n {\n 'name': 'project_id_open_date',\n 'type': 'date'\n },\n {\n 'name': 'project_id_open_by',\n 'type': 'int'\n },\n {\n 'name': 'project_id_close_date',\n 'type': 'date'\n },\n {\n 'name': 'project_id_countries',\n 'type': 'string'\n },\n {\n 'name': 'project_id_languages',\n 'type': 'string'\n },\n {\n 'name': 'project_id_agency_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_office_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_name',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_phone',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_email',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_company_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_role',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_active',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_remarks',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_passwd',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_lang',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_no_reset_sent',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_action_type',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_project_id',\n 'type': 'int'\n }\n]" - } - ] - }, - { - "*prop": "footer", - "displayInfo": true, - "displayMsg": " ", - "emptyMsg": "No Person found", - "pageSize": 25, - "xtype": "PagingToolbar", - "|xns": "Roo" - }, - { - "*prop": "toolbar", - "xtype": "Toolbar", - "|xns": "Roo", - "items": [ - { - "listeners": { - "toggle": "function (_self, pressed)\n{\n if (pressed) {\n _this.grid.filter = 'S';\n }\n _this.grid.footer.onClick('first');\n}" - }, - "enableToggle": true, - "pressed": true, - "text": "Staff", - "toggleGroup": "appm", - "xtype": "Button", - "|xns": "Roo.Toolbar" - }, - { - "listeners": { - "toggle": "function (_self, pressed)\n{\n if (pressed) {\n _this.grid.filter = 'O';\n }\n _this.grid.footer.onClick('first');\n}" - }, - "enableToggle": true, - "text": "Owners", - "toggleGroup": "appm", - "xtype": "Button", - "|xns": "Roo.Toolbar" - }, - { - "listeners": { - "toggle": "function (_self, pressed)\n{\n if (pressed) {\n _this.grid.filter = 'A';\n }\n _this.grid.footer.onClick('first');\n}" - }, - "enableToggle": true, - "text": "Other", - "toggleGroup": "appm", - "xtype": "Button", - "|xns": "Roo.Toolbar" - }, - { - "|xns": "Roo.Toolbar", - "xtype": "Fill" - }, - { - "listeners": { - "toggle": "function (_self, pressed)\n{\n \n _this.grid.footer.onClick('first');\n}", - "render": "function (_self)\n{\n _this.memberBtn = _self;\n}" - }, - "enableToggle": true, - "text": "Members", - "xtype": "Button", - "|xns": "Roo.Toolbar" - } - ] - }, - { - "*prop": "colModel[]", - "dataIndex": "is_member", - "header": "Member", - "width": 60, - "xtype": "ColumnModel", - "|renderer": "function(v) { return String.format('{0}', v); }", - "|xns": "Roo.grid" - }, - { - "*prop": "colModel[]", - "dataIndex": "name", - "header": "Name", - "sortable": true, - "width": 200, - "xtype": "ColumnModel", - "|renderer": "function(v) { return String.format('{0}', v); }", - "|xns": "Roo.grid" - }, - { - "*prop": "colModel[]", - "dataIndex": "email", - "header": "Email", - "width": 100, - "xtype": "ColumnModel", - "|renderer": "function(v) { return String.format('{0}', v); }", - "|xns": "Roo.grid", - "sortable": true, - "listeners": {} - }, - { - "*prop": "colModel[]", - "dataIndex": "company_id_name", - "header": "Company", - "sortable": true, - "width": 120, - "xtype": "ColumnModel", - "|renderer": "function(v) { return String.format('{0}', v); }", - "|xns": "Roo.grid" - } - ] - } - ] + "$ url" : "baseURL + '/Roo/Person.php'", + "method" : "GET", + "xtype" : "HttpProxy", + "$ xns" : "Roo.data", + "* prop" : "proxy" + }, + { + "id" : "id", + "root" : "data", + "xtype" : "JsonReader", + "$ xns" : "Roo.data", + "$ fields" : "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'office_id',\n 'type': 'int'\n },\n {\n 'name': 'name',\n 'type': 'string'\n },\n {\n 'name': 'phone',\n 'type': 'string'\n },\n {\n 'name': 'fax',\n 'type': 'string'\n },\n {\n 'name': 'email',\n 'type': 'string'\n },\n {\n 'name': 'company_id',\n 'type': 'int'\n },\n {\n 'name': 'role',\n 'type': 'string'\n },\n {\n 'name': 'active',\n 'type': 'int'\n },\n {\n 'name': 'remarks',\n 'type': 'string'\n },\n {\n 'name': 'passwd',\n 'type': 'string'\n },\n {\n 'name': 'owner_id',\n 'type': 'int'\n },\n {\n 'name': 'lang',\n 'type': 'string'\n },\n {\n 'name': 'no_reset_sent',\n 'type': 'int'\n },\n {\n 'name': 'action_type',\n 'type': 'string'\n },\n {\n 'name': 'project_id',\n 'type': 'int'\n },\n {\n 'name': 'office_id_id',\n 'type': 'int'\n },\n {\n 'name': 'office_id_company_id',\n 'type': 'int'\n },\n {\n 'name': 'office_id_name',\n 'type': 'string'\n },\n {\n 'name': 'office_id_address',\n 'type': 'string'\n },\n {\n 'name': 'office_id_phone',\n 'type': 'string'\n },\n {\n 'name': 'office_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'office_id_email',\n 'type': 'string'\n },\n {\n 'name': 'office_id_role',\n 'type': 'string'\n },\n {\n 'name': 'company_id_code',\n 'type': 'string'\n },\n {\n 'name': 'company_id_name',\n 'type': 'string'\n },\n {\n 'name': 'company_id_remarks',\n 'type': 'string'\n },\n {\n 'name': 'company_id_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'company_id_address',\n 'type': 'string'\n },\n {\n 'name': 'company_id_tel',\n 'type': 'string'\n },\n {\n 'name': 'company_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'company_id_email',\n 'type': 'string'\n },\n {\n 'name': 'company_id_id',\n 'type': 'int'\n },\n {\n 'name': 'company_id_isOwner',\n 'type': 'int'\n },\n {\n 'name': 'company_id_logo_id',\n 'type': 'int'\n },\n {\n 'name': 'company_id_background_color',\n 'type': 'string'\n },\n {\n 'name': 'company_id_comptype',\n 'type': 'string'\n },\n {\n 'name': 'company_id_url',\n 'type': 'string'\n },\n {\n 'name': 'company_id_main_office_id',\n 'type': 'int'\n },\n {\n 'name': 'company_id_created_by',\n 'type': 'int'\n },\n {\n 'name': 'company_id_created_dt',\n 'type': 'date'\n },\n {\n 'name': 'company_id_updated_by',\n 'type': 'int'\n },\n {\n 'name': 'company_id_updated_dt',\n 'type': 'date'\n },\n {\n 'name': 'company_id_passwd',\n 'type': 'string'\n },\n {\n 'name': 'project_id_id',\n 'type': 'int'\n },\n {\n 'name': 'project_id_name',\n 'type': 'string'\n },\n {\n 'name': 'project_id_remarks',\n 'type': 'string'\n },\n {\n 'name': 'project_id_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'project_id_code',\n 'type': 'string'\n },\n {\n 'name': 'project_id_active',\n 'type': 'int'\n },\n {\n 'name': 'project_id_type',\n 'type': 'string'\n },\n {\n 'name': 'project_id_client_id',\n 'type': 'int'\n },\n {\n 'name': 'project_id_team_id',\n 'type': 'int'\n },\n {\n 'name': 'project_id_file_location',\n 'type': 'string'\n },\n {\n 'name': 'project_id_open_date',\n 'type': 'date'\n },\n {\n 'name': 'project_id_open_by',\n 'type': 'int'\n },\n {\n 'name': 'project_id_close_date',\n 'type': 'date'\n },\n {\n 'name': 'project_id_countries',\n 'type': 'string'\n },\n {\n 'name': 'project_id_languages',\n 'type': 'string'\n },\n {\n 'name': 'project_id_agency_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_office_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_name',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_phone',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_email',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_company_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_role',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_active',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_remarks',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_passwd',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_lang',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_no_reset_sent',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_action_type',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_project_id',\n 'type': 'int'\n }\n]", + "* prop" : "reader", + "totalProperty" : "total" + } + ] + }, + { + "pageSize" : 25, + "xtype" : "PagingToolbar", + "emptyMsg" : "No Person found", + "$ xns" : "Roo", + "displayMsg" : " ", + "displayInfo" : true, + "* prop" : "footer" + }, + { + "xtype" : "Toolbar", + "$ xns" : "Roo", + "* prop" : "toolbar", + "items" : [ + { + "listeners" : { + "toggle" : "function (_self, pressed)\n{\n if (pressed) {\n _this.grid.filter = 'S';\n }\n _this.grid.footer.onClick('first');\n}" + }, + "text" : "Staff", + "enableToggle" : true, + "toggleGroup" : "appm", + "pressed" : true, + "xtype" : "Button", + "$ xns" : "Roo.Toolbar" + }, + { + "listeners" : { + "toggle" : "function (_self, pressed)\n{\n if (pressed) {\n _this.grid.filter = 'O';\n }\n _this.grid.footer.onClick('first');\n}" + }, + "text" : "Owners", + "toggleGroup" : "appm", + "enableToggle" : true, + "xtype" : "Button", + "$ xns" : "Roo.Toolbar" + }, + { + "listeners" : { + "toggle" : "function (_self, pressed)\n{\n if (pressed) {\n _this.grid.filter = 'A';\n }\n _this.grid.footer.onClick('first');\n}" + }, + "text" : "Other", + "toggleGroup" : "appm", + "enableToggle" : true, + "xtype" : "Button", + "$ xns" : "Roo.Toolbar" + }, + { + "xtype" : "Fill", + "$ xns" : "Roo.Toolbar" + }, + { + "listeners" : { + "toggle" : "function (_self, pressed)\n{\n \n _this.grid.footer.onClick('first');\n}", + "render" : "function (_self)\n{\n _this.memberBtn = _self;\n}" + }, + "text" : "Members", + "enableToggle" : true, + "xtype" : "Button", + "$ xns" : "Roo.Toolbar" } - ], - "permname": "", - "modOrder": "001" + ] + }, + { + "xtype" : "ColumnModel", + "header" : "Member", + "width" : 60, + "$ renderer" : "function(v) { return String.format('{0}', v); }", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "is_member" + }, + { + "xtype" : "ColumnModel", + "sortable" : true, + "header" : "Name", + "width" : 200, + "$ renderer" : "function(v) { return String.format('{0}', v); }", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "name" + }, + { + "xtype" : "ColumnModel", + "sortable" : true, + "header" : "Email", + "width" : 100, + "$ renderer" : "function(v) { return String.format('{0}', v); }", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "email" + }, + { + "xtype" : "ColumnModel", + "sortable" : true, + "header" : "Company", + "width" : 120, + "$ renderer" : "function(v) { return String.format('{0}', v); }", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "company_id_name" + } + ] + } + ] + } + ] } \ No newline at end of file diff --git a/Pman.Tab.AdminProjectMembers.js b/Pman.Tab.AdminProjectMembers.js index 09c7c11..e0d2595 100644 --- a/Pman.Tab.AdminProjectMembers.js +++ b/Pman.Tab.AdminProjectMembers.js @@ -2,552 +2,568 @@ // Auto generated file - created by app.Builder.js- do not edit directly (at present!) +Roo.namespace('Pman.Tab'); +Pman.Tab.AdminProjectMembers = new Roo.XComponent({ -// register the module first -Pman.on('beforeload', function() -{ - Pman.register({ - modKey : '001-Pman.Tab.AdminProjectMembers', - module : Pman.Tab.AdminProjectMembers, - region : 'east', - parent : Pman.Tab.AdminProjectManager, - name : "Pman.Tab.AdminProjectMembers", - disabled : false, - permname: '' - }); -}); - -Pman.Tab.AdminProjectMembers = new Roo.util.Observable({ - - panel : false, - disabled : false, - parentLayout: false, - - add : function(parentLayout, region) - { - - var _this = this; - this.parentLayout = parentLayout; - - this.panel = parentLayout.addxtype({ - xtype: 'GridPanel', - xns: Roo, - listeners : { - activate : function() { - _this.panel = this; - if (_this.grid) { - _this.grid.footer.onClick('first'); - } - } - }, - background : true, - fitContainer : true, - fitToframe : true, - region : 'east', - tableName : 'Person', - title : "Person", - grid : { - xtype: 'Grid', - xns: Roo.grid, - 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), function() { - _this.grid.footer.onClick('first'); - }); - } - }, - filter : 'S', - autoExpandColumn : 'name', - loadMask : true, - dataSource : { - xtype: 'Store', - xns: Roo.data, - listeners : { - beforeload : function (_self, options) - { - if (!_this.memberBtn) { - return false; - } - options.params['query[project_member_filter]'] = _this.memberBtn.pressed ? 1 :0; - var pm = Pman ? Pman.Tab.AdminProjectManager :false; - if (!pm || !pm.grid || !pm.grid.getSelectionModel().getSelected()) { - return false; - } - var sel = pm.grid.getSelectionModel().getSelected(); - options.params['query[project_member_of]'] = sel.data.id; - switch(_this.grid.filter) { - case 'S': // staff - options.params.company_id_comptype='OWNER'; - - break; - case 'O': // owner.. - options.params.company_id = sel.data.client_id; - break; - case 'A': // not owner or staff.. - options.params['!company_id'] = sel.data.client_id; - options.params['!company_id_comptype'] ='OWNER'; - break; - } - - } - }, - remoteSort : true, - sortInfo : { field : 'name', direction: 'ASC' }, - proxy : { - xtype: 'HttpProxy', - xns: Roo.data, - method : 'GET', - url : baseURL + '/Roo/Person.php' - }, - reader : { - xtype: 'JsonReader', - xns: Roo.data, - totalProperty : 'total', - root : 'data', - id : 'id', - fields : [ - { - 'name': 'id', - 'type': 'int' - }, - { - 'name': 'office_id', - 'type': 'int' - }, - { - 'name': 'name', - 'type': 'string' - }, - { - 'name': 'phone', - 'type': 'string' - }, - { - 'name': 'fax', - 'type': 'string' - }, - { - 'name': 'email', - 'type': 'string' - }, - { - 'name': 'company_id', - 'type': 'int' - }, - { - 'name': 'role', - 'type': 'string' - }, - { - 'name': 'active', - 'type': 'int' - }, - { - 'name': 'remarks', - 'type': 'string' - }, - { - 'name': 'passwd', - 'type': 'string' - }, - { - 'name': 'owner_id', - 'type': 'int' - }, - { - 'name': 'lang', - 'type': 'string' - }, - { - 'name': 'no_reset_sent', - 'type': 'int' - }, - { - 'name': 'action_type', - 'type': 'string' - }, - { - 'name': 'project_id', - 'type': 'int' - }, - { - 'name': 'office_id_id', - 'type': 'int' - }, - { - 'name': 'office_id_company_id', - 'type': 'int' - }, - { - 'name': 'office_id_name', - 'type': 'string' - }, - { - 'name': 'office_id_address', - 'type': 'string' - }, - { - 'name': 'office_id_phone', - 'type': 'string' - }, - { - 'name': 'office_id_fax', - 'type': 'string' - }, - { - 'name': 'office_id_email', - 'type': 'string' - }, - { - 'name': 'office_id_role', - 'type': 'string' - }, - { - 'name': 'company_id_code', - 'type': 'string' - }, - { - 'name': 'company_id_name', - 'type': 'string' - }, - { - 'name': 'company_id_remarks', - 'type': 'string' - }, - { - 'name': 'company_id_owner_id', - 'type': 'int' - }, - { - 'name': 'company_id_address', - 'type': 'string' - }, - { - 'name': 'company_id_tel', - 'type': 'string' - }, - { - 'name': 'company_id_fax', - 'type': 'string' - }, - { - 'name': 'company_id_email', - 'type': 'string' - }, - { - 'name': 'company_id_id', - 'type': 'int' - }, - { - 'name': 'company_id_isOwner', - 'type': 'int' - }, - { - 'name': 'company_id_logo_id', - 'type': 'int' - }, - { - 'name': 'company_id_background_color', - 'type': 'string' - }, - { - 'name': 'company_id_comptype', - 'type': 'string' - }, - { - 'name': 'company_id_url', - 'type': 'string' - }, - { - 'name': 'company_id_main_office_id', - 'type': 'int' - }, - { - 'name': 'company_id_created_by', - 'type': 'int' - }, - { - 'name': 'company_id_created_dt', - 'type': 'date' - }, - { - 'name': 'company_id_updated_by', - 'type': 'int' - }, - { - 'name': 'company_id_updated_dt', - 'type': 'date' - }, - { - 'name': 'company_id_passwd', - 'type': 'string' - }, - { - 'name': 'project_id_id', - 'type': 'int' - }, - { - 'name': 'project_id_name', - 'type': 'string' - }, - { - 'name': 'project_id_remarks', - 'type': 'string' - }, - { - 'name': 'project_id_owner_id', - 'type': 'int' - }, - { - 'name': 'project_id_code', - 'type': 'string' - }, - { - 'name': 'project_id_active', - 'type': 'int' - }, - { - 'name': 'project_id_type', - 'type': 'string' - }, - { - 'name': 'project_id_client_id', - 'type': 'int' - }, - { - 'name': 'project_id_team_id', - 'type': 'int' - }, - { - 'name': 'project_id_file_location', - 'type': 'string' - }, - { - 'name': 'project_id_open_date', - 'type': 'date' - }, - { - 'name': 'project_id_open_by', - 'type': 'int' - }, - { - 'name': 'project_id_close_date', - 'type': 'date' - }, - { - 'name': 'project_id_countries', - 'type': 'string' - }, - { - 'name': 'project_id_languages', - 'type': 'string' - }, - { - 'name': 'project_id_agency_id', - 'type': 'int' - }, - { - 'name': 'owner_id_id', - 'type': 'int' - }, - { - 'name': 'owner_id_office_id', - 'type': 'int' - }, - { - 'name': 'owner_id_name', - 'type': 'string' - }, - { - 'name': 'owner_id_phone', - 'type': 'string' - }, - { - 'name': 'owner_id_fax', - 'type': 'string' - }, - { - 'name': 'owner_id_email', - 'type': 'string' - }, - { - 'name': 'owner_id_company_id', - 'type': 'int' - }, - { - 'name': 'owner_id_role', - 'type': 'string' - }, - { - 'name': 'owner_id_active', - 'type': 'int' - }, - { - 'name': 'owner_id_remarks', - 'type': 'string' - }, - { - 'name': 'owner_id_passwd', - 'type': 'string' - }, - { - 'name': 'owner_id_owner_id', - 'type': 'int' - }, - { - 'name': 'owner_id_lang', - 'type': 'string' - }, - { - 'name': 'owner_id_no_reset_sent', - 'type': 'int' - }, - { - 'name': 'owner_id_action_type', - 'type': 'string' - }, - { - 'name': 'owner_id_project_id', - 'type': 'int' - } - ] - } - }, - footer : { - xtype: 'PagingToolbar', - xns: Roo, - displayInfo : true, - displayMsg : ' ', - emptyMsg : 'No Person found', - pageSize : 25 - }, - toolbar : { - xtype: 'Toolbar', - xns: Roo, - items : [ - { - xtype: 'Button', - xns: Roo.Toolbar, - listeners : { - toggle : function (_self, pressed) - { - if (pressed) { - _this.grid.filter = 'S'; - } - _this.grid.footer.onClick('first'); - } - }, - enableToggle : true, - pressed : true, - text : "Staff", - toggleGroup : 'appm' - }, - { - xtype: 'Button', - xns: Roo.Toolbar, - listeners : { - toggle : function (_self, pressed) - { - if (pressed) { - _this.grid.filter = 'O'; - } - _this.grid.footer.onClick('first'); - } - }, - enableToggle : true, - text : "Owners", - toggleGroup : 'appm' - }, - { - xtype: 'Button', - xns: Roo.Toolbar, - listeners : { - toggle : function (_self, pressed) - { - if (pressed) { - _this.grid.filter = 'A'; - } - _this.grid.footer.onClick('first'); - } - }, - enableToggle : true, - text : "Other", - toggleGroup : 'appm' - }, - { - xtype: 'Fill', - xns: Roo.Toolbar - }, - { - xtype: 'Button', - xns: Roo.Toolbar, - listeners : { - toggle : function (_self, pressed) - { - - _this.grid.footer.onClick('first'); - }, - render : function (_self) - { - _this.memberBtn = _self; - } - }, - enableToggle : true, - text : "Members" - } - ] - }, - colModel : [ - { - xtype: 'ColumnModel', - xns: Roo.grid, - dataIndex : 'is_member', - header : 'Member', - width : 60, - renderer : function(v) { return String.format('{0}', v); } - }, - { - xtype: 'ColumnModel', - xns: Roo.grid, - dataIndex : 'name', - header : 'Name', - sortable : true, - width : 200, - renderer : function(v) { return String.format('{0}', v); } - }, - { - xtype: 'ColumnModel', - xns: Roo.grid, - dataIndex : 'email', - header : 'Email', - width : 100, - renderer : function(v) { return String.format('{0}', v); }, - sortable : true - }, - { - xtype: 'ColumnModel', - xns: Roo.grid, - dataIndex : 'company_id_name', - header : 'Company', - sortable : true, - width : 120, - renderer : function(v) { return String.format('{0}', v); } - } - ] - } - }); - this.layout = this.panel.layout; + _strings : { + '858ba4765e53c712ef672a9570474b1d' :"Member", + 'ce8ae9da5b7cd6c3df2929543a9af92d' :"Email", + '1c76cbfe21c6f44c1d1e59d54f3e4420' :"Company", + '7cdc93ea9b163a546146172299bb0b38' :"Owners", + 'ef53538ae41a651c7f72ab6cb1135d8c' :"Members", + '8f7f93630c366dc55aec88eb8e9640d0' :"Staff", + '6311ae17c1ee52b36e68aaf4ad066387' :"Other", + '40bed7cf9b3d4bb3a3d7a7e3eb18c5eb' :"Person", + 'f1174ecbbc232f948717979daf04cf08' :"No Person found", + '49ee3087348e8d44e1feda1917443987' :"Name", + 'd41d8cd98f00b204e9800998ecf8427e' :" " + }, - } + part : ["Admin", "ProjectMembers" ], + order : '001-Pman.Tab.AdminProjectMembers', + region : 'center', + parent : 'Pman.Tab.AdminProjectManager', + name : "Pman.Tab.AdminProjectMembers", + disabled : false, + permname : '', + _tree : function() + { + var _this = this; + var MODULE = this; + return { + background : true, + fitContainer : true, + fitToframe : true, + region : 'east', + tableName : 'Person', + title : _this._strings['40bed7cf9b3d4bb3a3d7a7e3eb18c5eb'] /* Person */, + xns : Roo, + '|xns' : 'Roo', + xtype : 'GridPanel', + listeners : { + activate : function() { + _this.panel = this; + if (_this.grid) { + _this.grid.footer.onClick('first'); + } + } + }, + grid : { + autoExpandColumn : 'name', + filter : 'S', + 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'); + } + }, + rowdblclick : function (_self, rowIndex, e) + { + if (!_this.dialog) { + return; + } + _this.dialog.show( this.getDataSource().getAt(rowIndex), function() { + _this.grid.footer.onClick('first'); + }); + } + }, + footer : { + displayInfo : true, + displayMsg : _this._strings['d41d8cd98f00b204e9800998ecf8427e'] /* */, + emptyMsg : _this._strings['f1174ecbbc232f948717979daf04cf08'] /* No Person found */, + pageSize : 25, + xns : Roo, + '|xns' : 'Roo', + xtype : 'PagingToolbar' + }, + toolbar : { + xns : Roo, + '|xns' : 'Roo', + xtype : 'Toolbar', + items : [ + { + enableToggle : true, + pressed : true, + text : _this._strings['8f7f93630c366dc55aec88eb8e9640d0'] /* Staff */, + toggleGroup : 'appm', + xns : Roo.Toolbar, + '|xns' : 'Roo.Toolbar', + xtype : 'Button', + listeners : { + toggle : function (_self, pressed) + { + if (pressed) { + _this.grid.filter = 'S'; + } + _this.grid.footer.onClick('first'); + } + } + }, + { + enableToggle : true, + text : _this._strings['7cdc93ea9b163a546146172299bb0b38'] /* Owners */, + toggleGroup : 'appm', + xns : Roo.Toolbar, + '|xns' : 'Roo.Toolbar', + xtype : 'Button', + listeners : { + toggle : function (_self, pressed) + { + if (pressed) { + _this.grid.filter = 'O'; + } + _this.grid.footer.onClick('first'); + } + } + }, + { + enableToggle : true, + text : _this._strings['6311ae17c1ee52b36e68aaf4ad066387'] /* Other */, + toggleGroup : 'appm', + xns : Roo.Toolbar, + '|xns' : 'Roo.Toolbar', + xtype : 'Button', + listeners : { + toggle : function (_self, pressed) + { + if (pressed) { + _this.grid.filter = 'A'; + } + _this.grid.footer.onClick('first'); + } + } + }, + { + xns : Roo.Toolbar, + '|xns' : 'Roo.Toolbar', + xtype : 'Fill' + }, + { + enableToggle : true, + text : _this._strings['ef53538ae41a651c7f72ab6cb1135d8c'] /* Members */, + xns : Roo.Toolbar, + '|xns' : 'Roo.Toolbar', + xtype : 'Button', + listeners : { + render : function (_self) + { + _this.memberBtn = _self; + }, + toggle : function (_self, pressed) + { + + _this.grid.footer.onClick('first'); + } + } + } + ] + }, + dataSource : { + remoteSort : true, + sortInfo : { field : 'name', direction: 'ASC' }, + xns : Roo.data, + '|xns' : 'Roo.data', + xtype : 'Store', + listeners : { + beforeload : function (_self, options) + { + if (!_this.memberBtn) { + return false; + } + options.params['query[project_member_filter]'] = _this.memberBtn.pressed ? 1 :0; + var pm = Pman ? Pman.Tab.AdminProjectManager :false; + if (!pm || !pm.grid || !pm.grid.getSelectionModel().getSelected()) { + return false; + } + var sel = pm.grid.getSelectionModel().getSelected(); + options.params['query[project_member_of]'] = sel.data.id; + switch(_this.grid.filter) { + case 'S': // staff + options.params.company_id_comptype='OWNER'; + + break; + case 'O': // owner.. + options.params.company_id = sel.data.client_id; + break; + case 'A': // not owner or staff.. + options.params['!company_id'] = sel.data.client_id; + options.params['!company_id_comptype'] ='OWNER'; + break; + } + + } + }, + proxy : { + method : 'GET', + url : baseURL + '/Roo/Person.php', + xns : Roo.data, + '|xns' : 'Roo.data', + xtype : 'HttpProxy' + }, + reader : { + fields : [ + { + 'name': 'id', + 'type': 'int' + }, + { + 'name': 'office_id', + 'type': 'int' + }, + { + 'name': 'name', + 'type': 'string' + }, + { + 'name': 'phone', + 'type': 'string' + }, + { + 'name': 'fax', + 'type': 'string' + }, + { + 'name': 'email', + 'type': 'string' + }, + { + 'name': 'company_id', + 'type': 'int' + }, + { + 'name': 'role', + 'type': 'string' + }, + { + 'name': 'active', + 'type': 'int' + }, + { + 'name': 'remarks', + 'type': 'string' + }, + { + 'name': 'passwd', + 'type': 'string' + }, + { + 'name': 'owner_id', + 'type': 'int' + }, + { + 'name': 'lang', + 'type': 'string' + }, + { + 'name': 'no_reset_sent', + 'type': 'int' + }, + { + 'name': 'action_type', + 'type': 'string' + }, + { + 'name': 'project_id', + 'type': 'int' + }, + { + 'name': 'office_id_id', + 'type': 'int' + }, + { + 'name': 'office_id_company_id', + 'type': 'int' + }, + { + 'name': 'office_id_name', + 'type': 'string' + }, + { + 'name': 'office_id_address', + 'type': 'string' + }, + { + 'name': 'office_id_phone', + 'type': 'string' + }, + { + 'name': 'office_id_fax', + 'type': 'string' + }, + { + 'name': 'office_id_email', + 'type': 'string' + }, + { + 'name': 'office_id_role', + 'type': 'string' + }, + { + 'name': 'company_id_code', + 'type': 'string' + }, + { + 'name': 'company_id_name', + 'type': 'string' + }, + { + 'name': 'company_id_remarks', + 'type': 'string' + }, + { + 'name': 'company_id_owner_id', + 'type': 'int' + }, + { + 'name': 'company_id_address', + 'type': 'string' + }, + { + 'name': 'company_id_tel', + 'type': 'string' + }, + { + 'name': 'company_id_fax', + 'type': 'string' + }, + { + 'name': 'company_id_email', + 'type': 'string' + }, + { + 'name': 'company_id_id', + 'type': 'int' + }, + { + 'name': 'company_id_isOwner', + 'type': 'int' + }, + { + 'name': 'company_id_logo_id', + 'type': 'int' + }, + { + 'name': 'company_id_background_color', + 'type': 'string' + }, + { + 'name': 'company_id_comptype', + 'type': 'string' + }, + { + 'name': 'company_id_url', + 'type': 'string' + }, + { + 'name': 'company_id_main_office_id', + 'type': 'int' + }, + { + 'name': 'company_id_created_by', + 'type': 'int' + }, + { + 'name': 'company_id_created_dt', + 'type': 'date' + }, + { + 'name': 'company_id_updated_by', + 'type': 'int' + }, + { + 'name': 'company_id_updated_dt', + 'type': 'date' + }, + { + 'name': 'company_id_passwd', + 'type': 'string' + }, + { + 'name': 'project_id_id', + 'type': 'int' + }, + { + 'name': 'project_id_name', + 'type': 'string' + }, + { + 'name': 'project_id_remarks', + 'type': 'string' + }, + { + 'name': 'project_id_owner_id', + 'type': 'int' + }, + { + 'name': 'project_id_code', + 'type': 'string' + }, + { + 'name': 'project_id_active', + 'type': 'int' + }, + { + 'name': 'project_id_type', + 'type': 'string' + }, + { + 'name': 'project_id_client_id', + 'type': 'int' + }, + { + 'name': 'project_id_team_id', + 'type': 'int' + }, + { + 'name': 'project_id_file_location', + 'type': 'string' + }, + { + 'name': 'project_id_open_date', + 'type': 'date' + }, + { + 'name': 'project_id_open_by', + 'type': 'int' + }, + { + 'name': 'project_id_close_date', + 'type': 'date' + }, + { + 'name': 'project_id_countries', + 'type': 'string' + }, + { + 'name': 'project_id_languages', + 'type': 'string' + }, + { + 'name': 'project_id_agency_id', + 'type': 'int' + }, + { + 'name': 'owner_id_id', + 'type': 'int' + }, + { + 'name': 'owner_id_office_id', + 'type': 'int' + }, + { + 'name': 'owner_id_name', + 'type': 'string' + }, + { + 'name': 'owner_id_phone', + 'type': 'string' + }, + { + 'name': 'owner_id_fax', + 'type': 'string' + }, + { + 'name': 'owner_id_email', + 'type': 'string' + }, + { + 'name': 'owner_id_company_id', + 'type': 'int' + }, + { + 'name': 'owner_id_role', + 'type': 'string' + }, + { + 'name': 'owner_id_active', + 'type': 'int' + }, + { + 'name': 'owner_id_remarks', + 'type': 'string' + }, + { + 'name': 'owner_id_passwd', + 'type': 'string' + }, + { + 'name': 'owner_id_owner_id', + 'type': 'int' + }, + { + 'name': 'owner_id_lang', + 'type': 'string' + }, + { + 'name': 'owner_id_no_reset_sent', + 'type': 'int' + }, + { + 'name': 'owner_id_action_type', + 'type': 'string' + }, + { + 'name': 'owner_id_project_id', + 'type': 'int' + } + ], + id : 'id', + root : 'data', + totalProperty : 'total', + xns : Roo.data, + '|xns' : 'Roo.data', + xtype : 'JsonReader' + } + }, + colModel : [ + { + dataIndex : 'is_member', + header : _this._strings['858ba4765e53c712ef672a9570474b1d'] /* Member */, + renderer : function(v) { return String.format('{0}', v); }, + width : 60, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' + }, + { + dataIndex : 'name', + header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */, + renderer : function(v) { return String.format('{0}', v); }, + sortable : true, + width : 200, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' + }, + { + dataIndex : 'email', + header : _this._strings['ce8ae9da5b7cd6c3df2929543a9af92d'] /* Email */, + renderer : function(v) { return String.format('{0}', v); }, + sortable : true, + width : 100, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' + }, + { + dataIndex : 'company_id_name', + header : _this._strings['1c76cbfe21c6f44c1d1e59d54f3e4420'] /* Company */, + renderer : function(v) { return String.format('{0}', v); }, + sortable : true, + width : 120, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' + } + ] + } + }; } }); diff --git a/Pman.Tab.AdminWatches.bjs b/Pman.Tab.AdminWatches.bjs index acf0315..4141dc4 100644 --- a/Pman.Tab.AdminWatches.bjs +++ b/Pman.Tab.AdminWatches.bjs @@ -1,223 +1,239 @@ { - "id": "roo-file-237", - "name": "Pman.Tab.AdminWatches", - "parent": "Pman.Tab.AdminWatchNotify", - "title": "Pman.Tab.AdminWatches", - "path": "/home/alan/gitlive/Pman.Admin/Pman.Tab.AdminWatches.bjs", - "items": [ + "name" : "Pman.Tab.AdminWatches", + "parent" : "Pman.Tab.AdminWatchNotify", + "title" : "Pman.Tab.AdminWatches", + "path" : "/home/alan/gitlive/Pman.Admin/Pman.Tab.AdminWatches.bjs", + "permname" : "", + "modOrder" : "860", + "strings" : { + "ec211f7c20af43e742bf2570c3cb84f9" : "Add", + "1a86349be7851cf03d6fe959b94ed6fb" : "Watch ID", + "1243daf593fa297e07ab03bf06d925af" : "Searching...", + "c4523f19258f444b936df7f96f57c7b9" : "Watch Table", + "498f79c4c5bbde77f1bceb6c86fd0f6d" : "Show", + "56abc507eda6d3226af192bf9b0e5d1f" : "What happens", + "5e97bbccf01aa772225ef15435177395" : "(function() {Roo.log('title') ;Roo.log(_this); return _this.title || \"Watches\"; })()", + "a4e70e911022ccc98ab8055a09222cf2" : "No core_watch found", + "a8929eb5c1553d3f70497f862d25d0ce" : "Select Action", + "b548a2ee926c118cc3211c5d8bb92a40" : "Who get's notified", + "6ceb94ff48a58bd6d612b1f031d2c2ca" : "Displaying core_watch{0} - {1} of {2}", + "c122d95a9c28f9a54baef2c7784bb038" : "Watch Event", + "f2a6c498fb90ee345d997f888fce3b18" : "Delete", + "4d3d769b812b6faa6b76e1a8abaece2d" : "Active", + "314b26dabb519a609db698728284683f" : "Select Table" + }, + "items" : [ + { + "listeners" : { + "|activate" : "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}" + }, + "autoScroll" : false, + "background" : true, + "fitToframe" : true, + "region" : "center", + "xtype" : "GridPanel", + "| title" : "(function() {Roo.log('title') ;Roo.log(_this); return _this.title || \"Watches\"; })()", + "fitContainer" : true, + "$ xns" : "Roo", + "tableName" : "core_watch", + "items" : [ + { + "listeners" : { + "|rowdblclick" : "function (_self, rowIndex, e)\n{\n if (!_this.dialog) {\n return;\n }\n _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {\n _this.grid.footer.onClick('first');\n }); \n}\n", + "|render" : "function() \n{\n _this.grid = this; \n _this.dialog = Pman.Dialog.AdminWatch;\n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}" + }, + "autoExpandColumn" : "person_id_name", + "xtype" : "Grid", + "loadMask" : true, + "$ xns" : "Roo.grid", + "* prop" : "grid", + "items" : [ + { + "listeners" : { + "beforeload" : "function (_self, options)\n{\n var val = _this.affectSel.getValue();\n if (val.length) {\n options.params.ontable = val;\n }\n if (_this.requestArgs) { \n Roo.apply(options.params, _this.requestArgs);\n }\n \n}" + }, + "xtype" : "Store", + "remoteSort" : true, + "$ sortInfo" : "{ field : 'ontable', direction: 'ASC' }", + "$ xns" : "Roo.data", + "* prop" : "dataSource", + "items" : [ { - "listeners": { - "|activate": "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}" + "$ url" : "baseURL + '/Roo/core_watch.php'", + "method" : "GET", + "xtype" : "HttpProxy", + "$ xns" : "Roo.data", + "* prop" : "proxy" + }, + { + "id" : "id", + "root" : "data", + "xtype" : "JsonReader", + "$ xns" : "Roo.data", + "$ fields" : "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'ontable',\n 'type': 'string'\n },\n {\n 'name': 'onid',\n 'type': 'int'\n },\n {\n 'name': 'person_id',\n 'type': 'int'\n },\n {\n 'name': 'event',\n 'type': 'string'\n },\n {\n 'name': 'medium',\n 'type': 'string'\n },\n {\n 'name': 'active',\n 'type': 'int'\n },\n {\n 'name': 'person_id_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_office_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_name',\n 'type': 'string'\n },\n {\n 'name': 'person_id_phone',\n 'type': 'string'\n },\n {\n 'name': 'person_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'person_id_email',\n 'type': 'string'\n },\n {\n 'name': 'person_id_company_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_role',\n 'type': 'string'\n },\n {\n 'name': 'person_id_active',\n 'type': 'int'\n },\n {\n 'name': 'person_id_remarks',\n 'type': 'string'\n },\n {\n 'name': 'person_id_passwd',\n 'type': 'string'\n },\n {\n 'name': 'person_id_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_lang',\n 'type': 'string'\n },\n {\n 'name': 'person_id_no_reset_sent',\n 'type': 'int'\n },\n {\n 'name': 'person_id_action_type',\n 'type': 'string'\n },\n {\n 'name': 'person_id_project_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_deleted_by',\n 'type': 'int'\n },\n {\n 'name': 'person_id_deleted_dt',\n 'type': 'date'\n }\n]", + "* prop" : "reader", + "totalProperty" : "total" + } + ] + }, + { + "pageSize" : 25, + "xtype" : "PagingToolbar", + "emptyMsg" : "No core_watch found", + "$ xns" : "Roo", + "displayInfo" : true, + "displayMsg" : "Displaying core_watch{0} - {1} of {2}", + "* prop" : "footer" + }, + { + "xtype" : "Toolbar", + "$ xns" : "Roo", + "* prop" : "toolbar", + "items" : [ + { + "text" : "Show", + "xtype" : "TextItem", + "$ xns" : "Roo.Toolbar" + }, + { + "listeners" : { + "|render" : "function (_self)\n{\n _this.affectSel = _self;\n}", + "|select" : "function (combo, record, index)\n{\n _this.grid.footer.onClick('first');\n}" + }, + "listWidth" : 300, + "triggerAction" : "all", + "forceSelection" : true, + "selectOnFocus" : true, + "pageSize" : 20, + "displayField" : "on_table", + "emptyText" : "Select Table", + "minChars" : 2, + "valueField" : "on_table", + "xtype" : "ComboBox", + "allowBlank" : true, + "typeAhead" : true, + "editable" : false, + "width" : 150, + "$ xns" : "Roo.form", + "name" : "ontable", + "qtip" : "Select Action", + "queryParam" : "query[ontable]", + "tpl" : "
{on_table}
", + "loadingText" : "Searching...", + "items" : [ + { + "listeners" : { + "|beforeload" : "function (_self, o)\n{\n o.params = o.params || {};\n // staff can see all logs, other companies can only see their own.\n if (Pman.Login.authUser.company_id_comptype != 'OWNER') {\n o.params.company_id = Pman.Login.authUser.company_id;\n }\n o.params._distinct = 'on_table';\n o.params._columns ='on_table';\n}" + }, + "xtype" : "Store", + "remoteSort" : true, + "$ sortInfo" : "{ field : 'on_table' , direction : 'ASC' }", + "$ xns" : "Roo.data", + "* prop" : "store", + "items" : [ + { + "$ url" : "baseURL + '/Roo/Events.php'", + "xtype" : "HttpProxy", + "method" : "GET", + "$ xns" : "Roo.data", + "* prop" : "proxy" }, - "autoScroll": false, - "background": true, - "fitContainer": true, - "fitToframe": true, - "region": "center", - "tableName": "core_watch", - "xtype": "GridPanel", - "|title": "(function() {Roo.log('title') ;Roo.log(_this); return _this.title || \"Watches\"; })()", - "|xns": "Roo", - "items": [ - { - "listeners": { - "|render": "function() \n{\n _this.grid = this; \n _this.dialog = Pman.Dialog.AdminWatch;\n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}", - "|rowdblclick": "function (_self, rowIndex, e)\n{\n if (!_this.dialog) return;\n _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {\n _this.grid.footer.onClick('first');\n }); \n}\n" - }, - "*prop": "grid", - "autoExpandColumn": "person_id_name", - "loadMask": true, - "xtype": "Grid", - "|xns": "Roo.grid", - "items": [ - { - "listeners": { - "beforeload": "function (_self, options)\n{\n var val = _this.affectSel.getValue();\n if (val.length) {\n options.params.ontable = val;\n }\n if (_this.requestArgs) { \n Roo.apply(options.params, _this.requestArgs);\n }\n \n}" - }, - "*prop": "dataSource", - "remoteSort": true, - "xtype": "Store", - "|sortInfo": "{ field : 'ontable', direction: 'ASC' }", - "|xns": "Roo.data", - "items": [ - { - "*prop": "proxy", - "xtype": "HttpProxy", - "method": "GET", - "|url": "baseURL + '/Roo/core_watch.php'", - "|xns": "Roo.data" - }, - { - "|xns": "Roo.data", - "xtype": "JsonReader", - "totalProperty": "total", - "root": "data", - "*prop": "reader", - "id": "id", - "|fields": "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'ontable',\n 'type': 'string'\n },\n {\n 'name': 'onid',\n 'type': 'int'\n },\n {\n 'name': 'person_id',\n 'type': 'int'\n },\n {\n 'name': 'event',\n 'type': 'string'\n },\n {\n 'name': 'medium',\n 'type': 'string'\n },\n {\n 'name': 'active',\n 'type': 'int'\n },\n {\n 'name': 'person_id_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_office_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_name',\n 'type': 'string'\n },\n {\n 'name': 'person_id_phone',\n 'type': 'string'\n },\n {\n 'name': 'person_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'person_id_email',\n 'type': 'string'\n },\n {\n 'name': 'person_id_company_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_role',\n 'type': 'string'\n },\n {\n 'name': 'person_id_active',\n 'type': 'int'\n },\n {\n 'name': 'person_id_remarks',\n 'type': 'string'\n },\n {\n 'name': 'person_id_passwd',\n 'type': 'string'\n },\n {\n 'name': 'person_id_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_lang',\n 'type': 'string'\n },\n {\n 'name': 'person_id_no_reset_sent',\n 'type': 'int'\n },\n {\n 'name': 'person_id_action_type',\n 'type': 'string'\n },\n {\n 'name': 'person_id_project_id',\n 'type': 'int'\n },\n {\n 'name': 'person_id_deleted_by',\n 'type': 'int'\n },\n {\n 'name': 'person_id_deleted_dt',\n 'type': 'date'\n }\n]" - } - ] - }, - { - "*prop": "footer", - "xtype": "PagingToolbar", - "pageSize": 25, - "displayInfo": true, - "displayMsg": "Displaying core_watch{0} - {1} of {2}", - "emptyMsg": "No core_watch found", - "|xns": "Roo" - }, - { - "*prop": "toolbar", - "xtype": "Toolbar", - "|xns": "Roo", - "items": [ - { - "text": "Show", - "xtype": "TextItem", - "|xns": "Roo.Toolbar" - }, - { - "listeners": { - "|select": "function (combo, record, index)\n{\n _this.grid.footer.onClick('first');\n}", - "|render": "function (_self)\n{\n _this.affectSel = _self;\n}" - }, - "allowBlank": true, - "displayField": "on_table", - "editable": false, - "emptyText": "Select Table", - "forceSelection": true, - "listWidth": 300, - "loadingText": "Searching...", - "minChars": 2, - "name": "ontable", - "pageSize": 20, - "qtip": "Select Action", - "queryParam": "query[ontable]", - "selectOnFocus": true, - "tpl": "
{on_table}
", - "triggerAction": "all", - "typeAhead": true, - "valueField": "on_table", - "width": 150, - "xtype": "ComboBox", - "|xns": "Roo.form", - "items": [ - { - "listeners": { - "|beforeload": "function (_self, o)\n{\n o.params = o.params || {};\n // staff can see all logs, other companies can only see their own.\n if (Pman.Login.authUser.company_id_comptype != 'OWNER') {\n o.params.company_id = Pman.Login.authUser.company_id;\n }\n o.params._distinct = 'on_table';\n o.params._columns ='on_table';\n}" - }, - "*prop": "store", - "remoteSort": true, - "xtype": "Store", - "|sortInfo": "{ field : 'on_table' , direction : 'ASC' }", - "|xns": "Roo.data", - "items": [ - { - "*prop": "proxy", - "method": "GET", - "xtype": "HttpProxy", - "|url": "baseURL + '/Roo/Events.php'", - "|xns": "Roo.data" - }, - { - "*prop": "reader", - "id": "id", - "root": "data", - "totalProperty": "total", - "xtype": "JsonReader", - "|fields": "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'on_table',\n 'type': 'string'\n }\n \n]", - "|xns": "Roo.data" - } - ] - } - ] - }, - { - "|xns": "Roo.Toolbar", - "xtype": "Fill" - }, - { - "text": "Add", - "xtype": "Button", - "cls": "x-btn-text-icon", - "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'", - "listeners": { - "|click": "function()\n{\n if (!_this.dialog) return;\n _this.dialog.show( { id : 0 } , function() {\n _this.grid.footer.onClick('first');\n }); \n}\n" - }, - "|xns": "Roo.Toolbar" - }, - { - "text": "Delete", - "cls": "x-btn-text-icon", - "|icon": "rootURL + '/Pman/templates/images/trash.gif'", - "xtype": "Button", - "listeners": { - "|click": "function()\n{\n Pman.genericDelete(_this, 'core_watch'); \n}\n " - }, - "|xns": "Roo.Toolbar" - } - ] - }, - { - "*prop": "colModel[]", - "dataIndex": "event", - "header": "Watch Event", - "width": 150, - "xtype": "ColumnModel", - "|renderer": "function(v,x,r) { \n if (typeof(r.data.event_right_display_name) != 'undefined') {\n return String.format('{0}: {1}', r.data.event_left, r.data.event_right_display_name); \n }\n return String.format('{0}', v); \n \n}", - "|xns": "Roo.grid" - }, - { - "*prop": "colModel[]", - "dataIndex": "ontable", - "header": "Watch Table", - "width": 150, - "xtype": "ColumnModel", - "|renderer": "function(v) { return String.format('{0}', v); }", - "|xns": "Roo.grid" - }, - { - "*prop": "colModel[]", - "dataIndex": "onid", - "header": "Watch ID", - "width": 75, - "xtype": "ColumnModel", - "|renderer": "function(v) { return String.format('{0}', v); }", - "|xns": "Roo.grid" - }, - { - "*prop": "colModel[]", - "dataIndex": "person_id_name", - "header": "Who get's notified", - "width": 150, - "xtype": "ColumnModel", - "|renderer": "function(v) { return String.format('{0}', v); }", - "|xns": "Roo.grid" - }, - { - "*prop": "colModel[]", - "dataIndex": "medium", - "header": "What happens", - "width": 300, - "xtype": "ColumnModel", - "|renderer": "function(v) {\n var ar = v.split(':');\n if (ar.length > 1) {\n var act = ar[1].replace(/^notify/,'');\n\n return String.format('{1}', v, act);\n }\n\n return String.format('{0}', v);\n }", - "|xns": "Roo.grid" - }, - { - "xtype": "ColumnModel", - "header": "Active", - "width": 75, - "dataIndex": "active", - "|renderer": "function(v) { return String.format('{0}', v); }", - "|xns": "Roo.grid", - "*prop": "colModel[]" - } - ] - } - ] + { + "id" : "id", + "root" : "data", + "xtype" : "JsonReader", + "$ fields" : "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'on_table',\n 'type': 'string'\n }\n \n]", + "$ xns" : "Roo.data", + "* prop" : "reader", + "totalProperty" : "total" + } + ] + } + ] + }, + { + "xtype" : "Fill", + "$ xns" : "Roo.Toolbar" + }, + { + "listeners" : { + "|click" : "function()\n{\n if (!_this.dialog) {\n return;\n }\n _this.dialog.show( { id : 0 } , function() {\n _this.grid.footer.onClick('first');\n }); \n}\n" + }, + "text" : "Add", + "xtype" : "Button", + "cls" : "x-btn-text-icon", + "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'", + "$ xns" : "Roo.Toolbar" + }, + { + "listeners" : { + "|click" : "function()\n{\n Pman.genericDelete(_this, 'core_watch'); \n}\n " + }, + "text" : "Delete", + "xtype" : "Button", + "cls" : "x-btn-text-icon", + "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'", + "$ xns" : "Roo.Toolbar" } - ], - "permname": "", - "modOrder": "860" + ] + }, + { + "xtype" : "ColumnModel", + "header" : "Watch Event", + "width" : 150, + "$ renderer" : "function(v,x,r) { \n if (typeof(r.data.event_right_display_name) != 'undefined') {\n return String.format('{0}: {1}', r.data.event_left, r.data.event_right_display_name); \n }\n return String.format('{0}', v); \n \n}", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "event" + }, + { + "xtype" : "ColumnModel", + "header" : "Watch Table", + "width" : 150, + "$ renderer" : "function(v) { return String.format('{0}', v); }", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "ontable" + }, + { + "xtype" : "ColumnModel", + "header" : "Watch ID", + "width" : 75, + "$ renderer" : "function(v) { return String.format('{0}', v); }", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "onid" + }, + { + "xtype" : "ColumnModel", + "header" : "Who get's notified", + "width" : 150, + "$ renderer" : "function(v) { return String.format('{0}', v); }", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "person_id_name" + }, + { + "xtype" : "ColumnModel", + "header" : "What happens", + "width" : 300, + "$ renderer" : "function(v) {\n var ar = v.split(':');\n if (ar.length > 1) {\n var act = ar[1].replace(/^notify/,'');\n\n return String.format('{1}', v, act);\n }\n\n return String.format('{0}', v);\n }", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "medium" + }, + { + "xtype" : "ColumnModel", + "width" : 75, + "header" : "Active", + "$ renderer" : "function(v) { return String.format('{0}', v); }", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "active" + } + ] + } + ] + } + ] } \ No newline at end of file