Pman.Dialog.BAdminEmail.bjs
[Pman.BAdmin] / Pman.Dialog.BAdminEmail.bjs
1 {
2  "name" : "Pman.Dialog.BAdminEmail",
3  "parent" : "",
4  "title" : "Pman.Dialog.BAdminEmail",
5  "path" : "/home/benny/gitlive/web.coba/Pman.BAdmin/Pman.Dialog.BAdminEmail.bjs",
6  "permname" : "",
7  "modOrder" : "001",
8  "strings" : {
9   "843627586c62e389041a4d8800143974" : "Searching",
10   "2c466a2c159463f1d9ef5a7b57b52827" : "Select BCC Group",
11   "396ecabf0cd1f9503e591418851ef406" : "Edit / Create Message",
12   "3858712080cb3d846ea206d1d1070674" : "Test Class (for system reference only):",
13   "31fde7b05ac8952dacf4af8a704074ec" : "Preview",
14   "5b8ef4e762c00a15a41cfc26dc3ef99c" : "Send me a test copy",
15   "4182c8f19d40c7ca236a5f4f83faeb6b" : "Unsubscribe",
16   "b2bce8099bf8e6f51345bee5c9015c89" : "Convert HTML to Plain Text",
17   "ea4788705e6873b424c65e91c2846b19" : "Cancel",
18   "c4ca4238a0b923820dcc509a6f75849b" : "1",
19   "1e6d57e813355689e9c77e947d73ad8f" : "From:",
20   "292f75d54a6892cfe18a93e64230112a" : "Mailout Name:",
21   "47a0be8d1015d526a1fbaa56c3102135" : "Subject:",
22   "5feb9bf3c03b32635135006cbacb9542" : "Insert Field",
23   "7038eac66e387c3b3a0834d786a88757" : "Insert Image",
24   "e71c729cd7f3c6b6ebdb447e65952dfd" : "From email address:",
25   "edddfc18b2ffb806573a1b3f341832cd" : "BCC to Group:",
26   "bd88a20b53a47f7b5704a83a15ff5506" : "Saved Version",
27   "e44b145bd8b49b06e0ad2ced1ad56466" : "Plain Text",
28   "c9cc8cce247e49bae79f15173ce97354" : "Save",
29   "49ee3087348e8d44e1feda1917443987" : "Name",
30   "28690be026c0bb9003aa58e45e5662ca" : "Enabled - will be sent out",
31   "fb981fe689fbec75c6531eb7410971f4" : "To group:",
32   "e05f77bdf3f659c1fd354a88526c03da" : "Select Group",
33   "36a65bbd12f7586ea1f9b0be4e8848aa" : "HTML Editor"
34  },
35  "items" : [
36   {
37    "listeners" : {
38     "show" : "function (_self)\n{\n\n}",
39     "render" : "function (_self)\n{\n\n}",
40     "hide" : "function (_self)\n{\n    if(_this.autosave) {\n        \n        clearInterval(_this.autosave);\n    }\n}"
41    },
42    "string fitwindow" : true,
43    "String cls" : "modal-body-enable-overflow-y",
44    "xtype" : "Modal",
45    "$ xns" : "Roo.bootstrap",
46    "String title" : "Edit / Create Message",
47    "items" : [
48     {
49      "listeners" : {
50       "click" : "function (_self, e)\n{\n    var id = _this.form.findField('id').getValue();\n    \n    if(id*1 < 1){\n        Roo.bootstrap.MessageBox.alert('Error', 'Please save the message first!');\n        return;\n    }\n   \n    new Pman.Request({\n        url : baseURL + '/Core/MessagePreview',\n        method : 'POST',\n        mask: 'Sending',\n        params : {\n            _id : id,\n            _table : _this.data.module\n        }, \n        success : function(res) {\n            if(res.data == 'SUCCESS'){\n                Roo.bootstrap.MessageBox.alert(\"Email Sent\", 'The report was sent to your email (HTML format).');\n            }\n        }\n    });\n}"
51      },
52      "xtype" : "Button",
53      "$ xns" : "Roo.bootstrap",
54      "String html" : "Send me a test copy",
55      "* prop" : "buttons[]",
56      "string name" : "send",
57      "$ String weight" : "'default'"
58     },
59     {
60      "listeners" : {
61       "click" : "function (_self, e)\n{\n    Pman.Dialog.BAdminEmailPreview.show({ id : _this.form.findField('id').getValue(), module : _this.data.module });\n}"
62      },
63      "xtype" : "Button",
64      "$ xns" : "Roo.bootstrap",
65      "String html" : "Preview",
66      "* prop" : "buttons[]",
67      "string name" : "preview",
68      "$ String weight" : "'default'"
69     },
70     {
71      "listeners" : {
72       "click" : "function (_self, e)\n{\n    _this.dialog.hide();\n}"
73      },
74      "xtype" : "Button",
75      "$ xns" : "Roo.bootstrap",
76      "String html" : "Cancel",
77      "* prop" : "buttons[]",
78      "string name" : "cancel",
79      "$ String weight" : "'default'"
80     },
81     {
82      "listeners" : {
83       "click" : "function (_self, e)\n{\n    _this.form.preValidate(function(res) {\n        if (!res) {\n            return; //failed.\n        }\n    });\n}"
84      },
85      "xtype" : "Button",
86      "$ xns" : "Roo.bootstrap",
87      "String html" : "Save",
88      "* prop" : "buttons[]",
89      "string name" : "save",
90      "$ String weight" : "'primary'"
91     },
92     {
93      "xtype" : "Container",
94      "$ xns" : "Roo.bootstrap",
95      "items" : [
96       {
97        "listeners" : {
98         "actionfailed" : "function (_self, action)\n{\n\n   var displayErr = function() {\n       if(action.result.errorMsg.length >= 200) {\n           Roo.bootstrap.MessageBox.alert(\"Error\", action.result.errorMsg.substring(0,199) + '...');\n       } else {\n           Roo.bootstrap.MessageBox.alert(\"Error\", action.result.errorMsg);\n       }\n   }\n   switch(action.failureType) {\n    case Roo.form.Action.SERVER_INVALID: \n       if(action.result.errors.errcode) {\n           switch (action.result.errors.errcode) {\n               case 100:\n                   Roo.bootstrap.MessageBox.buttonText.yes = \"try\";\n                   Roo.bootstrap.MessageBox.buttonText.no = \"tryno\";\n                   Roo.bootstrap.MessageBox.confirm('Confirm Save', 'No member found in To Group: ' + _this.combo_to_group.getRawValue() ,function(ret) {\n                       if(ret == 'no'){\n                           return;\n                       }\n                       _this.form.findField('_ignore_group_count').setValue('1');\n                       _this.form.doAction(\"submit\");                       \n                   }, this);\n                   \n               break;\n               \n               default:\n                   displayErr();\n                   break;\n           }\n           return;\n       }\n       displayErr();\n       \n       break;\n    case Roo.form.Action.CLIENT_INVALID: //for validation\n       break;\n    case Roo.form.Action.CONNECT_FAILURE:\n       Roo.bootstrap.MessageBox.alert(\"Connect Error\", action.result.errorMsg);\n       break;\n    default: \n       Roo.bootstrap.MessageBox.alert(\"Error\", action.result.errorMsg);\n       break;\n       \n    }\n}",
99         "actioncomplete" : "function(_self,action)\n{\n   \n    if (action.type == 'setdata') {\n        \n        _this.data.module = _this.data.module || 'crm_mailing_list_message';\n        this.url = baseURL + '/Roo/' + _this.data.module;\n        \n        if(_this.data.id*1 > 0){\n            _this.dialog.el.mask(\"Loading\");\n            this.doAction(\n                'load',\n                { method: 'GET', params: { '_id' : _this.data.id, '_with_css' : 1 }}\n            );\n            return;\n        }\n        \n        this.findField('name').setDisabled(false);\n        this.findField('test_class').setDisabled(false);\n        \n        this.reset();\n        \n        this.findField('to_group_id').setValue(-1);\n        this.findField('bodytext').setValue('');\n        \n        this.setValues({\n            'from_name' : Pman.Login.authUser.name,\n            'from_email' : Pman.Login.authUser.email\n        });\n        \n        this.clearInvalid();\n        \n        this.hideshow();\n        \n        return;\n    }\n    \n    if (action.type == 'load') {\n        \n        this.findField('name').setDisabled(false);\n        this.findField('test_class').setDisabled(false);\n        \n        if(action.result.data['is_system'] == 1) {\n            this.findField('name').setDisabled(true);\n            this.findField('test_class').setDisabled(true);\n        }\n        \n        _this.dialog.el.unmask();\n        \n        this.findField('bodytext').originalValue = this.findField('bodytext').getValue();\n        \n        _this.form_data = action.result.data;\n        \n        if(_this.form_data._css && _this.form_data._css.length){\n            _this.htmleditor.editorcore.setStyle(_this.form_data._css);\n        }\n        \n        this.findField('_ignore_group_count').setValue('0');\n        \n        this.hideshow();\n        \n        return;\n    }\n    \n    if (action.type =='submit') {\n    \n        _this.dialog.el.unmask();\n        _this.dialog.hide();\n        \n         if (_this.callback) {\n            _this.callback.call(_this, action.result.data);\n         }\n         \n         this.reset();\n         \n         return;\n    }\n}\n",
100         "render" : "function (_self)\n{\n    _this.form = this;\n}"
101        },
102        "| function hideshow" : "function()\n{\n    _this.to_group_row.hide();\n    \n    if (this.findField('to_group_id').getValue() == -1) {\n        return;\n    }\n    \n    _this.to_group_row.show();\n}",
103        "$ string preValidate" : "function(done_callback) {\n    \n    if(!_this.form.findField('bodytext').editorcore.sourceEditMode){\n        _this.form.findField('bodytext').syncValue();\n    }else{\n        _this.form.findField('bodytext').pushValue();\n    }\n    \n    var html = _this.form.findField('bodytext').getValue();\n    \n    var s = Roo.get(_this.form.findField('bodytext').editorcore.doc.documentElement);\n    \n    var ontable = (_this.data.module) ? _this.data.module : 'crm_mailing_list_message';\n    \n    \n    var nodes = [];\n    \n    s.select('img[src]').each(function(i) {\n        nodes.push(i.dom);\n    });\n    \n    \n    var total = nodes.length;\n    \n    var mkimg = function() {\n        if (!nodes.length) {\n              _this.form.findField('bodytext').syncValue();\n              done_callback(true);\n              _this.form.doAction(\"submit\");\n              return;\n        }\n        var i = nodes.pop(); \n        \n        var n = i.getAttribute('src').match(/(baseURL|server_baseurl)/);\n        \n        if(n){\n            mkimg();\n            return;\n        }\n        \n        n = i.getAttribute('src').match(/^http(.*)/);\n       \n        if(!n ){\n            mkimg();\n            return;\n        }\n        \n        \n        \n        new Pman.Request({\n            url : baseURL + '/Roo/Images.php',\n            method : 'POST',\n            params : {\n                onid : _this.form.findField('id').getValue(),\n                ontable : ontable ,\n                _remote_upload : i.src\n            },\n            success : function(res){\n                if(res.success == true){      \n                    i.setAttribute('src', res.data);\n                }\n                mkimg();\n            }\n        });\n       \n    }\n    mkimg();\n}\n",
104        "xtype" : "Form",
105        "$ xns" : "Roo.bootstrap",
106        "String method" : "POST",
107        "string errorMask" : true,
108        "$ String url" : "baseURL + '/Roo/crm_mailing_list_message.php'",
109        "items" : [
110         {
111          "xtype" : "Row",
112          "$ xns" : "Roo.bootstrap",
113          "items" : [
114           {
115            "Number md" : 8,
116            "xtype" : "Column",
117            "Number xs" : 12,
118            "$ xns" : "Roo.bootstrap",
119            "items" : [
120             {
121              "Boolean allowBlank" : false,
122              "String name" : "name",
123              "xtype" : "Input",
124              "string fieldLabel" : "Mailout Name:",
125              "$ xns" : "Roo.bootstrap",
126              "Number labelWidth" : 3,
127              "String indicatorpos" : "right"
128             }
129            ]
130           },
131           {
132            "Number md" : 4,
133            "xtype" : "Column",
134            "$ xns" : "Roo.bootstrap",
135            "items" : [
136             {
137              "listeners" : {
138               "check" : "function (_self, checked)\n{\n    var boxLabel = 'Enabled - will be sent out';\n    \n    if(!checked){\n        boxLabel = 'Disabled - will NOT be sent out';\n    }\n    \n    //this.setBoxLabel(boxLabel);\n}"
139              },
140              "String name" : "active",
141              "Boolean checked" : true,
142              "xtype" : "CheckBox",
143              "String valueOff" : 0,
144              "String boxLabel" : "Enabled - will be sent out",
145              "$ xns" : "Roo.bootstrap",
146              "string value" : 1,
147              "String indicatorpos" : "right"
148             }
149            ]
150           }
151          ]
152         },
153         {
154          "xtype" : "Row",
155          "$ xns" : "Roo.bootstrap",
156          "items" : [
157           {
158            "Number md" : 6,
159            "xtype" : "Column",
160            "Number xs" : 12,
161            "$ xns" : "Roo.bootstrap",
162            "string name" : "from_name",
163            "items" : [
164             {
165              "Boolean allowBlank" : false,
166              "String name" : "from_name",
167              "xtype" : "Input",
168              "string fieldLabel" : "From:",
169              "$ xns" : "Roo.bootstrap",
170              "Number labelWidth" : 4,
171              "String indicatorpos" : "right"
172             }
173            ]
174           },
175           {
176            "Number md" : 6,
177            "xtype" : "Column",
178            "Number xs" : 12,
179            "$ xns" : "Roo.bootstrap",
180            "items" : [
181             {
182              "Boolean allowBlank" : false,
183              "String name" : "from_email",
184              "xtype" : "Input",
185              "string fieldLabel" : "From email address:",
186              "$ xns" : "Roo.bootstrap",
187              "String vtype" : "email",
188              "Number labelWidth" : 4,
189              "String indicatorpos" : "right"
190             }
191            ]
192           }
193          ]
194         },
195         {
196          "xtype" : "Row",
197          "$ xns" : "Roo.bootstrap",
198          "items" : [
199           {
200            "listeners" : {
201             "render" : "function (_self)\n{\n    _this.to_group_row = this;\n}"
202            },
203            "Number md" : 6,
204            "xtype" : "Column",
205            "Number xs" : 12,
206            "$ xns" : "Roo.bootstrap",
207            "items" : [
208             {
209              "listeners" : {
210               "render" : "function (_self)\n{\n    _this.combo_to_group = _self;\n}"
211              },
212              "Boolean allowBlank" : true,
213              "String loadingText" : "Searching",
214              "Number pageSize" : 20,
215              "String name" : "to_group_id_name",
216              "Number minChars" : 2,
217              "String valueField" : "id",
218              "Boolean typeAhead" : true,
219              "xtype" : "ComboBox",
220              "Boolean editable" : false,
221              "String triggerAction" : "all",
222              "String labelAlign" : "left",
223              "string fieldLabel" : "To group:",
224              "Boolean alwaysQuery" : true,
225              "string placeholder" : "Select Group",
226              "$ xns" : "Roo.bootstrap",
227              "Number labelWidth" : 4,
228              "String hiddenName" : "to_group_id",
229              "String displayField" : "name",
230              "Boolean forceSelection" : true,
231              "String indicatorpos" : "right",
232              "items" : [
233               {
234                "listeners" : {
235                 "beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    \n    o.params._direct_return = 1;\n}\n"
236                },
237                "$ Object sortInfo" : "{ direction : 'ASC', field: 'name' }",
238                "xtype" : "Store",
239                "boolean remoteSort" : true,
240                "$ xns" : "Roo.data",
241                "* prop" : "store",
242                "items" : [
243                 {
244                  "xtype" : "HttpProxy",
245                  "$ xns" : "Roo.data",
246                  "String method" : "GET",
247                  "* prop" : "proxy",
248                  "$ String url" : "baseURL + '/Roo/Core_group'"
249                 },
250                 {
251                  "$ Array fields" : "[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"id\",\"type\":\"int\"}]",
252                  "xtype" : "JsonReader",
253                  "String root" : "data",
254                  "$ xns" : "Roo.data",
255                  "String id" : "name",
256                  "* prop" : "reader",
257                  "String totalProperty" : "total"
258                 }
259                ]
260               }
261              ]
262             }
263            ]
264           },
265           {
266            "Number md" : 6,
267            "xtype" : "Column",
268            "Number xs" : 12,
269            "$ xns" : "Roo.bootstrap",
270            "items" : [
271             {
272              "Boolean allowBlank" : true,
273              "String loadingText" : "Searching",
274              "Number pageSize" : 20,
275              "String name" : "bcc_group_id_name",
276              "Number minChars" : 2,
277              "String valueField" : "id",
278              "Boolean typeAhead" : true,
279              "xtype" : "ComboBox",
280              "Boolean editable" : false,
281              "String triggerAction" : "all",
282              "String labelAlign" : "left",
283              "string fieldLabel" : "BCC to Group:",
284              "Boolean alwaysQuery" : true,
285              "string placeholder" : "Select BCC Group",
286              "$ xns" : "Roo.bootstrap",
287              "Number labelWidth" : 4,
288              "String hiddenName" : "bcc_group_id",
289              "String displayField" : "name",
290              "Boolean forceSelection" : true,
291              "String indicatorpos" : "right",
292              "items" : [
293               {
294                "listeners" : {
295                 "beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    \n    o.params._direct_return = 1;\n}\n"
296                },
297                "$ Object sortInfo" : "{ direction : 'ASC', field: 'name' }",
298                "xtype" : "Store",
299                "boolean remoteSort" : true,
300                "$ xns" : "Roo.data",
301                "* prop" : "store",
302                "items" : [
303                 {
304                  "xtype" : "HttpProxy",
305                  "$ xns" : "Roo.data",
306                  "String method" : "GET",
307                  "* prop" : "proxy",
308                  "$ String url" : "baseURL + '/Roo/Core_group'"
309                 },
310                 {
311                  "$ Array fields" : "[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"id\",\"type\":\"int\"}]",
312                  "xtype" : "JsonReader",
313                  "String root" : "data",
314                  "$ xns" : "Roo.data",
315                  "String id" : "name",
316                  "* prop" : "reader",
317                  "String totalProperty" : "total"
318                 }
319                ]
320               }
321              ]
322             }
323            ]
324           }
325          ]
326         },
327         {
328          "xtype" : "Row",
329          "$ xns" : "Roo.bootstrap",
330          "items" : [
331           {
332            "Number md" : 12,
333            "xtype" : "Column",
334            "Number xs" : 12,
335            "$ xns" : "Roo.bootstrap",
336            "items" : [
337             {
338              "Boolean allowBlank" : false,
339              "String name" : "subject",
340              "xtype" : "Input",
341              "string fieldLabel" : "Subject:",
342              "$ xns" : "Roo.bootstrap",
343              "Number labelWidth" : 2,
344              "String indicatorpos" : "right"
345             }
346            ]
347           }
348          ]
349         },
350         {
351          "xtype" : "Row",
352          "$ xns" : "Roo.bootstrap",
353          "items" : [
354           {
355            "Number md" : 12,
356            "xtype" : "Column",
357            "$ xns" : "Roo.bootstrap",
358            "items" : [
359             {
360              "String header" : "HTML Editor",
361              "String panel" : "default",
362              "xtype" : "Container",
363              "$ xns" : "Roo.bootstrap",
364              "items" : [
365               {
366                "listeners" : {
367                 "savedpreview" : "function (_self)\n{\n    var id = _this.form.findField('id').getValue() * 1;\n    \n    var successFn = function(res){\n        return res.data.POST.source;\n    };\n    \n    var params = {\n        action : 'AUTOSAVE',\n        remarks : 'BODY',\n        on_id : (id < 1) ? 0 : id,\n        on_table : 'core_email',\n        successFn : successFn\n    };\n    \n    \n    Pman.Dialog.BAdminAutoSavePreview.show(params, function(res){\n        _self.setValue(res);\n        _self.originalValue = res;\n    });\n}",
368                 "render" : "function (_self)\n{\n    _this.htmleditor = this;\n}",
369                 "autosave" : "function (_self)\n{\n    Roo.log('autosave');\n    \n    var id = _this.form.findField('id').getValue() * 1;\n    \n    new Pman.Request({\n        url : baseURL + '/Roo/Events.php',\n        method :'POST',\n        params : {\n            id : 0,\n            action : 'AUTOSAVE',\n            on_id : (id > 0) ? id : 0,\n            on_table : 'crm_mailing_list_message',\n            remarks : 'BODY',\n            source: _self.getValue()\n        },\n        success : function() {\n            _self.originalValue = _self.getValue();\n            \n        },\n        failure : function() \n        {\n            Roo.log('body autosave failed?!');\n        }\n    });\n    \n}"
370                },
371                "String name" : "bodytext",
372                "String bodyCls" : "roo-email",
373                "xtype" : "HtmlEditor",
374                "$ xns" : "Roo.bootstrap",
375                "Array stylesheets" : "",
376                "items" : [
377                 {
378                  "listeners" : {
379                   "click" : "function (_self, e)\n{\n    if (!_this.form.findField('bodytext').editorcore.activated) {\n        Roo.bootstrap.MessageBox.alert('Cannot add any image', 'Please select a place in the belowing text area where the image will insert at');\n        return;\n    }\n    \n    var id = _this.form.findField('id').getValue();\n    \n    if(id*1 < 1){\n        Roo.bootstrap.MessageBox.alert('Cannot add any image', 'Please save the email template first');\n        return;\n    }\n    \n    var ontable = (_this.data.module) ? _this.data.module : 'crm_mailing_list_message';\n    \n    Pman.Dialog.BAdminImageManager.show({\n        id : 0,\n        onid: id,\n        ontable: ontable\n    });\n    \n}"
380                  },
381                  "Boolean toggle" : false,
382                  "xtype" : "Button",
383                  "$ xns" : "Roo.bootstrap",
384                  "String glyphicon" : "camera",
385                  "String html" : "Insert Image",
386                  "* prop" : "btns[]"
387                 },
388                 {
389                  "Boolean toggle" : false,
390                  "$ String glyphicon" : "'tag'",
391                  "xtype" : "Button",
392                  "$ xns" : "Roo.bootstrap",
393                  "String html" : "Insert Field",
394                  "* prop" : "btns[]",
395                  "items" : [
396                   {
397                    "xtype" : "Menu",
398                    "$ xns" : "Roo.bootstrap",
399                    "* prop" : "menu",
400                    "items" : [
401                     {
402                      "listeners" : {
403                       "click" : "function (_self, e)\n{\n    if (!_this.form.findField('bodytext').editorcore.activated) {\n        Roo.bootstrap.MessageBox.alert('Cannot add the name tag', 'Please select a place in the belowing text area where the tag will insert at');\n        return;\n    }\n    \n    _this.form.findField('bodytext').editorcore.insertAtCursor(\n        String.format('{0}',\n            '{person.name}'\n        )\n    );\n}"
404                      },
405                      "xtype" : "MenuItem",
406                      "$ xns" : "Roo.bootstrap",
407                      "String html" : "Name"
408                     },
409                     {
410                      "listeners" : {
411                       "click" : "function (_self, e)\n{\n    if (!_this.form.findField('bodytext').editorcore.activated) {\n        Roo.bootstrap.MessageBox.alert('Cannot add the unsubscribe tag', 'Please select a place in the belowing text area where the tag will insert at');\n        return;\n    }\n    \n    _this.form.findField('bodytext').editorcore.insertAtCursor(\n        String.format('<a href=\"{0}\">{1}</a>',\n            '#unsubscribe',  \"Unsubscribe\"\n        )\n    );\n}"
412                      },
413                      "xtype" : "MenuItem",
414                      "$ xns" : "Roo.bootstrap",
415                      "String html" : "Unsubscribe"
416                     }
417                    ]
418                   }
419                  ]
420                 },
421                 {
422                  "listeners" : {
423                   "click" : "function (_self, e)\n{\n    var h = _this.form.findField('bodytext').getValue();\n    var p = _this.form.findField('plaintext');\n    \n    new Pman.Request({\r\n        url : baseURL + '/Core/ImportMailMessage.php',\r\n        method : 'POST',\r\n        params : {\n          bodytext : h,\r\n          _convertToPlain : true,\n          _check_unsubscribe : true\r\n        }, \r\n        success : function(res) {\r\n            if(res.success == true){\n               p.setValue(res.data);\n            }\r\n        }\r\n    });\n    \n}"
424                  },
425                  "Boolean toggle" : false,
426                  "$ String glyphicon" : "'refresh'",
427                  "xtype" : "Button",
428                  "$ xns" : "Roo.bootstrap",
429                  "String html" : "Convert HTML to Plain Text",
430                  "* prop" : "btns[]"
431                 },
432                 {
433                  "listeners" : {
434                   "click" : "function (_self, e)\n{\n    this.scope.owner.fireEvent('savedpreview', this.scope.owner);\n}"
435                  },
436                  "Boolean toggle" : false,
437                  "$ String glyphicon" : "'floppy-disk'",
438                  "xtype" : "Button",
439                  "$ xns" : "Roo.bootstrap",
440                  "String html" : "Saved Version",
441                  "* prop" : "btns[]"
442                 }
443                ]
444               }
445              ]
446             }
447            ]
448           }
449          ]
450         },
451         {
452          "listeners" : {
453           "click" : "function (_self, e)\n{\n    var h = _this.form.findField('bodytext').getValue();\n    var p = _this.form.findField('plaintext');\n    \n    new Pman.Request({\r\n        url : baseURL + '/Core/ImportMailMessage.php',\r\n        method : 'POST',\r\n        params : {\n          bodytext : h,\r\n          _convertToPlain : true,\n          _check_unsubscribe : true\r\n        }, \r\n        success : function(res) {\r\n            if(res.success == true){\n               p.setValue(res.data);\n            }\r\n        }\r\n    });\n    \n}"
454          },
455          "xtype" : "Row",
456          "$ xns" : "Roo.bootstrap",
457          "items" : [
458           {
459            "Number md" : 12,
460            "xtype" : "Column",
461            "$ xns" : "Roo.bootstrap",
462            "items" : [
463             {
464              "String header" : "Plain Text",
465              "$ String panel" : "'default'",
466              "xtype" : "Container",
467              "$ xns" : "Roo.bootstrap",
468              "items" : [
469               {
470                "String name" : "plaintext",
471                "xtype" : "TextArea",
472                "$ xns" : "Roo.bootstrap"
473               }
474              ]
475             }
476            ]
477           }
478          ]
479         },
480         {
481          "xtype" : "Row",
482          "$ xns" : "Roo.bootstrap",
483          "items" : [
484           {
485            "Number md" : 12,
486            "xtype" : "Column",
487            "$ xns" : "Roo.bootstrap",
488            "items" : [
489             {
490              "String name" : "test_class",
491              "xtype" : "Input",
492              "string fieldLabel" : "Test Class (for system reference only):",
493              "String labelAlign" : "top",
494              "$ xns" : "Roo.bootstrap"
495             }
496            ]
497           }
498          ]
499         },
500         {
501          "String name" : "id",
502          "xtype" : "Input",
503          "String inputType" : "hidden",
504          "$ xns" : "Roo.bootstrap",
505          "Number labelWidth" : 3
506         },
507         {
508          "String name" : "_ignore_group_count",
509          "xtype" : "Input",
510          "String inputType" : "hidden",
511          "$ xns" : "Roo.bootstrap",
512          "Number labelWidth" : 3
513         }
514        ]
515       }
516      ]
517     }
518    ]
519   }
520  ]
521 }