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