Index: pro-violet-viettel/www/deploy/api/platform/modules/space/actions/actions.class.php
===================================================================
--- pro-violet-viettel/www/deploy/api/platform/modules/space/actions/actions.class.php	(revision 825)
+++ pro-violet-viettel/www/deploy/api/platform/modules/space/actions/actions.class.php	(revision 826)
@@ -140,5 +140,5 @@
     }
 
-    private function changeParentDir($item, $destination) {
+    private function ChangeParentDir($item, $destination) {
         if ($item->type == 'directory') {
             $tblfile = TblspacefilePeer::retrieveByPk($item->id);
@@ -154,4 +154,53 @@
         return $item;
     }
+
+    private function CreatePreview($fileurl, $userId, $fileid) {
+    	$url = "https://docs.google.com/gview?url=" .urlencode($fileurl) . "";
+    	file_put_contents("1.html", $url);
+    	$content="";
+    	$ch = curl_init();
+    	curl_setopt($ch, CURLOPT_URL, $url);
+    	curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
+    	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+    	$content = curl_exec($ch);
+    	file_put_contents("1.html", $content);
+    	preg_match("'img\?id\\\u003d(.*?)%3D'si", $content, $matches);
+    	$count=0;
+    	if (isset($matches[1]))
+    	{
+    		$id = $matches[1];
+    		$count=0;
+    		for ($i = 0; $i <= 20; $i++) {
+    			$imgurl = "https://docs.google.com/viewerng/img?id=" . $id . "&w=600&page=" . $i;
+    			$ch = curl_init();
+    			curl_setopt($ch, CURLOPT_URL, $imgurl);
+    			curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
+    			curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+    			$image = curl_exec($ch);
+    			$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
+    			if ($code == 200)
+    			{
+    
+    				$count++;
+    				if (!file_exists('previews/'. $userId."/")) {
+    					mkdir('previews/'. $userId."/", 0777, true);
+    				}
+    
+    				if (!file_exists('previews/'. $userId."/".$fileid."/")) {
+    
+    					mkdir('previews/'. $userId."/".$fileid."/", 0777, true);
+    
+    				}
+    				file_put_contents("previews/" . $userId . "/" . $fileid . "/" . $i . ".png", $image);
+    
+    			} else {
+    				break;
+    			}
+    		}
+    
+    	}
+    	return $count;
+    }    
+    
     public function executePreview(){
         $fileId = $this->getRequestParameter('fileId');
@@ -170,5 +219,5 @@
             $fileName = $tblres->getFullFilename(); 
             $fileUrl = str_replace("/srv/www/violet/web", "http://sbgapi.violet.vn", $fileName);
-            $count=$this->createPreview($fileUrl, $userId, $fileId);
+            $count=$this->CreatePreview($fileUrl, $userId, $fileId);
         }
         $data['fileid']=$fileId;
@@ -346,5 +395,5 @@
                     }
                 } else if ($act == 'move') {
-                    $this->changeParentDir($treeObj, $destination);
+                    $this->ChangeParentDir($treeObj, $destination);
                     if ($treeObj->type == 'directory')
                         $aryNewTree['DIRECTORIES'][] = $treeObj;
@@ -402,5 +451,5 @@
         if (in_array($ext, array("ppt","xls","doc","pdf","docx","pptx","xlsx"))) 
         { 
-            $this->createPreview($fileUrl, $userId, $tblfile->getFileId());
+            $this->CreatePreview($fileUrl, $userId, $tblfile->getFileId());
         }
         if ($response == 1) {
@@ -420,54 +469,4 @@
 
         return sfView::NONE;
-    }
-
-    private function createPreview($fileurl, $userId, $fileid) {
-
-       
-        $url = "https://docs.google.com/gview?url=" .urlencode($fileurl) . "";
-        file_put_contents("1.html", $url);
-        $content="";
-        $ch = curl_init();
-        curl_setopt($ch, CURLOPT_URL, $url);
-        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
-        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
-        $content = curl_exec($ch);
-       file_put_contents("1.html", $content);
-        preg_match("'img\?id\\\u003d(.*?)%3D'si", $content, $matches);
-        $count=0;
-        if (isset($matches[1]))
-        {
-        $id = $matches[1];
-        $count=0;
-        for ($i = 0; $i <= 20; $i++) {
-            $imgurl = "https://docs.google.com/viewerng/img?id=" . $id . "&w=600&page=" . $i;
-            $ch = curl_init();
-            curl_setopt($ch, CURLOPT_URL, $imgurl);
-            curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
-            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
-            $image = curl_exec($ch); 
-            $code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
-            if ($code == 200) 
-            {
-                
-                $count++;
-                if (!file_exists('previews/'. $userId."/")) {
-                    mkdir('previews/'. $userId."/", 0777, true); 
-                }
-                
-                if (!file_exists('previews/'. $userId."/".$fileid."/")) {
-                    
-                    mkdir('previews/'. $userId."/".$fileid."/", 0777, true); 
-                    
-                }
-                file_put_contents("previews/" . $userId . "/" . $fileid . "/" . $i . ".png", $image);
-
-            } else {
-                break;
-            }
-        }
-        
-        }
-        return $count;
     }
 
Index: pro-violet-viettel/www/deploy/api/platform/modules/space/templates/copySuccess.php
===================================================================
--- pro-violet-viettel/www/deploy/api/platform/modules/space/templates/copySuccess.php	(revision 825)
+++ pro-violet-viettel/www/deploy/api/platform/modules/space/templates/copySuccess.php	(revision 826)
@@ -1,4 +1,20 @@
-<data err="<?php echo $errMsg; ?>" errCode="<?php echo $errCode; ?>">
-	<folderdata><?php echo json_encode($aryNewTree['DIRECTORIES'])?></folderdata>
-	<filedata><?php echo json_encode($aryNewTree['FILES'])?></filedata>
-</data>
+<tree err="<?php echo $errMsg; ?>" errCode="<?php echo $errCode; ?>">
+<?php foreach ($aryDeletedObj as $obj): ?>
+<?php 	if ($obj->type == 'directory'):?>
+		<folder id="<?php echo $obj->id;?>" parentid="<?php echo $obj->parentID;?>" name="<?php echo $obj->name;?>">
+<?php 		if (is_array($obj->childDirs)):?>
+<?php 			foreach ($obj->childDirs as $childobj):?>
+					<childdir id="<?php echo $childobj->id;?>" parentid="<?php echo $childobj->parentID;?>"><?php echo $childobj->name;?></childdir>
+<?php 			endforeach;?>
+<?php 		endif;?>
+<?php 		if (is_array($obj->childFiles)):?>
+<?php 			foreach ($obj->childFiles as $childobj):?>
+					<childfile id="<?php echo $childobj->id;?>" parentid="<?php echo $childobj->parentID;?>"><?php echo $childobj->name;?></childfile>
+<?php 			endforeach;?>
+<?php 		endif;?>
+		</folder>
+<?php 	else:?> 
+		<file id="<?php echo $obj->id;?>" parentid="<?php echo $obj->parentID;?>" name="<?php echo $obj->name;?>"></file>
+<?php 	endif;?>
+<?php endforeach; ?>
+</tree>
Index: pro-violet-viettel/www/deploy/api/platform/modules/space/templates/dirSuccess.php
===================================================================
--- pro-violet-viettel/www/deploy/api/platform/modules/space/templates/dirSuccess.php	(revision 825)
+++ pro-violet-viettel/www/deploy/api/platform/modules/space/templates/dirSuccess.php	(revision 826)
@@ -24,5 +24,5 @@
       $fileName = $tblres->getFullFilename();
       $fileName = str_replace('/srv/www/violet/web', '', $fileName);
-      $fileName = 'http://sbgapi.violet.vn'.$fileName;
+      $fileName = 'http://sbgapi.violet.vn'.$fileName;      
       $fileNames = explode("/", $fileName);
       $name=$fileNames[(count($fileNames)-1)];
@@ -33,6 +33,7 @@
           $thumbnail="http://sbgapi.violet.vn/previews/$userId/".$tblfile->getFileId()."/0.png";
       }
+      $fileSize = $tblres->getResFilesize();
       ?> 
-    <file thumbnail="<?php echo $thumbnail;?>" fileurl="<?php echo $fileName;?>" id="<?php echo $tblfile->getFileId() ?>" parentid="<?php echo $tblfile->getFileCategory() ?>" filetype="<?php echo $tblfile->getFileType() ?>"><?php echo $tblfile->getFileName() ?></file>
+    <file thumbnail="<?php echo $thumbnail;?>" fileurl="<?php echo $fileName;?>" id="<?php echo $tblfile->getFileId() ?>" parentid="<?php echo $tblfile->getFileCategory() ?>" filetype="<?php echo $tblfile->getFileType() ?>" size="<?php echo $fileSize;?>"><?php echo $tblfile->getFileName() ?></file>
   <?php endforeach; ?> 
   </filelist>
