listeners : {
select : function (combo, record, index)
{
- Roo.log(record);
+
/*
(function() {
combo.setValue('');
}).defer(100);
*/
+ if(!record){
+ return;
+ }
_this.form.findField('bodytext').setValue(record.data.content);
}
_this.form.url = baseURL + '/Roo/' + _this.data.module + '_mailing_list_message.php';
+ _this.html_preview.hide();
+ _this.preview_btn.hide();
+
if(_this.data.id*1 > 0){
_this.dialog.el.mask("Loading");
this.load({ method: 'GET', params: { '_id' : _this.data.id }});
if(_this.data.module == 'crm'){
- _this.preview_btn.show();
+ _this.html_preview.show();
}
- _this.html_preview.show();
+ _this.preview_btn.show();
} else {
- _this.html_preview.hide();
- _this.preview_btn.hide();
_this.form.setValues({
'from_name' : Pman.Login.authUser.name,
'from_email' : Pman.Login.authUser.email
var s = Roo.get(_this.form.findField('bodytext').doc.documentElement);
+ var ontable = (_this.data.module) ? _this.data.module + '_mailing_list_message' : 'crm_mailing_list_message';
+
var nodes = [];
s.select('img[src]').each(function(i) {
nodes.push(i.dom);
method : 'POST',
params : {
onid : _this.form.findField('id').getValue(),
- ontable : 'core_mailing_list_message' ,
+ ontable : ontable ,
_remote_upload : i.src
},
success : function(res){
{
var id = _this.form.findField('id').getValue() * 1;
if (!id) {
- Roo.MessageBox.alert("Error", "Save email template first");
+ Roo.MessageBox.alert("Error", "Save message first");
return false;
}
}
click : function (_self, e)
{
//_this.dialog.hide();
-
- Pman.Dialog.CoreMailingListMessagePreview.show({ id : _this.form.findField('id').getValue() });
+ Roo.log(_this.data.module);
+ Pman.Dialog.CoreMailingListMessagePreview.show({ id : _this.form.findField('id').getValue(), module : _this.data.module });
},
render : function (_self)
{
method : 'POST',
mask: 'Sending',
params : {
- _id : id,
- _action : 'html'
+ _id : id
},
success : function(res) {
if(res.data == 'SUCCESS'){