DataObjects/pman.links.ini
[Pman.Core] / Pman.Dialog.CoreMailingListMessage.bjs
index 1eb0f9b..1fec354 100644 (file)
                                 },
                                 {
                                     "listeners": {
-                                        "select": "function (combo, record, index)\n{\n    Roo.log(record);\n/*\n    (function() { \n        combo.setValue('');\n    }).defer(100);\n*/    \n    _this.form.findField('bodytext').setValue(record.data.content);\n\n}"
+                                        "select": "function (combo, record, index)\n{\n   \n/*\n    (function() { \n        combo.setValue('');\n    }).defer(100);\n*/    \n    if(!record){\n        return;\n    }\n    _this.form.findField('bodytext').setValue(record.data.content);\n\n}"
                                     },
                                     "allowBlank": true,
                                     "alwaysQuery": true,
                 },
                 {
                     "listeners": {
-                        "click": "function (_self, e)\n{\n    //_this.dialog.hide();\n    Roo.log(_this.data.module)\n    Pman.Dialog.CoreMailingListMessagePreview.show({ id : _this.form.findField('id').getValue(), module : _this.data.module });\n}",
+                        "click": "function (_self, e)\n{\n    //_this.dialog.hide();\n    Roo.log(_this.data.module);\n    Pman.Dialog.CoreMailingListMessagePreview.show({ id : _this.form.findField('id').getValue(), module : _this.data.module });\n}",
                         "render": "function (_self)\n{\n    _this.preview_btn = _self;\n}"
                     },
                     "*prop": "buttons[]",
                 },
                 {
                     "listeners": {
-                        "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.MessageBox.alert('Error', 'Please save the message frist!');\n        return;\n    }\n   \n    new Pman.Request({\n        url : baseURL + '/Crm/MessagePreview',\n        method : 'POST',\n        mask: 'Sending',\n        params : {\n            _id : id,\n            _action : 'html'\n        }, \n        success : function(res) { \n            if(res.data == 'SUCCESS'){\n                Roo.MessageBox.alert(\"Email Sent\", 'The report was sent to your email (HTML format).');\n            }\n        }\n    });\n}",
+                        "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.MessageBox.alert('Error', 'Please save the message frist!');\n        return;\n    }\n   \n    new Pman.Request({\n        url : baseURL + '/Crm/MessagePreview',\n        method : 'POST',\n        mask: 'Sending',\n        params : {\n            _id : id\n        }, \n        success : function(res) { \n            if(res.data == 'SUCCESS'){\n                Roo.MessageBox.alert(\"Email Sent\", 'The report was sent to your email (HTML format).');\n            }\n        }\n    });\n}",
                         "render": "function (_self)\n{\n    _this.html_preview = _self;\n}"
                     },
                     "*prop": "buttons[]",