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