Pman.Tab.AdminEmailTemplates.bjs
[Pman.Admin] / Pman.Tab.AdminEmailTemplates.bjs
1 {
2  "name" : "Pman.Tab.AdminEmailTemplates",
3  "parent" : "Pman.Tab.Admin",
4  "title" : "Manage Email Templates",
5  "path" : "/home/alan/gitlive/Pman.Admin/Pman.Tab.AdminEmailTemplates.bjs",
6  "permname" : "",
7  "modOrder" : "999",
8  "strings" : {
9   "ec211f7c20af43e742bf2570c3cb84f9" : "Add",
10   "c7d299bf3f9e37c77ab646f7e5366696" : "core_email",
11   "00d6e06d2f3c092b4f5e1e708a360b0f" : "Displaying Message{0} - {1} of {2}",
12   "9076cbba1d9ef79280b4f39e2aa0d115" : "Nothing found",
13   "b78a3223503896721cca1303f776159b" : "Title",
14   "9e11143e29a031212f2cdefcf61f39e9" : "View Message",
15   "f49559cda3fb906fbd7736f8b8a0e37d" : "Email Template",
16   "4a4a8fe0c6dfb6bd2a41755d15eb6f0b" : "From Name",
17   "4ca679a383343ab3d4ca1cd7c91b43f7" : "From Email",
18   "5fb63579fc981698f97d55bfecb213ea" : "Copy",
19   "f2a6c498fb90ee345d997f888fce3b18" : "Delete",
20   "49ee3087348e8d44e1feda1917443987" : "Name"
21  },
22  "items" : [
23   {
24    "region" : "center",
25    "xtype" : "NestedLayoutPanel",
26    "title" : "Email Template",
27    "$ xns" : "Roo",
28    "items" : [
29     {
30      "xtype" : "BorderLayout",
31      "$ xns" : "Roo",
32      "* prop" : "layout",
33      "items" : [
34       {
35        "autoScroll" : false,
36        "xtype" : "LayoutRegion",
37        "$ xns" : "Roo",
38        "split" : true,
39        "* prop" : "center"
40       },
41       {
42        "autoScroll" : false,
43        "xtype" : "LayoutRegion",
44        "$ xns" : "Roo",
45        "split" : true,
46        "height" : 300,
47        "* prop" : "south",
48        "titlebar" : true
49       },
50       {
51        "listeners" : {
52         "|activate" : "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
53        },
54        "fitToframe" : true,
55        "background" : true,
56        "region" : "center",
57        "title" : "core_email",
58        "xtype" : "GridPanel",
59        "fitContainer" : true,
60        "$ xns" : "Roo",
61        "tableName" : "core_email",
62        "items" : [
63         {
64          "listeners" : {
65           "|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",
66           "|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}",
67           "rowclick" : "function (_self, rowIndex, e)\n{\n   // _this.grid.ds.load({});\n    _this.viewPanel.view.store.load({});\n}"
68          },
69          "autoExpandColumn" : "subject",
70          "xtype" : "Grid",
71          "loadMask" : true,
72          "$ xns" : "Roo.grid",
73          "* prop" : "grid",
74          "items" : [
75           {
76            "xtype" : "RowSelectionModel",
77            "singleSelect" : true,
78            "$ xns" : "Roo.grid",
79            "* prop" : "sm"
80           },
81           {
82            "listeners" : {
83             "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}"
84            },
85            "xtype" : "Store",
86            "remoteSort" : true,
87            "$ sortInfo" : "{ field : 'name', direction: 'DESC' }",
88            "$ xns" : "Roo.data",
89            "* prop" : "dataSource",
90            "items" : [
91             {
92              "$ url" : "baseURL + '/Roo/Core_email.php'",
93              "xtype" : "HttpProxy",
94              "method" : "GET",
95              "$ xns" : "Roo.data",
96              "* prop" : "proxy"
97             },
98             {
99              "id" : "id",
100              "root" : "data",
101              "xtype" : "JsonReader",
102              "$ fields" : "[\n    {\n        \"name\":\"name\",\n        \"type\":\"string\"\n    },\n    {\n        \"name\":\"subject\",\n        \"type\":\"string\"\n    }\n]",
103              "$ xns" : "Roo.data",
104              "* prop" : "reader",
105              "totalProperty" : "total"
106             }
107            ]
108           },
109           {
110            "pageSize" : 25,
111            "xtype" : "PagingToolbar",
112            "emptyMsg" : "Nothing found",
113            "$ xns" : "Roo",
114            "displayMsg" : "Displaying Message{0} - {1} of {2}",
115            "displayInfo" : true,
116            "* prop" : "footer"
117           },
118           {
119            "xtype" : "Toolbar",
120            "$ xns" : "Roo",
121            "* prop" : "toolbar",
122            "items" : [
123             {
124              "listeners" : {
125               "specialkey" : "function (_self, e)\n{\n  _this.grid.footer.onClick('first');\n}",
126               "render" : "function (_self)\n{\n    _this.searchBox = _self;\n}"
127              },
128              "xtype" : "TextField",
129              "$ xns" : "Roo.form"
130             },
131             {
132              "listeners" : {
133               "click" : "function (_self, e)\n{\n    _this.grid.footer.onClick('first');\n}"
134              },
135              "xtype" : "Button",
136              "cls" : "x-btn-icon",
137              "$ icon" : "rootURL + '/Pman/templates/images/search.gif'",
138              "$ xns" : "Roo.Toolbar"
139             },
140             {
141              "listeners" : {
142               "click" : "function (_self, e)\n{\n    _this.searchBox.setValue('');\r\n    _this.grid.footer.onClick('first');\r\n}"
143              },
144              "xtype" : "Button",
145              "cls" : "x-btn-icon",
146              "$ icon" : "rootURL + '/Pman/templates/images/edit-clear.gif'",
147              "$ xns" : "Roo.Toolbar"
148             },
149             {
150              "xtype" : "Fill",
151              "$ xns" : "Roo.Toolbar"
152             },
153             {
154              "listeners" : {
155               "|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"
156              },
157              "text" : "Copy",
158              "xtype" : "Button",
159              "cls" : "x-btn-text-icon",
160              "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
161              "$ xns" : "Roo.Toolbar"
162             },
163             {
164              "listeners" : {
165               "|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"
166              },
167              "text" : "Add",
168              "xtype" : "Button",
169              "cls" : "x-btn-text-icon",
170              "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
171              "$ xns" : "Roo.Toolbar"
172             },
173             {
174              "xtype" : "Separator",
175              "$ xns" : "Roo.Toolbar"
176             },
177             {
178              "listeners" : {
179               "|click" : "function()\n{\n    Pman.genericDelete(_this, 'core_email');\n    \n}\n"
180              },
181              "text" : "Delete",
182              "xtype" : "Button",
183              "cls" : "x-btn-text-icon",
184              "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'",
185              "$ xns" : "Roo.Toolbar"
186             }
187            ]
188           },
189           {
190            "xtype" : "ColumnModel",
191            "header" : "Name",
192            "width" : 250,
193            "$ renderer" : "function(v) { return String.format('{0}', v); }",
194            "$ xns" : "Roo.grid",
195            "Boolean sortable" : true,
196            "* prop" : "colModel[]",
197            "dataIndex" : "name"
198           },
199           {
200            "xtype" : "ColumnModel",
201            "header" : "Title",
202            "width" : 300,
203            "$ renderer" : "function(v) { return String.format('{0}', v); }",
204            "$ xns" : "Roo.grid",
205            "Boolean sortable" : true,
206            "* prop" : "colModel[]",
207            "dataIndex" : "subject"
208           },
209           {
210            "xtype" : "ColumnModel",
211            "header" : "From Name",
212            "width" : 400,
213            "$ renderer" : "function(v) { return String.format('{0}', v); }",
214            "$ xns" : "Roo.grid",
215            "Boolean sortable" : true,
216            "* prop" : "colModel[]",
217            "dataIndex" : "from_name"
218           },
219           {
220            "xtype" : "ColumnModel",
221            "header" : "From Email",
222            "width" : 400,
223            "$ renderer" : "function(v) { return String.format('{0}', v); }",
224            "$ xns" : "Roo.grid",
225            "Boolean sortable" : true,
226            "* prop" : "colModel[]",
227            "dataIndex" : "from_email"
228           }
229          ]
230         }
231        ]
232       },
233       {
234        "listeners" : {
235         "render" : "function (_self)\n{\n    _this.viewPanel = _self;\n}"
236        },
237        "autoScroll" : true,
238        "background" : false,
239        "fitToFrame" : true,
240        "region" : "south",
241        "title" : "View Message",
242        "xtype" : "ContentPanel",
243        "fitContainer" : true,
244        "$ xns" : "Roo",
245        "items" : [
246         {
247          "listeners" : {
248           "preparedata" : "function (_self, data, i, rec)\n{\n   // Roo.log(data);\n    //Roo.apply(data, rec.json);\n}"
249          },
250          "$ tpl" : "new Roo.DomTemplate({url : rootURL+'/Pman/Crm/domtemplates/crm_mail.html'})",
251          "xtype" : "View",
252          "$ xns" : "Roo",
253          "* prop" : "view",
254          "items" : [
255           {
256            "listeners" : {
257             "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}",
258             "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}"
259            },
260            "xtype" : "Store",
261            "$ xns" : "Roo.data",
262            "* prop" : "store",
263            "items" : [
264             {
265              "$ url" : "baseURL+'/Roo/Core_email.php'",
266              "xtype" : "HttpProxy",
267              "method" : "GET",
268              "$ xns" : "Roo.data",
269              "* prop" : "proxy"
270             },
271             {
272              "id" : "id",
273              "root" : "data",
274              "xtype" : "JsonReader",
275              "$ xns" : "Roo.data",
276              "* prop" : "reader",
277              "totalProperty" : "total"
278             }
279            ]
280           }
281          ]
282         }
283        ]
284       }
285      ]
286     }
287    ]
288   }
289  ]
290 }