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.html_preview.show();
- }
+ _this.html_preview.show();
_this.preview_btn.show();
} else {
Roo.MessageBox.progress("Uploading Images", "Uploading");
var html = _this.form.findField('bodytext').getValue();
- var s = Roo.get(_this.form.findField('bodytext').doc.documentElement);
+ var s = Roo.get(_this.form.findField('bodytext').editorcore.doc.documentElement);
- var ontable = (_this.data.module) ? _this.data.module + '_mailing_list_message' : 'crm_mailing_list_message';
+ var ontable = (_this.data.module) ? _this.data.module : 'crm_mailing_list_message';
var nodes = [];
s.select('img[src]').each(function(i) {
// _this.form.doAction("submit");
return;
}
- var i = nodes.pop();
- var n = i.getAttribute('src').match(/^http(.*)/);
+ var i = nodes.pop();
+
+ var n = i.getAttribute('src').match(/(baseURL|server_baseurl)/);
+
+ if(n){
+ mkimg();
+ return;
+ }
+
+ n = i.getAttribute('src').match(/^http(.*)/)
+
if(!n ){
mkimg();
return;
{
xtype: 'HtmlEditor',
xns: Roo.form,
+ clearUp : false,
height : 250,
name : 'bodytext',
resizable : 's',
return;
}
- var ontable = (_this.data.module) ? _this.data.module + '_mailing_list_message' : 'crm_mailing_list_message';
+ var ontable = (_this.data.module) ? _this.data.module : 'crm_mailing_list_message';
Pman.Dialog.Image.show( { id : 0, onid: id, ontable: ontable }, function() {
_this.igrid.getDataSource().load({});
{
//_this.dialog.hide();
Roo.log(_this.data.module);
- Pman.Dialog.CoreMailingListMessagePreview.show({ id : _this.form.findField('id').getValue(), module : _this.data.module });
+ Pman.Dialog.CoreEmailPreview.show({ id : _this.form.findField('id').getValue(), module : _this.data.module });
},
render : function (_self)
{
}
new Pman.Request({
- url : baseURL + '/Crm/MessagePreview',
+ url : baseURL + '/Core/MessagePreview',
method : 'POST',
mask: 'Sending',
params : {
- _id : id
+ _id : id,
+ _table : _this.data.module
},
success : function(res) {
if(res.data == 'SUCCESS'){
listeners : {
click : function (_self, e)
{
+
// do some checks?
_this.form.preValidate(function(res) {
if (!res) {