DataObjects/Core_person_signup.php
[Pman.Core] / Pman.Dialog.CoreEmail.js
index 64303b7..92b392f 100644 (file)
@@ -356,7 +356,7 @@ Pman.Dialog.CoreEmail = {
                                             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 : 'crm_mailing_list_message';
                                             
@@ -374,8 +374,17 @@ Pman.Dialog.CoreEmail = {
                                                    //    _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;
@@ -462,6 +471,7 @@ Pman.Dialog.CoreEmail = {
                                                             {
                                                                 xtype: 'HtmlEditor',
                                                                 xns: Roo.form,
+                                                                clearUp : false,
                                                                 height : 250,
                                                                 name : 'bodytext',
                                                                 resizable : 's',
@@ -1086,11 +1096,12 @@ Pman.Dialog.CoreEmail = {
                             }
                            
                             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'){
@@ -1123,6 +1134,7 @@ Pman.Dialog.CoreEmail = {
                     listeners : {
                         click : function (_self, e)
                         {
+                        
                             // do some checks?
                             _this.form.preValidate(function(res) {
                                 if (!res) {