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/edward/gitlive/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   "0a5fecb1d88a50f47cc2ed2fd985c304" : "BCC Group:",
16   "4182c8f19d40c7ca236a5f4f83faeb6b" : "Unsubscribe",
17   "b2bce8099bf8e6f51345bee5c9015c89" : "Convert HTML to Plain Text",
18   "ea4788705e6873b424c65e91c2846b19" : "Cancel",
19   "c4ca4238a0b923820dcc509a6f75849b" : "1",
20   "1e6d57e813355689e9c77e947d73ad8f" : "From:",
21   "292f75d54a6892cfe18a93e64230112a" : "Mailout Name:",
22   "47a0be8d1015d526a1fbaa56c3102135" : "Subject:",
23   "5feb9bf3c03b32635135006cbacb9542" : "Insert Field",
24   "7038eac66e387c3b3a0834d786a88757" : "Insert Image",
25   "e71c729cd7f3c6b6ebdb447e65952dfd" : "From email address:",
26   "bd88a20b53a47f7b5704a83a15ff5506" : "Saved Version",
27   "e44b145bd8b49b06e0ad2ced1ad56466" : "Plain Text",
28   "c9cc8cce247e49bae79f15173ce97354" : "Save",
29   "49ee3087348e8d44e1feda1917443987" : "Name",
30   "fb981fe689fbec75c6531eb7410971f4" : "To group:",
31   "e05f77bdf3f659c1fd354a88526c03da" : "Select Group",
32   "36a65bbd12f7586ea1f9b0be4e8848aa" : "HTML Editor"
33  },
34  "items" : [
35   {
36    "listeners" : {
37     "show" : "function (_self)\n{\n\n}",
38     "render" : "function (_self)\n{\n\n}",
39     "hide" : "function (_self)\n{\n    if(_this.autosave) {\n        \n        clearInterval(_this.autosave);\n    }\n}"
40    },
41    "string fitwindow" : true,
42    "String cls" : "modal-body-enable-overflow-y",
43    "xtype" : "Modal",
44    "$ xns" : "Roo.bootstrap",
45    "String title" : "Edit / Create Message",
46    "items" : [
47     {
48      "listeners" : {
49       "click" : "function (_self, e)\n{\n    //_this.dialog.hide();\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}"
50      },
51      "xtype" : "Button",
52      "$ xns" : "Roo.bootstrap",
53      "String html" : "Send me a test copy",
54      "* prop" : "buttons[]",
55      "string name" : "send",
56      "$ String weight" : "'default'"
57     },
58     {
59      "listeners" : {
60       "click" : "function (_self, e)\n{\n    Pman.Dialog.BAdminEmailPreview.show({ id : _this.form.findField('id').getValue(), module : _this.data.module });\n}"
61      },
62      "xtype" : "Button",
63      "$ xns" : "Roo.bootstrap",
64      "String html" : "Preview",
65      "* prop" : "buttons[]",
66      "string name" : "preview",
67      "$ String weight" : "'default'"
68     },
69     {
70      "listeners" : {
71       "click" : "function (_self, e)\n{\n    _this.dialog.hide();\n}"
72      },
73      "xtype" : "Button",
74      "$ xns" : "Roo.bootstrap",
75      "String html" : "Cancel",
76      "* prop" : "buttons[]",
77      "string name" : "cancel",
78      "$ String weight" : "'default'"
79     },
80     {
81      "listeners" : {
82       "click" : "function (_self, e)\n{\n    _this.form.preValidate(function(res) {\n        if (!res) {\n            return; //failed.\n        }\n    });\n}"
83      },
84      "xtype" : "Button",
85      "$ xns" : "Roo.bootstrap",
86      "String html" : "Save",
87      "* prop" : "buttons[]",
88      "string name" : "save",
89      "$ String weight" : "'primary'"
90     },
91     {
92      "xtype" : "Container",
93      "$ xns" : "Roo.bootstrap",
94      "items" : [
95       {
96        "listeners" : {
97         "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.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               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}",
98         "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').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",
99         "render" : "function (_self)\n{\n    _this.form = this;\n}"
100        },
101        "| function hideshow" : "function()\n{\n    _this.to_group_row.hide();\n    \n    if (this.findField('to_group').getValue() == -1) {\n        return;\n    }\n    \n    _this.to_group_row.show();\n}",
102        "$ 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",
103        "xtype" : "Form",
104        "$ xns" : "Roo.bootstrap",
105        "String method" : "POST",
106        "string errorMask" : true,
107        "$ String url" : "baseURL + '/Roo/crm_mailing_list_message.php'",
108        "items" : [
109         {
110          "xtype" : "Row",
111          "$ xns" : "Roo.bootstrap",
112          "items" : [
113           {
114            "Number md" : 8,
115            "xtype" : "Column",
116            "Number xs" : 12,
117            "$ xns" : "Roo.bootstrap",
118            "items" : [
119             {
120              "Boolean allowBlank" : false,
121              "String name" : "name",
122              "xtype" : "Input",
123              "string fieldLabel" : "Mailout Name:",
124              "$ xns" : "Roo.bootstrap",
125              "Number labelWidth" : 3,
126              "String indicatorpos" : "right"
127             }
128            ]
129           },
130           {
131            "Number md" : 4,
132            "xtype" : "Column",
133            "$ xns" : "Roo.bootstrap",
134            "items" : [
135             {
136              "listeners" : {
137               "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}"
138              },
139              "String name" : "active",
140              "Boolean checked" : true,
141              "xtype" : "CheckBox",
142              "String valueOff" : 0,
143              "String boxLabel" : "Enabled - will be sent out",
144              "$ xns" : "Roo.bootstrap",
145              "string value" : 1,
146              "String indicatorpos" : "right"
147             }
148            ]
149           }
150          ]
151         },
152         {
153          "xtype" : "Row",
154          "$ xns" : "Roo.bootstrap",
155          "items" : [
156           {
157            "Number md" : 6,
158            "xtype" : "Column",
159            "Number xs" : 12,
160            "$ xns" : "Roo.bootstrap",
161            "string name" : "from_name",
162            "items" : [
163             {
164              "Boolean allowBlank" : false,
165              "String name" : "from_name",
166              "xtype" : "Input",
167              "string fieldLabel" : "From:",
168              "$ xns" : "Roo.bootstrap",
169              "Number labelWidth" : 4,
170              "String indicatorpos" : "right"
171             }
172            ]
173           },
174           {
175            "Number md" : 6,
176            "xtype" : "Column",
177            "Number xs" : 12,
178            "$ xns" : "Roo.bootstrap",
179            "items" : [
180             {
181              "Boolean allowBlank" : false,
182              "String name" : "from_email",
183              "xtype" : "Input",
184              "string fieldLabel" : "From email address:",
185              "$ xns" : "Roo.bootstrap",
186              "String vtype" : "email",
187              "Number labelWidth" : 4,
188              "String indicatorpos" : "right"
189             }
190            ]
191           }
192          ]
193         },
194         {
195          "xtype" : "Row",
196          "$ xns" : "Roo.bootstrap",
197          "items" : [
198           {
199            "listeners" : {
200             "render" : "function (_self)\n{\n    _this.to_group_row = this;\n}"
201            },
202            "Number md" : 6,
203            "xtype" : "Column",
204            "Number xs" : 12,
205            "$ xns" : "Roo.bootstrap",
206            "items" : [
207             {
208              "listeners" : {
209               "render" : "function (_self)\n{\n    _this.combo_to_group = _self;\n}"
210              },
211              "String loadingText" : "Searching",
212              "Number pageSize" : 20,
213              "Boolean allowBlank" : true,
214              "String name" : "to_group_name",
215              "Number minChars" : 2,
216              "String valueField" : "id",
217              "Boolean typeAhead" : true,
218              "xtype" : "ComboBox",
219              "Boolean editable" : false,
220              "String triggerAction" : "all",
221              "String labelAlign" : "left",
222              "string fieldLabel" : "To group:",
223              "Boolean alwaysQuery" : true,
224              "string placeholder" : "Select Group",
225              "$ xns" : "Roo.bootstrap",
226              "Number labelWidth" : 4,
227              "String hiddenName" : "to_group",
228              "String displayField" : "name",
229              "Boolean forceSelection" : true,
230              "items" : [
231               {
232                "listeners" : {
233                 "beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    \n    o.params._direct_return = 1;\n}\n"
234                },
235                "$ Object sortInfo" : "{ direction : 'ASC', field: 'name' }",
236                "xtype" : "Store",
237                "boolean remoteSort" : true,
238                "$ xns" : "Roo.data",
239                "* prop" : "store",
240                "items" : [
241                 {
242                  "xtype" : "HttpProxy",
243                  "$ xns" : "Roo.data",
244                  "String method" : "GET",
245                  "* prop" : "proxy",
246                  "$ String url" : "baseURL + '/Roo/Core_group'"
247                 },
248                 {
249                  "$ Array fields" : "[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"id\",\"type\":\"int\"}]",
250                  "xtype" : "JsonReader",
251                  "String root" : "data",
252                  "$ xns" : "Roo.data",
253                  "String id" : "name",
254                  "* prop" : "reader",
255                  "String totalProperty" : "total"
256                 }
257                ]
258               }
259              ]
260             }
261            ]
262           },
263           {
264            "Number md" : 6,
265            "xtype" : "Column",
266            "Number xs" : 12,
267            "$ xns" : "Roo.bootstrap",
268            "items" : [
269             {
270              "String loadingText" : "Searching",
271              "Number pageSize" : 20,
272              "Boolean allowBlank" : true,
273              "String name" : "bcc_group_name",
274              "Number minChars" : 2,
275              "String valueField" : "id",
276              "Boolean typeAhead" : true,
277              "xtype" : "ComboBox",
278              "Boolean editable" : false,
279              "String triggerAction" : "all",
280              "String labelAlign" : "left",
281              "string fieldLabel" : "BCC Group:",
282              "Boolean alwaysQuery" : true,
283              "string placeholder" : "Select BCC Group",
284              "$ xns" : "Roo.bootstrap",
285              "Number labelWidth" : 4,
286              "String hiddenName" : "bcc_group",
287              "String displayField" : "name",
288              "Boolean forceSelection" : true,
289              "items" : [
290               {
291                "listeners" : {
292                 "beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    \n    o.params._direct_return = 1;\n}\n"
293                },
294                "$ Object sortInfo" : "{ direction : 'ASC', field: 'name' }",
295                "xtype" : "Store",
296                "boolean remoteSort" : true,
297                "$ xns" : "Roo.data",
298                "* prop" : "store",
299                "items" : [
300                 {
301                  "xtype" : "HttpProxy",
302                  "$ xns" : "Roo.data",
303                  "String method" : "GET",
304                  "* prop" : "proxy",
305                  "$ String url" : "baseURL + '/Roo/Core_group'"
306                 },
307                 {
308                  "$ Array fields" : "[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"id\",\"type\":\"int\"}]",
309                  "xtype" : "JsonReader",
310                  "String root" : "data",
311                  "$ xns" : "Roo.data",
312                  "String id" : "name",
313                  "* prop" : "reader",
314                  "String totalProperty" : "total"
315                 }
316                ]
317               }
318              ]
319             }
320            ]
321           }
322          ]
323         },
324         {
325          "xtype" : "Row",
326          "$ xns" : "Roo.bootstrap",
327          "items" : [
328           {
329            "Number md" : 12,
330            "xtype" : "Column",
331            "Number xs" : 12,
332            "$ xns" : "Roo.bootstrap",
333            "items" : [
334             {
335              "Boolean allowBlank" : false,
336              "String name" : "subject",
337              "xtype" : "Input",
338              "string fieldLabel" : "Subject:",
339              "$ xns" : "Roo.bootstrap",
340              "Number labelWidth" : 2,
341              "String indicatorpos" : "right"
342             }
343            ]
344           }
345          ]
346         },
347         {
348          "xtype" : "Row",
349          "$ xns" : "Roo.bootstrap",
350          "items" : [
351           {
352            "Number md" : 12,
353            "xtype" : "Column",
354            "$ xns" : "Roo.bootstrap",
355            "items" : [
356             {
357              "String header" : "HTML Editor",
358              "String panel" : "default",
359              "xtype" : "Container",
360              "$ xns" : "Roo.bootstrap",
361              "items" : [
362               {
363                "listeners" : {
364                 "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}",
365                 "render" : "function (_self)\n{\n    _this.htmleditor = this;\n}",
366                 "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}"
367                },
368                "String name" : "bodytext",
369                "String bodyCls" : "roo-email",
370                "xtype" : "HtmlEditor",
371                "$ xns" : "Roo.bootstrap",
372                "Array stylesheets" : "",
373                "items" : [
374                 {
375                  "listeners" : {
376                   "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}"
377                  },
378                  "Boolean toggle" : false,
379                  "xtype" : "Button",
380                  "$ xns" : "Roo.bootstrap",
381                  "String glyphicon" : "camera",
382                  "String html" : "Insert Image",
383                  "* prop" : "btns[]"
384                 },
385                 {
386                  "Boolean toggle" : false,
387                  "$ String glyphicon" : "'tag'",
388                  "xtype" : "Button",
389                  "$ xns" : "Roo.bootstrap",
390                  "String html" : "Insert Field",
391                  "* prop" : "btns[]",
392                  "items" : [
393                   {
394                    "xtype" : "Menu",
395                    "$ xns" : "Roo.bootstrap",
396                    "* prop" : "menu",
397                    "items" : [
398                     {
399                      "listeners" : {
400                       "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}"
401                      },
402                      "xtype" : "MenuItem",
403                      "$ xns" : "Roo.bootstrap",
404                      "String html" : "Name"
405                     },
406                     {
407                      "listeners" : {
408                       "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}"
409                      },
410                      "xtype" : "MenuItem",
411                      "$ xns" : "Roo.bootstrap",
412                      "String html" : "Unsubscribe"
413                     }
414                    ]
415                   }
416                  ]
417                 },
418                 {
419                  "listeners" : {
420                   "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}"
421                  },
422                  "Boolean toggle" : false,
423                  "$ String glyphicon" : "'refresh'",
424                  "xtype" : "Button",
425                  "$ xns" : "Roo.bootstrap",
426                  "String html" : "Convert HTML to Plain Text",
427                  "* prop" : "btns[]"
428                 },
429                 {
430                  "listeners" : {
431                   "click" : "function (_self, e)\n{\n    this.scope.owner.fireEvent('savedpreview', this.scope.owner);\n}"
432                  },
433                  "Boolean toggle" : false,
434                  "$ String glyphicon" : "'floppy-disk'",
435                  "xtype" : "Button",
436                  "$ xns" : "Roo.bootstrap",
437                  "String html" : "Saved Version",
438                  "* prop" : "btns[]"
439                 }
440                ]
441               }
442              ]
443             }
444            ]
445           }
446          ]
447         },
448         {
449          "listeners" : {
450           "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}"
451          },
452          "xtype" : "Row",
453          "$ xns" : "Roo.bootstrap",
454          "items" : [
455           {
456            "Number md" : 12,
457            "xtype" : "Column",
458            "$ xns" : "Roo.bootstrap",
459            "items" : [
460             {
461              "String header" : "Plain Text",
462              "$ String panel" : "'default'",
463              "xtype" : "Container",
464              "$ xns" : "Roo.bootstrap",
465              "items" : [
466               {
467                "String name" : "plaintext",
468                "xtype" : "TextArea",
469                "$ xns" : "Roo.bootstrap"
470               }
471              ]
472             }
473            ]
474           }
475          ]
476         },
477         {
478          "xtype" : "Row",
479          "$ xns" : "Roo.bootstrap",
480          "items" : [
481           {
482            "Number md" : 12,
483            "xtype" : "Column",
484            "$ xns" : "Roo.bootstrap",
485            "items" : [
486             {
487              "String name" : "test_class",
488              "xtype" : "Input",
489              "string fieldLabel" : "Test Class (for system reference only):",
490              "String labelAlign" : "top",
491              "$ xns" : "Roo.bootstrap"
492             }
493            ]
494           }
495          ]
496         },
497         {
498          "String name" : "id",
499          "xtype" : "Input",
500          "String inputType" : "hidden",
501          "$ xns" : "Roo.bootstrap",
502          "Number labelWidth" : 3
503         },
504         {
505          "String name" : "_ignore_group_count",
506          "xtype" : "Input",
507          "String inputType" : "hidden",
508          "$ xns" : "Roo.bootstrap",
509          "Number labelWidth" : 3
510         }
511        ]
512       }
513      ]
514     }
515    ]
516   }
517  ]
518 }