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