sync
[Pman.Admin] / Pman.Tab.AdminEmailTemplates.bjs
1 {
2  "items" : [
3   {
4    "$ xns" : "Roo",
5    "items" : [
6     {
7      "$ xns" : "Roo",
8      "* prop" : "layout",
9      "items" : [
10       {
11        "$ xns" : "Roo",
12        "* prop" : "center",
13        "autoScroll" : false,
14        "split" : true,
15        "xtype" : "LayoutRegion"
16       },
17       {
18        "$ xns" : "Roo",
19        "* prop" : "south",
20        "height" : 300,
21        "split" : true,
22        "titlebar" : true,
23        "xtype" : "LayoutRegion"
24       },
25       {
26        "$ xns" : "Roo",
27        "background" : true,
28        "fitContainer" : true,
29        "fitToframe" : true,
30        "items" : [
31         {
32          "$ xns" : "Roo.grid",
33          "* prop" : "grid",
34          "autoExpandColumn" : "subject",
35          "items" : [
36           {
37            "$ xns" : "Roo.grid",
38            "* prop" : "sm",
39            "singleSelect" : true,
40            "xtype" : "RowSelectionModel"
41           },
42           {
43            "$ sortInfo" : "{ field : 'description', direction: 'ASC' }",
44            "$ xns" : "Roo.data",
45            "* prop" : "dataSource",
46            "items" : [
47             {
48              "$ url" : "baseURL + '/Roo/Core_email.php'",
49              "$ xns" : "Roo.data",
50              "* prop" : "proxy",
51              "method" : "GET",
52              "xtype" : "HttpProxy"
53             },
54             {
55              "$ fields" : [
56               "[",
57               "    {",
58               "        \"name\":\"name\",",
59               "        \"type\":\"string\"",
60               "    },",
61               "    {",
62               "        \"name\":\"subject\",",
63               "        \"type\":\"string\"",
64               "    }",
65               "]"
66              ],
67              "$ xns" : "Roo.data",
68              "* prop" : "reader",
69              "id" : "id",
70              "root" : "data",
71              "totalProperty" : "total",
72              "xtype" : "JsonReader"
73             }
74            ],
75            "listeners" : {
76             "beforeload" : [
77              "function (_self, options)",
78              "{",
79              "    options.params = options.params || {};",
80              "    ",
81              "    var s = _this.searchBox.getValue();",
82              "    ",
83              "    if(s.length){",
84              "        options.params['search[nameortitle]'] = s;",
85              "    }",
86              "",
87              "}"
88             ]
89            },
90            "remoteSort" : true,
91            "xtype" : "Store"
92           },
93           {
94            "$ xns" : "Roo",
95            "* prop" : "footer",
96            "displayInfo" : true,
97            "displayMsg" : "Displaying Message{0} - {1} of {2}",
98            "emptyMsg" : "Nothing found",
99            "items" : [
100             {
101              "$ xns" : "Roo.Toolbar",
102              "listeners" : {
103               "|click" : [
104                "function()",
105                "{",
106                "   ",
107                "new Pman.Download({",
108                "    url : baseURL + '/Roo/Core_email',",
109                "    method : 'GET',",
110                "    params : {",
111                "        csvCols : '*',",
112                "        csvTitles : '*'",
113                "    }",
114                "});",
115                "Roo.MessageBox.alert(\"Notice\", \"Should be downloading now\");",
116                "  ",
117                "}",
118                ""
119               ]
120              },
121              "text" : "Download to Excel",
122              "xtype" : "Button"
123             }
124            ],
125            "pageSize" : 25,
126            "xtype" : "PagingToolbar"
127           },
128           {
129            "$ xns" : "Roo",
130            "* prop" : "toolbar",
131            "items" : [
132             {
133              "$ xns" : "Roo.form",
134              "listeners" : {
135               "render" : [
136                "function (_self)",
137                "{",
138                "    _this.searchBox = _self;",
139                "}"
140               ],
141               "specialkey" : [
142                "function (_self, e)",
143                "{",
144                "  _this.grid.footer.onClick('first');",
145                "}"
146               ]
147              },
148              "xtype" : "TextField"
149             },
150             {
151              "$ icon" : "rootURL + '/Pman/templates/images/search.gif'",
152              "$ xns" : "Roo.Toolbar",
153              "cls" : "x-btn-icon",
154              "listeners" : {
155               "click" : [
156                "function (_self, e)",
157                "{",
158                "    _this.grid.footer.onClick('first');",
159                "}"
160               ]
161              },
162              "xtype" : "Button"
163             },
164             {
165              "$ icon" : "rootURL + '/Pman/templates/images/edit-clear.gif'",
166              "$ xns" : "Roo.Toolbar",
167              "cls" : "x-btn-icon",
168              "listeners" : {
169               "click" : [
170                "function (_self, e)",
171                "{",
172                "    _this.searchBox.setValue('');\r",
173                "    _this.grid.footer.onClick('first');\r",
174                "}"
175               ]
176              },
177              "xtype" : "Button"
178             },
179             {
180              "$ xns" : "Roo.Toolbar",
181              "xtype" : "Fill"
182             },
183             {
184              "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
185              "$ xns" : "Roo.Toolbar",
186              "cls" : "x-btn-text-icon",
187              "listeners" : {
188               "|click" : [
189                "function()",
190                "{",
191                "  var sel = _this.grid.selModel.getSelected();",
192                "  if (!sel) {",
193                "        Roo.MessageBox.alert(\"Error\", \"Select a message to copy\");",
194                "        return;",
195                "    }",
196                "new Pman.Request({",
197                "    url : baseURL + '/Roo/Core_email',",
198                "    method : 'POST',",
199                "    params : {",
200                "        id : sel.data.id,",
201                "        _make_copy : 1",
202                "    },",
203                "    success : function() {",
204                "        _this.grid.footer.onClick('refresh');",
205                "    }",
206                "});",
207                "  ",
208                "}",
209                ""
210               ]
211              },
212              "text" : "Copy",
213              "xtype" : "Button"
214             },
215             {
216              "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
217              "$ xns" : "Roo.Toolbar",
218              "cls" : "x-btn-text-icon",
219              "listeners" : {
220               "|click" : [
221                "function()",
222                "{",
223                "    if (!_this.dialog) {",
224                "         return;",
225                "         }",
226                "    _this.dialog.show( { id : 0, module : 'core_email' } , function() {",
227                "        _this.grid.footer.onClick('first');",
228                "   }); ",
229                "}",
230                ""
231               ]
232              },
233              "text" : "Add",
234              "xtype" : "Button"
235             },
236             {
237              "$ xns" : "Roo.Toolbar",
238              "xtype" : "Separator"
239             },
240             {
241              "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'",
242              "$ xns" : "Roo.Toolbar",
243              "cls" : "x-btn-text-icon",
244              "listeners" : {
245               "|click" : [
246                "function()",
247                "{",
248                "    Pman.genericDelete(_this, 'core_email');",
249                "    ",
250                "}",
251                ""
252               ]
253              },
254              "text" : "Delete",
255              "xtype" : "Button"
256             }
257            ],
258            "xtype" : "Toolbar"
259           },
260           {
261            "$ renderer" : [
262             "function(v,x,r) ",
263             "{ ",
264             "    if (r.data.description.length > 0) {",
265             "        v = r.data.description;",
266             "    }",
267             "    ",
268             "    ",
269             "    if(r.data.active * 1 < 1){",
270             "        return String.format('<s>{0}</s>', v ? v : ''); ",
271             "    }",
272             "    ",
273             "    return String.format('{0}', v ? v : ''); ",
274             "}"
275            ],
276            "$ xns" : "Roo.grid",
277            "* prop" : "cm[]",
278            "Boolean sortable" : true,
279            "dataIndex" : "name",
280            "header" : "Name",
281            "width" : 250,
282            "xtype" : "ColumnModel"
283           },
284           {
285            "$ renderer" : [
286             "function(v,x,r) ",
287             "{ ",
288             "    if(r.data.active * 1 < 1){",
289             "        return String.format('<s>{0}</s>', v ? v : ''); ",
290             "    }",
291             "    ",
292             "    return String.format('{0}', v ? v : ''); ",
293             "}"
294            ],
295            "$ xns" : "Roo.grid",
296            "* prop" : "cm[]",
297            "Boolean sortable" : true,
298            "dataIndex" : "subject",
299            "header" : "Title",
300            "width" : 300,
301            "xtype" : "ColumnModel"
302           },
303           {
304            "$ renderer" : "function(v) { return String.format('{0}', v ? v : ''); }",
305            "$ xns" : "Roo.grid",
306            "* prop" : "cm[]",
307            "Boolean sortable" : true,
308            "dataIndex" : "from_name",
309            "header" : "From Name",
310            "width" : 150,
311            "xtype" : "ColumnModel"
312           },
313           {
314            "$ renderer" : "function(v) { return String.format('{0}', v ? v : ''); }",
315            "$ xns" : "Roo.grid",
316            "* prop" : "cm[]",
317            "Boolean sortable" : true,
318            "dataIndex" : "from_email",
319            "header" : "From Email",
320            "width" : 150,
321            "xtype" : "ColumnModel"
322           },
323           {
324            "$ renderer" : "function(v) { return String.format('{0}', v ? v : ''); }",
325            "$ xns" : "Roo.grid",
326            "* prop" : "cm[]",
327            "Boolean sortable" : true,
328            "dataIndex" : "bcc_group_name",
329            "header" : "BCC Group",
330            "width" : 150,
331            "xtype" : "ColumnModel"
332           }
333          ],
334          "listeners" : {
335           "rowclick" : [
336            "function (_self, rowIndex, e)",
337            "{",
338            "   // _this.grid.ds.load({});",
339            "    _this.viewPanel.view.store.load({});",
340            "}"
341           ],
342           "|render" : [
343            "function() ",
344            "{",
345            "    _this.grid = this; ",
346            "    _this.dialog = Pman.Dialog.CoreEmail;",
347            "    if (_this.panel.active) {",
348            "       _this.grid.footer.onClick('first');",
349            "    }",
350            "}"
351           ],
352           "|rowdblclick" : [
353            "function (_self, rowIndex, e)",
354            "{",
355            "    if (!_this.dialog) { ",
356            "        return;",
357            "        }",
358            "    var data = this.getDataSource().getAt(rowIndex).data;",
359            "    _this.dialog.show( {id : data.id, module : 'core_email'} , function() {",
360            "        _this.grid.footer.onClick('first');",
361            "    }); ",
362            "}",
363            ""
364           ]
365          },
366          "loadMask" : true,
367          "xtype" : "Grid"
368         }
369        ],
370        "listeners" : {
371         "|activate" : [
372          "function() {",
373          "    _this.panel = this;",
374          "    if (_this.grid) {",
375          "        _this.grid.footer.onClick('first');",
376          "    }",
377          "}"
378         ]
379        },
380        "region" : "center",
381        "tableName" : "core_email",
382        "title" : "core_email",
383        "xtype" : "GridPanel"
384       },
385       {
386        "$ xns" : "Roo",
387        "Boolean autoScroll" : true,
388        "Boolean fitContainer" : true,
389        "Boolean fitToFrame" : true,
390        "background" : false,
391        "items" : [
392         {
393          "$ tpl" : "new Roo.DomTemplate({url : rootURL+'/Pman/Crm/domtemplates/crm_mail.html'})",
394          "$ xns" : "Roo",
395          "* prop" : "view",
396          "items" : [
397           {
398            "$ xns" : "Roo.data",
399            "* prop" : "store",
400            "items" : [
401             {
402              "$ url" : "baseURL+'/Roo/Core_email.php'",
403              "$ xns" : "Roo.data",
404              "* prop" : "proxy",
405              "method" : "GET",
406              "xtype" : "HttpProxy"
407             },
408             {
409              "$ xns" : "Roo.data",
410              "* prop" : "reader",
411              "id" : "id",
412              "root" : "data",
413              "totalProperty" : "total",
414              "xtype" : "JsonReader"
415             }
416            ],
417            "listeners" : {
418             "beforeload" : [
419              "function (_self, options)",
420              "{",
421              "    options.params = options.params || {};",
422              "    var p = _this.grid.selModel.getSelected();",
423              "    if (!p || !p.data.id) {",
424              "        this.removeAll();",
425              "        return false;",
426              "    }",
427              "   ",
428              "    options.params['id'] = p.data.id;",
429              " ",
430              "}"
431             ],
432             "load" : [
433              "function (_self, records, options)",
434              "{",
435              "    var p = _this.grid.selModel.getSelected();",
436              "  //  Roo.log(p);",
437              "    if (!p || !p.data.id) {",
438              "        this.removeAll();",
439              "        return false;",
440              "    }",
441              " ",
442              "}"
443             ]
444            },
445            "xtype" : "Store"
446           }
447          ],
448          "listeners" : {
449           "preparedata" : [
450            "function (_self, data, i, rec)",
451            "{",
452            "   // Roo.log(data);",
453            "    //Roo.apply(data, rec.json);",
454            "}"
455           ]
456          },
457          "xtype" : "View"
458         }
459        ],
460        "listeners" : {
461         "render" : [
462          "function (_self)",
463          "{",
464          "    _this.viewPanel = _self;",
465          "}"
466         ]
467        },
468        "region" : "south",
469        "title" : "View Message",
470        "xtype" : "ContentPanel"
471       }
472      ],
473      "xtype" : "BorderLayout"
474     }
475    ],
476    "listeners" : {
477     "render" : [
478      "function (_self)",
479      "{",
480      "    _this.nest = this;",
481      "}"
482     ]
483    },
484    "region" : "center",
485    "title" : "Email Template",
486    "xtype" : "NestedLayoutPanel"
487   }
488  ],
489  "modOrder" : "999",
490  "name" : "Pman.Tab.AdminEmailTemplates",
491  "parent" : "Pman.Tab.Admin",
492  "path" : "/home/alan/gitlive/Pman.Admin/Pman.Tab.AdminEmailTemplates.bjs",
493  "permname" : "",
494  "strings" : {
495   "00d6e06d2f3c092b4f5e1e708a360b0f" : "Displaying Message{0} - {1} of {2}",
496   "01bd6a16732dfa2b760dc8566c58afae" : "Download to Excel",
497   "49ee3087348e8d44e1feda1917443987" : "Name",
498   "4a4a8fe0c6dfb6bd2a41755d15eb6f0b" : "From Name",
499   "4ca679a383343ab3d4ca1cd7c91b43f7" : "From Email",
500   "5fb63579fc981698f97d55bfecb213ea" : "Copy",
501   "68b00d723d37122f64da8d9939f836f0" : "BCC Group",
502   "9076cbba1d9ef79280b4f39e2aa0d115" : "Nothing found",
503   "9e11143e29a031212f2cdefcf61f39e9" : "View Message",
504   "b78a3223503896721cca1303f776159b" : "Title",
505   "c7d299bf3f9e37c77ab646f7e5366696" : "core_email",
506   "ec211f7c20af43e742bf2570c3cb84f9" : "Add",
507   "f2a6c498fb90ee345d997f888fce3b18" : "Delete",
508   "f49559cda3fb906fbd7736f8b8a0e37d" : "Email Template"
509  },
510  "title" : "Manage Email Templates"
511 }