{
- "id": "roo-file-219",
- "name": "Pman.Tab.AdminEmailTemplates",
- "parent": "Pman.Tab.Admin",
- "title": "Manage Email Templates",
- "path": "/home/edward/gitlive/Pman.Admin/Pman.Tab.AdminEmailTemplates.bjs",
- "items": [
+ "name" : "Pman.Tab.AdminEmailTemplates",
+ "parent" : "Pman.Tab.Admin",
+ "title" : "Manage Email Templates",
+ "path" : "/home/alan/gitlive/Pman.Admin/Pman.Tab.AdminEmailTemplates.bjs",
+ "permname" : "",
+ "modOrder" : "999",
+ "strings" : {
+ "ec211f7c20af43e742bf2570c3cb84f9" : "Add",
+ "c7d299bf3f9e37c77ab646f7e5366696" : "core_email",
+ "00d6e06d2f3c092b4f5e1e708a360b0f" : "Displaying Message{0} - {1} of {2}",
+ "9076cbba1d9ef79280b4f39e2aa0d115" : "Nothing found",
+ "b78a3223503896721cca1303f776159b" : "Title",
+ "9e11143e29a031212f2cdefcf61f39e9" : "View Message",
+ "f49559cda3fb906fbd7736f8b8a0e37d" : "Email Template",
+ "4a4a8fe0c6dfb6bd2a41755d15eb6f0b" : "From Name",
+ "4ca679a383343ab3d4ca1cd7c91b43f7" : "From Email",
+ "5fb63579fc981698f97d55bfecb213ea" : "Copy",
+ "f2a6c498fb90ee345d997f888fce3b18" : "Delete",
+ "49ee3087348e8d44e1feda1917443987" : "Name"
+ },
+ "items" : [
+ {
+ "region" : "center",
+ "xtype" : "NestedLayoutPanel",
+ "title" : "Email Template",
+ "$ xns" : "Roo",
+ "items" : [
+ {
+ "xtype" : "BorderLayout",
+ "$ xns" : "Roo",
+ "* prop" : "layout",
+ "items" : [
+ {
+ "autoScroll" : false,
+ "xtype" : "LayoutRegion",
+ "$ xns" : "Roo",
+ "split" : true,
+ "* prop" : "center"
+ },
+ {
+ "autoScroll" : false,
+ "xtype" : "LayoutRegion",
+ "$ xns" : "Roo",
+ "split" : true,
+ "height" : 300,
+ "* prop" : "south",
+ "titlebar" : true
+ },
+ {
+ "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" : "core_email",
+ "xtype" : "GridPanel",
+ "fitContainer" : true,
+ "$ xns" : "Roo",
+ "tableName" : "core_email",
+ "items" : [
{
- "region": "center",
- "title": "Email Template",
- "xtype": "NestedLayoutPanel",
- "|xns": "Roo",
- "items": [
- {
- "|xns": "Roo",
- "xtype": "BorderLayout",
- "*prop": "layout",
- "items": [
- {
- "*prop": "center",
- "autoScroll": false,
- "split": true,
- "xtype": "LayoutRegion",
- "|xns": "Roo"
- },
- {
- "*prop": "south",
- "autoScroll": false,
- "height": 300,
- "split": true,
- "titlebar": true,
- "xtype": "LayoutRegion",
- "|xns": "Roo"
- },
- {
- "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": "center",
- "tableName": "core_email",
- "title": "core_email",
- "xtype": "GridPanel",
- "|xns": "Roo",
- "items": [
- {
- "listeners": {
- "|render": "function() \n{\n _this.grid = this; \n _this.dialog = Pman.Dialog.CoreEmail;\n if (_this.panel.active) {\n _this.grid.footer.onClick('first');\n }\n}",
- "|rowdblclick": "function (_self, rowIndex, e)\n{\n if (!_this.dialog) return;\n var data = this.getDataSource().getAt(rowIndex).data;\n _this.dialog.show( {id : data.id, module : 'core_email'} , function() {\n _this.grid.footer.onClick('first');\n }); \n}\n",
- "rowclick": "function (_self, rowIndex, e)\n{\n // _this.grid.ds.load({});\n _this.viewPanel.view.store.load({});\n}"
- },
- "*prop": "grid",
- "autoExpandColumn": "subject",
- "loadMask": true,
- "xtype": "Grid",
- "|xns": "Roo.grid",
- "items": [
- {
- "*prop": "sm",
- "singleSelect": true,
- "xtype": "RowSelectionModel",
- "|xns": "Roo.grid"
- },
- {
- "listeners": {
- "beforeload": "function (_self, options)\n{\n options.params = options.params || {};\n \n var s = _this.searchBox.getValue();\n \n if(s.length){\n options.params['search[nameortitle]'] = s;\n }\n\n}"
- },
- "*prop": "dataSource",
- "remoteSort": true,
- "xtype": "Store",
- "|sortInfo": "{ field : 'id', direction: 'DESC' }",
- "|xns": "Roo.data",
- "items": [
- {
- "*prop": "proxy",
- "method": "GET",
- "xtype": "HttpProxy",
- "|url": "baseURL + '/Roo/Core_email.php'",
- "|xns": "Roo.data"
- },
- {
- "*prop": "reader",
- "id": "id",
- "root": "data",
- "totalProperty": "total",
- "xtype": "JsonReader",
- "|fields": "[\n {\n \"name\":\"name\",\n \"type\":\"string\"\n },\n {\n \"name\":\"subject\",\n \"type\":\"string\"\n }\n]",
- "|xns": "Roo.data"
- }
- ]
- },
- {
- "*prop": "footer",
- "displayInfo": true,
- "displayMsg": "Displaying Message{0} - {1} of {2}",
- "emptyMsg": "Nothing found",
- "pageSize": 25,
- "xtype": "PagingToolbar",
- "|xns": "Roo"
- },
- {
- "*prop": "toolbar",
- "xtype": "Toolbar",
- "|xns": "Roo",
- "items": [
- {
- "listeners": {
- "specialkey": "function (_self, e)\n{\n _this.grid.footer.onClick('first');\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}"
- },
- "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('');\r\n _this.grid.footer.onClick('first');\r\n}"
- },
- "cls": "x-btn-icon",
- "xtype": "Button",
- "|icon": "rootURL + '/Pman/templates/images/edit-clear.gif'",
- "|xns": "Roo.Toolbar"
- },
- {
- "|xns": "Roo.Toolbar",
- "xtype": "Fill"
- },
- {
- "listeners": {
- "|click": "function()\n{\n var sel = _this.grid.selModel.getSelected();\n if (!sel) {\n Roo.MessageBox.alert(\"Error\", \"Select a message to copy\");\n return;\n }\nnew Pman.Request({\n url : baseURL + '/Roo/Core_email',\n method : 'POST',\n params : {\n id : sel.data.id,\n _make_copy : 1\n },\n success : function() {\n _this.grid.footer.onClick('refresh');\n }\n});\n \n}\n"
- },
- "cls": "x-btn-text-icon",
- "text": "Copy",
- "xtype": "Button",
- "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
- "|xns": "Roo.Toolbar"
- },
- {
- "listeners": {
- "|click": "function()\n{\n if (!_this.dialog) return;\n _this.dialog.show( { id : 0, module : 'core_email' } , 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"
- },
- {
- "|xns": "Roo.Toolbar",
- "xtype": "Separator"
- },
- {
- "listeners": {
- "|click": "function()\n{\n Pman.genericDelete(_this, 'core_email');\n \n}\n"
- },
- "cls": "x-btn-text-icon",
- "text": "Delete",
- "xtype": "Button",
- "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
- "|xns": "Roo.Toolbar"
- }
- ]
- },
- {
- "*prop": "colModel[]",
- "dataIndex": "name",
- "header": "Name",
- "width": 250,
- "xtype": "ColumnModel",
- "|renderer": "function(v) { return String.format('{0}', v); }",
- "|xns": "Roo.grid"
- },
- {
- "*prop": "colModel[]",
- "dataIndex": "subject",
- "header": "Title",
- "width": 300,
- "xtype": "ColumnModel",
- "|renderer": "function(v) { return String.format('{0}', v); }",
- "|xns": "Roo.grid"
- },
- {
- "*prop": "colModel[]",
- "dataIndex": "from_name",
- "header": "From Name",
- "width": 400,
- "xtype": "ColumnModel",
- "|renderer": "function(v) { return String.format('{0}', v); }",
- "|xns": "Roo.grid"
- },
- {
- "*prop": "colModel[]",
- "dataIndex": "from_email",
- "header": "From Email",
- "width": 400,
- "xtype": "ColumnModel",
- "|renderer": "function(v) { return String.format('{0}', v); }",
- "|xns": "Roo.grid"
- }
- ]
- }
- ]
- },
- {
- "listeners": {
- "render": "function (_self)\n{\n _this.viewPanel = _self;\n}"
- },
- "autoScroll": true,
- "background": false,
- "fitContainer": true,
- "fitToFrame": true,
- "region": "south",
- "title": "View Message",
- "xtype": "ContentPanel",
- "|xns": "Roo",
- "items": [
- {
- "listeners": {
- "preparedata": "function (_self, data, i, rec)\n{\n // Roo.log(data);\n //Roo.apply(data, rec.json);\n}"
- },
- "*prop": "view",
- "xtype": "View",
- "|tpl": "new Roo.DomTemplate({url : rootURL+'/Pman/Crm/domtemplates/crm_mail.html'})",
- "|xns": "Roo",
- "items": [
- {
- "listeners": {
- "beforeload": "function (_self, options)\n{\n options.params = options.params || {};\n var p = _this.grid.selModel.getSelected();\n if (!p || !p.data.id) {\n this.removeAll();\n return false;\n }\n \n options.params['id'] = p.data.id;\n \n}",
- "load": "function (_self, records, options)\n{\n var p = _this.grid.selModel.getSelected();\n // Roo.log(p);\n if (!p || !p.data.id) {\n this.removeAll();\n return false;\n }\n /* \n new Pman.Request({\n url : baseURL + '/Roo/crm_action.php',\n method : 'GET',\n params : {\n person_id : p.data.id,\n sort : 'action_dt',\n dir : 'DESC'\n },\n success : function(res) {\n if(res.success){\n var el = _this.cpanel.el.select('.crm-history-content').first();\n _this.historyTemplate.overwrite(el, res);\n el.select('.crm-history-log').on('click', Pman.Crm.auditToggle);\n //Roo.log(res);\n }\n },\n failure : function(e) {\n //Roo.log(e);\n _this.grid.ds.load({});\n }\n \n });\n */\n\n//_this.historyTemplate = new Roo.DomTemplate({url : rootURL+'/Pman/Crm/domtemplates/crm_history.html'})\n\n/*\n new pman request ([\n \n } successs(data)\n el = _this.elemmnt.select('.services')\n _this.serviceTemplate.overwite(el, data)\n */\n}"
- },
- "*prop": "store",
- "xtype": "Store",
- "|xns": "Roo.data",
- "items": [
- {
- "*prop": "proxy",
- "method": "GET",
- "xtype": "HttpProxy",
- "|url": "baseURL+'/Roo/Core_email.php'",
- "|xns": "Roo.data"
- },
- {
- "*prop": "reader",
- "id": "id",
- "root": "data",
- "totalProperty": "total",
- "xtype": "JsonReader",
- "|xns": "Roo.data"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ]
+ "listeners" : {
+ "|rowdblclick" : "function (_self, rowIndex, e)\n{\n if (!_this.dialog) return;\n var data = this.getDataSource().getAt(rowIndex).data;\n _this.dialog.show( {id : data.id, module : 'core_email'} , function() {\n _this.grid.footer.onClick('first');\n }); \n}\n",
+ "|render" : "function() \n{\n _this.grid = this; \n _this.dialog = Pman.Dialog.CoreEmail;\n if (_this.panel.active) {\n _this.grid.footer.onClick('first');\n }\n}",
+ "rowclick" : "function (_self, rowIndex, e)\n{\n // _this.grid.ds.load({});\n _this.viewPanel.view.store.load({});\n}"
+ },
+ "autoExpandColumn" : "subject",
+ "xtype" : "Grid",
+ "loadMask" : true,
+ "$ xns" : "Roo.grid",
+ "* prop" : "grid",
+ "items" : [
+ {
+ "xtype" : "RowSelectionModel",
+ "singleSelect" : true,
+ "$ xns" : "Roo.grid",
+ "* prop" : "sm"
+ },
+ {
+ "listeners" : {
+ "beforeload" : "function (_self, options)\n{\n options.params = options.params || {};\n \n var s = _this.searchBox.getValue();\n \n if(s.length){\n options.params['search[nameortitle]'] = s;\n }\n\n}"
+ },
+ "xtype" : "Store",
+ "remoteSort" : true,
+ "$ sortInfo" : "{ field : 'id', direction: 'DESC' }",
+ "$ xns" : "Roo.data",
+ "* prop" : "dataSource",
+ "items" : [
+ {
+ "$ url" : "baseURL + '/Roo/Core_email.php'",
+ "xtype" : "HttpProxy",
+ "method" : "GET",
+ "$ xns" : "Roo.data",
+ "* prop" : "proxy"
+ },
+ {
+ "id" : "id",
+ "root" : "data",
+ "xtype" : "JsonReader",
+ "$ fields" : "[\n {\n \"name\":\"name\",\n \"type\":\"string\"\n },\n {\n \"name\":\"subject\",\n \"type\":\"string\"\n }\n]",
+ "$ xns" : "Roo.data",
+ "* prop" : "reader",
+ "totalProperty" : "total"
+ }
+ ]
+ },
+ {
+ "pageSize" : 25,
+ "xtype" : "PagingToolbar",
+ "emptyMsg" : "Nothing found",
+ "$ xns" : "Roo",
+ "displayMsg" : "Displaying Message{0} - {1} of {2}",
+ "displayInfo" : true,
+ "* prop" : "footer"
+ },
+ {
+ "xtype" : "Toolbar",
+ "$ xns" : "Roo",
+ "* prop" : "toolbar",
+ "items" : [
+ {
+ "listeners" : {
+ "specialkey" : "function (_self, e)\n{\n _this.grid.footer.onClick('first');\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('');\r\n _this.grid.footer.onClick('first');\r\n}"
+ },
+ "xtype" : "Button",
+ "cls" : "x-btn-icon",
+ "$ icon" : "rootURL + '/Pman/templates/images/edit-clear.gif'",
+ "$ xns" : "Roo.Toolbar"
+ },
+ {
+ "xtype" : "Fill",
+ "$ xns" : "Roo.Toolbar"
+ },
+ {
+ "listeners" : {
+ "|click" : "function()\n{\n var sel = _this.grid.selModel.getSelected();\n if (!sel) {\n Roo.MessageBox.alert(\"Error\", \"Select a message to copy\");\n return;\n }\nnew Pman.Request({\n url : baseURL + '/Roo/Core_email',\n method : 'POST',\n params : {\n id : sel.data.id,\n _make_copy : 1\n },\n success : function() {\n _this.grid.footer.onClick('refresh');\n }\n});\n \n}\n"
+ },
+ "text" : "Copy",
+ "xtype" : "Button",
+ "cls" : "x-btn-text-icon",
+ "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
+ "$ xns" : "Roo.Toolbar"
+ },
+ {
+ "listeners" : {
+ "|click" : "function()\n{\n if (!_this.dialog) return;\n _this.dialog.show( { id : 0, module : 'core_email' } , 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"
+ },
+ {
+ "xtype" : "Separator",
+ "$ xns" : "Roo.Toolbar"
+ },
+ {
+ "listeners" : {
+ "|click" : "function()\n{\n Pman.genericDelete(_this, 'core_email');\n \n}\n"
+ },
+ "text" : "Delete",
+ "xtype" : "Button",
+ "cls" : "x-btn-text-icon",
+ "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'",
+ "$ xns" : "Roo.Toolbar"
+ }
+ ]
+ },
+ {
+ "xtype" : "ColumnModel",
+ "header" : "Name",
+ "width" : 250,
+ "$ renderer" : "function(v) { return String.format('{0}', v); }",
+ "$ xns" : "Roo.grid",
+ "Boolean sortable" : true,
+ "* prop" : "colModel[]",
+ "dataIndex" : "name"
+ },
+ {
+ "xtype" : "ColumnModel",
+ "header" : "Title",
+ "width" : 300,
+ "$ renderer" : "function(v) { return String.format('{0}', v); }",
+ "$ xns" : "Roo.grid",
+ "Boolean sortable" : true,
+ "* prop" : "colModel[]",
+ "dataIndex" : "subject"
+ },
+ {
+ "xtype" : "ColumnModel",
+ "header" : "From Name",
+ "width" : 400,
+ "$ renderer" : "function(v) { return String.format('{0}', v); }",
+ "$ xns" : "Roo.grid",
+ "Boolean sortable" : true,
+ "* prop" : "colModel[]",
+ "dataIndex" : "from_name"
+ },
+ {
+ "xtype" : "ColumnModel",
+ "header" : "From Email",
+ "width" : 400,
+ "$ renderer" : "function(v) { return String.format('{0}', v); }",
+ "$ xns" : "Roo.grid",
+ "Boolean sortable" : true,
+ "* prop" : "colModel[]",
+ "dataIndex" : "from_email"
+ }
+ ]
}
- ],
- "permname": "",
- "modOrder": "999"
+ ]
+ },
+ {
+ "listeners" : {
+ "render" : "function (_self)\n{\n _this.viewPanel = _self;\n}"
+ },
+ "autoScroll" : true,
+ "background" : false,
+ "fitToFrame" : true,
+ "region" : "south",
+ "title" : "View Message",
+ "xtype" : "ContentPanel",
+ "fitContainer" : true,
+ "$ xns" : "Roo",
+ "items" : [
+ {
+ "listeners" : {
+ "preparedata" : "function (_self, data, i, rec)\n{\n // Roo.log(data);\n //Roo.apply(data, rec.json);\n}"
+ },
+ "$ tpl" : "new Roo.DomTemplate({url : rootURL+'/Pman/Crm/domtemplates/crm_mail.html'})",
+ "xtype" : "View",
+ "$ xns" : "Roo",
+ "* prop" : "view",
+ "items" : [
+ {
+ "listeners" : {
+ "beforeload" : "function (_self, options)\n{\n options.params = options.params || {};\n var p = _this.grid.selModel.getSelected();\n if (!p || !p.data.id) {\n this.removeAll();\n return false;\n }\n \n options.params['id'] = p.data.id;\n \n}",
+ "load" : "function (_self, records, options)\n{\n var p = _this.grid.selModel.getSelected();\n // Roo.log(p);\n if (!p || !p.data.id) {\n this.removeAll();\n return false;\n }\n /* \n new Pman.Request({\n url : baseURL + '/Roo/crm_action.php',\n method : 'GET',\n params : {\n person_id : p.data.id,\n sort : 'action_dt',\n dir : 'DESC'\n },\n success : function(res) {\n if(res.success){\n var el = _this.cpanel.el.select('.crm-history-content').first();\n _this.historyTemplate.overwrite(el, res);\n el.select('.crm-history-log').on('click', Pman.Crm.auditToggle);\n //Roo.log(res);\n }\n },\n failure : function(e) {\n //Roo.log(e);\n _this.grid.ds.load({});\n }\n \n });\n */\n\n//_this.historyTemplate = new Roo.DomTemplate({url : rootURL+'/Pman/Crm/domtemplates/crm_history.html'})\n\n/*\n new pman request ([\n \n } successs(data)\n el = _this.elemmnt.select('.services')\n _this.serviceTemplate.overwite(el, data)\n */\n}"
+ },
+ "xtype" : "Store",
+ "$ xns" : "Roo.data",
+ "* prop" : "store",
+ "items" : [
+ {
+ "$ url" : "baseURL+'/Roo/Core_email.php'",
+ "xtype" : "HttpProxy",
+ "method" : "GET",
+ "$ xns" : "Roo.data",
+ "* prop" : "proxy"
+ },
+ {
+ "id" : "id",
+ "root" : "data",
+ "xtype" : "JsonReader",
+ "$ xns" : "Roo.data",
+ "* prop" : "reader",
+ "totalProperty" : "total"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
}
\ No newline at end of file
// Auto generated file - created by app.Builder.js- do not edit directly (at present!)
-Pman.Tab.CoreEmail = new Roo.XComponent({
- part : ["Admin","EmailTemplates"],
- order : '999-Pman.Tab.AdminEmailTemplates',
- region : 'center',
- parent : 'Pman.Tab.Admin',
- name : "Manage Email Templates",
- disabled : false,
- permname : '',
- _tree : function()
- {
- var _this = this;
- var MODULE = this;
- return {
- xtype: 'NestedLayoutPanel',
- xns: Roo,
- region : 'center',
- title : "Email Template",
- layout : {
- xtype: 'BorderLayout',
- xns: Roo,
- items : [
- {
- 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_email',
- title : "core_email",
- grid : {
- xtype: 'Grid',
- xns: Roo.grid,
- listeners : {
- render : function()
- {
- _this.grid = this;
- _this.dialog = Pman.Dialog.CoreEmail;
- if (_this.panel.active) {
- _this.grid.footer.onClick('first');
- }
- },
- rowdblclick : function (_self, rowIndex, e)
- {
- if (!_this.dialog) return;
- var data = this.getDataSource().getAt(rowIndex).data;
- _this.dialog.show( {id : data.id, module : 'core_email'} , function() {
- _this.grid.footer.onClick('first');
- });
- },
- rowclick : function (_self, rowIndex, e)
- {
- // _this.grid.ds.load({});
- _this.viewPanel.view.store.load({});
- }
- },
- autoExpandColumn : 'subject',
- loadMask : true,
- sm : {
- xtype: 'RowSelectionModel',
- xns: Roo.grid,
- singleSelect : true
- },
- dataSource : {
- xtype: 'Store',
- xns: Roo.data,
- listeners : {
- beforeload : function (_self, options)
- {
- options.params = options.params || {};
-
- var s = _this.searchBox.getValue();
-
- if(s.length){
- options.params['search[nameortitle]'] = s;
- }
-
- }
- },
- remoteSort : true,
- sortInfo : { field : 'id', direction: 'DESC' },
- proxy : {
- xtype: 'HttpProxy',
- xns: Roo.data,
- method : 'GET',
- url : baseURL + '/Roo/Core_email.php'
- },
- reader : {
- xtype: 'JsonReader',
- xns: Roo.data,
- id : 'id',
- root : 'data',
- totalProperty : 'total',
- fields : [
- {
- "name":"name",
- "type":"string"
- },
- {
- "name":"subject",
- "type":"string"
- }
- ]
- }
- },
- footer : {
- xtype: 'PagingToolbar',
- xns: Roo,
- displayInfo : true,
- displayMsg : "Displaying Message{0} - {1} of {2}",
- emptyMsg : "Nothing found",
- pageSize : 25
- },
- toolbar : {
- xtype: 'Toolbar',
- xns: Roo,
- items : [
- {
- xtype: 'TextField',
- xns: Roo.form,
- listeners : {
- specialkey : function (_self, e)
- {
- _this.grid.footer.onClick('first');
- },
- render : function (_self)
- {
- _this.searchBox = _self;
- }
- }
- },
- {
- 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: 'Fill',
- xns: Roo.Toolbar
- },
- {
- xtype: 'Button',
- xns: Roo.Toolbar,
- listeners : {
- click : function()
- {
- var sel = _this.grid.selModel.getSelected();
- if (!sel) {
- Roo.MessageBox.alert("Error", "Select a message to copy");
- return;
- }
- new Pman.Request({
- url : baseURL + '/Roo/Core_email',
- method : 'POST',
- params : {
- id : sel.data.id,
- _make_copy : 1
- },
- success : function() {
- _this.grid.footer.onClick('refresh');
- }
- });
-
- }
- },
- cls : 'x-btn-text-icon',
- text : "Copy",
- icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
- },
- {
- xtype: 'Button',
- xns: Roo.Toolbar,
- listeners : {
- click : function()
- {
- if (!_this.dialog) return;
- _this.dialog.show( { id : 0, module : 'core_email' } , function() {
- _this.grid.footer.onClick('first');
- });
- }
- },
- cls : 'x-btn-text-icon',
- text : "Add",
- icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
- },
- {
- xtype: 'Separator',
- xns: Roo.Toolbar
- },
- {
- xtype: 'Button',
- xns: Roo.Toolbar,
- listeners : {
- click : function()
- {
- Pman.genericDelete(_this, 'core_email');
-
- }
- },
- cls : 'x-btn-text-icon',
- text : "Delete",
- icon : rootURL + '/Pman/templates/images/trash.gif'
- }
- ]
- },
- colModel : [
- {
- xtype: 'ColumnModel',
- xns: Roo.grid,
- dataIndex : 'name',
- header : 'Name',
- width : 250,
- renderer : function(v) { return String.format('{0}', v); }
- },
- {
- xtype: 'ColumnModel',
- xns: Roo.grid,
- dataIndex : 'subject',
- header : 'Title',
- width : 300,
- renderer : function(v) { return String.format('{0}', v); }
- },
- {
- xtype: 'ColumnModel',
- xns: Roo.grid,
- dataIndex : 'from_name',
- header : 'From Name',
- width : 400,
- renderer : function(v) { return String.format('{0}', v); }
- },
- {
- xtype: 'ColumnModel',
- xns: Roo.grid,
- dataIndex : 'from_email',
- header : 'From Email',
- width : 400,
- renderer : function(v) { return String.format('{0}', v); }
- }
- ]
- }
- },
- {
- xtype: 'ContentPanel',
- xns: Roo,
- listeners : {
- render : function (_self)
- {
- _this.viewPanel = _self;
- }
- },
- autoScroll : true,
- background : false,
- fitContainer : true,
- fitToFrame : true,
- region : 'south',
- title : "View Message",
- view : {
- xtype: 'View',
- xns: Roo,
- listeners : {
- preparedata : function (_self, data, i, rec)
- {
- // Roo.log(data);
- //Roo.apply(data, rec.json);
- }
- },
- tpl : new Roo.DomTemplate({url : rootURL+'/Pman/Crm/domtemplates/crm_mail.html'}),
- store : {
- xtype: 'Store',
- xns: Roo.data,
- listeners : {
- beforeload : function (_self, options)
- {
- options.params = options.params || {};
- var p = _this.grid.selModel.getSelected();
- if (!p || !p.data.id) {
- this.removeAll();
- return false;
- }
-
- options.params['id'] = p.data.id;
-
- },
- load : function (_self, records, options)
- {
- var p = _this.grid.selModel.getSelected();
- // Roo.log(p);
- if (!p || !p.data.id) {
- this.removeAll();
- return false;
- }
- /*
- new Pman.Request({
- url : baseURL + '/Roo/crm_action.php',
- method : 'GET',
- params : {
- person_id : p.data.id,
- sort : 'action_dt',
- dir : 'DESC'
- },
- success : function(res) {
- if(res.success){
- var el = _this.cpanel.el.select('.crm-history-content').first();
- _this.historyTemplate.overwrite(el, res);
- el.select('.crm-history-log').on('click', Pman.Crm.auditToggle);
- //Roo.log(res);
- }
- },
- failure : function(e) {
- //Roo.log(e);
- _this.grid.ds.load({});
- }
-
- });
- */
-
- //_this.historyTemplate = new Roo.DomTemplate({url : rootURL+'/Pman/Crm/domtemplates/crm_history.html'})
-
- /*
- new pman request ([
-
- } successs(data)
- el = _this.elemmnt.select('.services')
- _this.serviceTemplate.overwite(el, data)
- */
- }
- },
- proxy : {
- xtype: 'HttpProxy',
- xns: Roo.data,
- method : 'GET',
- url : baseURL+'/Roo/Core_email.php'
- },
- reader : {
- xtype: 'JsonReader',
- xns: Roo.data,
- id : 'id',
- root : 'data',
- totalProperty : 'total'
- }
- }
- }
- }
- ],
- center : {
- xtype: 'LayoutRegion',
- xns: Roo,
- autoScroll : false,
- split : true
+Roo.namespace('Pman.Tab');
+
+Pman.Tab.AdminEmailTemplates = new Roo.XComponent({
+
+ _strings : {
+ 'ec211f7c20af43e742bf2570c3cb84f9' :"Add",
+ 'c7d299bf3f9e37c77ab646f7e5366696' :"core_email",
+ '00d6e06d2f3c092b4f5e1e708a360b0f' :"Displaying Message{0} - {1} of {2}",
+ '9076cbba1d9ef79280b4f39e2aa0d115' :"Nothing found",
+ 'b78a3223503896721cca1303f776159b' :"Title",
+ '9e11143e29a031212f2cdefcf61f39e9' :"View Message",
+ 'f49559cda3fb906fbd7736f8b8a0e37d' :"Email Template",
+ '4a4a8fe0c6dfb6bd2a41755d15eb6f0b' :"From Name",
+ '4ca679a383343ab3d4ca1cd7c91b43f7' :"From Email",
+ '5fb63579fc981698f97d55bfecb213ea' :"Copy",
+ 'f2a6c498fb90ee345d997f888fce3b18' :"Delete",
+ '49ee3087348e8d44e1feda1917443987' :"Name"
+ },
+
+ part : ["Admin", "EmailTemplates" ],
+ order : '999-Pman.Tab.AdminEmailTemplates',
+ region : 'center',
+ parent : 'Pman.Tab.Admin',
+ name : "Manage Email Templates",
+ disabled : false,
+ permname : '',
+ _tree : function()
+ {
+ var _this = this;
+ var MODULE = this;
+ return {
+ region : 'center',
+ title : _this._strings['f49559cda3fb906fbd7736f8b8a0e37d'] /* Email Template */,
+ xns : Roo,
+ '|xns' : 'Roo',
+ xtype : 'NestedLayoutPanel',
+ layout : {
+ xns : Roo,
+ '|xns' : 'Roo',
+ xtype : 'BorderLayout',
+ center : {
+ autoScroll : false,
+ split : true,
+ xns : Roo,
+ '|xns' : 'Roo',
+ xtype : 'LayoutRegion'
+ },
+ south : {
+ autoScroll : false,
+ height : 300,
+ split : true,
+ titlebar : true,
+ xns : Roo,
+ '|xns' : 'Roo',
+ xtype : 'LayoutRegion'
+ },
+ items : [
+ {
+ background : true,
+ fitContainer : true,
+ fitToframe : true,
+ region : 'center',
+ tableName : 'core_email',
+ title : _this._strings['c7d299bf3f9e37c77ab646f7e5366696'] /* core_email */,
+ xns : Roo,
+ '|xns' : 'Roo',
+ xtype : 'GridPanel',
+ listeners : {
+ activate : function() {
+ _this.panel = this;
+ if (_this.grid) {
+ _this.grid.footer.onClick('first');
+ }
+ }
+ },
+ grid : {
+ autoExpandColumn : 'subject',
+ loadMask : true,
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid',
+ xtype : 'Grid',
+ listeners : {
+ render : function()
+ {
+ _this.grid = this;
+ _this.dialog = Pman.Dialog.CoreEmail;
+ if (_this.panel.active) {
+ _this.grid.footer.onClick('first');
+ }
+ },
+ rowclick : function (_self, rowIndex, e)
+ {
+ // _this.grid.ds.load({});
+ _this.viewPanel.view.store.load({});
+ },
+ rowdblclick : function (_self, rowIndex, e)
+ {
+ if (!_this.dialog) return;
+ var data = this.getDataSource().getAt(rowIndex).data;
+ _this.dialog.show( {id : data.id, module : 'core_email'} , function() {
+ _this.grid.footer.onClick('first');
+ });
+ }
+ },
+ footer : {
+ displayInfo : true,
+ displayMsg : _this._strings['00d6e06d2f3c092b4f5e1e708a360b0f'] /* Displaying Message{0} - {1} of {2} */,
+ emptyMsg : _this._strings['9076cbba1d9ef79280b4f39e2aa0d115'] /* Nothing found */,
+ pageSize : 25,
+ xns : Roo,
+ '|xns' : 'Roo',
+ xtype : 'PagingToolbar'
+ },
+ toolbar : {
+ xns : Roo,
+ '|xns' : 'Roo',
+ xtype : 'Toolbar',
+ items : [
+ {
+ xns : Roo.form,
+ '|xns' : 'Roo.form',
+ xtype : 'TextField',
+ listeners : {
+ render : function (_self)
+ {
+ _this.searchBox = _self;
+ },
+ specialkey : function (_self, e)
+ {
+ _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 : 'Fill'
+ },
+ {
+ cls : 'x-btn-text-icon',
+ icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
+ text : _this._strings['5fb63579fc981698f97d55bfecb213ea'] /* Copy */,
+ xns : Roo.Toolbar,
+ '|xns' : 'Roo.Toolbar',
+ xtype : 'Button',
+ listeners : {
+ click : function()
+ {
+ var sel = _this.grid.selModel.getSelected();
+ if (!sel) {
+ Roo.MessageBox.alert("Error", "Select a message to copy");
+ return;
+ }
+ new Pman.Request({
+ url : baseURL + '/Roo/Core_email',
+ method : 'POST',
+ params : {
+ id : sel.data.id,
+ _make_copy : 1
},
- south : {
- xtype: 'LayoutRegion',
- xns: Roo,
- autoScroll : false,
- height : 300,
- split : true,
- titlebar : true
+ success : function() {
+ _this.grid.footer.onClick('refresh');
}
+ });
+
+ }
+ }
+ },
+ {
+ 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, module : 'core_email' } , function() {
+ _this.grid.footer.onClick('first');
+ });
+ }
+ }
+ },
+ {
+ xns : Roo.Toolbar,
+ '|xns' : 'Roo.Toolbar',
+ xtype : 'Separator'
+ },
+ {
+ cls : 'x-btn-text-icon',
+ icon : rootURL + '/Pman/templates/images/trash.gif',
+ text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
+ xns : Roo.Toolbar,
+ '|xns' : 'Roo.Toolbar',
+ xtype : 'Button',
+ listeners : {
+ click : function()
+ {
+ Pman.genericDelete(_this, 'core_email');
+
}
- };
- }
+ }
+ }
+ ]
+ },
+ dataSource : {
+ remoteSort : true,
+ sortInfo : { field : 'id', direction: 'DESC' },
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'Store',
+ listeners : {
+ beforeload : function (_self, options)
+ {
+ options.params = options.params || {};
+
+ var s = _this.searchBox.getValue();
+
+ if(s.length){
+ options.params['search[nameortitle]'] = s;
+ }
+
+ }
+ },
+ proxy : {
+ method : 'GET',
+ url : baseURL + '/Roo/Core_email.php',
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'HttpProxy'
+ },
+ reader : {
+ fields : [
+ {
+ "name":"name",
+ "type":"string"
+ },
+ {
+ "name":"subject",
+ "type":"string"
+ }
+ ],
+ 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'
+ },
+ colModel : [
+ {
+ dataIndex : 'name',
+ header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
+ renderer : function(v) { return String.format('{0}', v); },
+ sortable : true,
+ width : 250,
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid',
+ xtype : 'ColumnModel'
+ },
+ {
+ dataIndex : 'subject',
+ header : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
+ renderer : function(v) { return String.format('{0}', v); },
+ sortable : true,
+ width : 300,
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid',
+ xtype : 'ColumnModel'
+ },
+ {
+ dataIndex : 'from_name',
+ header : _this._strings['4a4a8fe0c6dfb6bd2a41755d15eb6f0b'] /* From Name */,
+ renderer : function(v) { return String.format('{0}', v); },
+ sortable : true,
+ width : 400,
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid',
+ xtype : 'ColumnModel'
+ },
+ {
+ dataIndex : 'from_email',
+ header : _this._strings['4ca679a383343ab3d4ca1cd7c91b43f7'] /* From Email */,
+ renderer : function(v) { return String.format('{0}', v); },
+ sortable : true,
+ width : 400,
+ xns : Roo.grid,
+ '|xns' : 'Roo.grid',
+ xtype : 'ColumnModel'
+ }
+ ]
+ }
+ },
+ {
+ autoScroll : true,
+ background : false,
+ fitContainer : true,
+ fitToFrame : true,
+ region : 'south',
+ title : _this._strings['9e11143e29a031212f2cdefcf61f39e9'] /* View Message */,
+ xns : Roo,
+ '|xns' : 'Roo',
+ xtype : 'ContentPanel',
+ listeners : {
+ render : function (_self)
+ {
+ _this.viewPanel = _self;
+ }
+ },
+ view : {
+ tpl : new Roo.DomTemplate({url : rootURL+'/Pman/Crm/domtemplates/crm_mail.html'}),
+ xns : Roo,
+ '|xns' : 'Roo',
+ xtype : 'View',
+ listeners : {
+ preparedata : function (_self, data, i, rec)
+ {
+ // Roo.log(data);
+ //Roo.apply(data, rec.json);
+ }
+ },
+ store : {
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'Store',
+ listeners : {
+ beforeload : function (_self, options)
+ {
+ options.params = options.params || {};
+ var p = _this.grid.selModel.getSelected();
+ if (!p || !p.data.id) {
+ this.removeAll();
+ return false;
+ }
+
+ options.params['id'] = p.data.id;
+
+ },
+ load : function (_self, records, options)
+ {
+ var p = _this.grid.selModel.getSelected();
+ // Roo.log(p);
+ if (!p || !p.data.id) {
+ this.removeAll();
+ return false;
+ }
+ /*
+ new Pman.Request({
+ url : baseURL + '/Roo/crm_action.php',
+ method : 'GET',
+ params : {
+ person_id : p.data.id,
+ sort : 'action_dt',
+ dir : 'DESC'
+ },
+ success : function(res) {
+ if(res.success){
+ var el = _this.cpanel.el.select('.crm-history-content').first();
+ _this.historyTemplate.overwrite(el, res);
+ el.select('.crm-history-log').on('click', Pman.Crm.auditToggle);
+ //Roo.log(res);
+ }
+ },
+ failure : function(e) {
+ //Roo.log(e);
+ _this.grid.ds.load({});
+ }
+
+ });
+ */
+
+ //_this.historyTemplate = new Roo.DomTemplate({url : rootURL+'/Pman/Crm/domtemplates/crm_history.html'})
+
+ /*
+ new pman request ([
+
+ } successs(data)
+ el = _this.elemmnt.select('.services')
+ _this.serviceTemplate.overwite(el, data)
+ */
+ }
+ },
+ proxy : {
+ method : 'GET',
+ url : baseURL+'/Roo/Core_email.php',
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'HttpProxy'
+ },
+ reader : {
+ id : 'id',
+ root : 'data',
+ totalProperty : 'total',
+ xns : Roo.data,
+ '|xns' : 'Roo.data',
+ xtype : 'JsonReader'
+ }
+ }
+ }
+ }
+ ]
+ }
+ }; }
});