Changeset 135 for pro-bachkim-filespace


Ignore:
Timestamp:
Sep 15, 2014 4:37:11 PM (11 years ago)
Author:
dungnv
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pro-bachkim-filespace/sourcecode/api.violet.vn/www/apps/platform/modules/space/actions/actions.class.php

    r134 r135  
    119119
    120120  private function CopySpaceFile ($fileId, $destination, $userId) {
     121        $newFile = new stdClass();
    121122    $c = new Criteria();
    122123    $c->add(TblspacefilePeer::FILE_ID, $fileId);
    123124    $c->add(TblspacefilePeer::FILE_USER, $userId);
    124125    $currentFile = TblspacefilePeer::doSelectOne($c);
    125     $fileName = $currentFile->getFileCategory() == $destination ? 'Copy of '.$currentFile->getFileName():$currentFile->getFileName();
    126    
     126    $fileName = $currentFile->getFileCategory() == $destination ? 'Copy of '.$currentFile->getFileName():$currentFile->getFileName();   
    127127     
    128128    $tblfile = new Tblspacefile();
     
    132132    $tblfile->setFileName($fileName);
    133133    $tblfile->setFileDate(date('Y-m-d H:i:s'));
    134     $tblfile->save();
    135     return $tblfile->getFileId();
     134    $tblfile->save();   
     135    $newFile->id = $tblfile->getFileId();
     136    $newFile->name = $fileName;
     137    $newFile->parentID = $destination;
     138    $newFile->minetype = $currentFile->getFileType();
     139    return $newFile;
    136140  }
    137141
Note: See TracChangeset for help on using the changeset viewer.