DataObjects/Core_watch.php
[Pman.Core] / ImportMailMessage.php
index 4dc240a..b2a9a4e 100644 (file)
@@ -2,7 +2,7 @@
 
 require_once 'ConvertStyle.php';
 
-class Pman_Crm_ImportHtml extends Pman_Core_ConvertStyle 
+class Pman_Core_ImportMailMessage extends Pman_Core_ConvertStyle 
 {
     function getAuth()
     {
@@ -24,7 +24,7 @@ class Pman_Crm_ImportHtml extends Pman_Core_ConvertStyle
     }
     
     function post()
-    {
+    {   
         if(isset($_REQUEST['_convertToPlain']))
         {
             require_once 'System.php';
@@ -57,6 +57,7 @@ class Pman_Crm_ImportHtml extends Pman_Core_ConvertStyle
             $plain = $fc->convert('text/plain');
             $this->jok(file_get_contents($plain));
         }
+        
         // Import from URL
         if(isset($_REQUEST['importUrl']))
         {
@@ -74,7 +75,7 @@ class Pman_Crm_ImportHtml extends Pman_Core_ConvertStyle
                'ontable' =>'crm_mailing_list_message'
         ));
         $htmlFile->onUpload(false);
-       // print_r($htmlFile);
+       
         if($htmlFile->mimetype != 'text/html')
         {
             $this->jerr('accept html file only!');
@@ -87,6 +88,7 @@ class Pman_Crm_ImportHtml extends Pman_Core_ConvertStyle
         $data = $this->convertStyle('', $htmlFile->getStoreName(), false);
         
         $htmlFile->delete();
+        
         unlink($htmlFile->getStoreName()) or die('Unable to delete the file');
         
         $this->jok($data);