Exemplo n.º 1
0
 /**
  * Upload the revised version of a paper.
  * @param $authorSubmission object
  */
 function uploadRevisedVersion($authorSubmission)
 {
     import('file.PaperFileManager');
     $paperFileManager = new PaperFileManager($authorSubmission->getPaperId());
     $authorSubmissionDao =& DAORegistry::getDAO('AuthorSubmissionDAO');
     $fileName = 'upload';
     if ($paperFileManager->uploadError($fileName)) {
         return false;
     }
     if (!$paperFileManager->uploadedFileExists($fileName)) {
         return false;
     }
     HookRegistry::call('AuthorAction::uploadRevisedVersion', array(&$authorSubmission));
     if ($authorSubmission->getRevisedFileId() != null) {
         $fileId = $paperFileManager->uploadDirectorDecisionFile($fileName, $authorSubmission->getRevisedFileId());
     } else {
         $fileId = $paperFileManager->uploadDirectorDecisionFile($fileName);
     }
     if (!$fileId) {
         return false;
     }
     $authorSubmission->setRevisedFileId($fileId);
     $authorSubmissionDao->updateAuthorSubmission($authorSubmission);
     // Add log entry
     $user =& Request::getUser();
     import('paper.log.PaperLog');
     import('paper.log.PaperEventLogEntry');
     PaperLog::logEvent($authorSubmission->getPaperId(), PAPER_LOG_AUTHOR_REVISION, LOG_TYPE_AUTHOR, $user->getId(), 'log.author.documentRevised', array('authorName' => $user->getFullName(), 'fileId' => $fileId, 'paperId' => $authorSubmission->getPaperId()));
 }
Exemplo n.º 2
0
 /**
  * Upload the post-review version of a paper.
  * @param $trackDirectorSubmission object
  */
 function uploadDirectorVersion($trackDirectorSubmission)
 {
     import('file.PaperFileManager');
     $paperFileManager = new PaperFileManager($trackDirectorSubmission->getPaperId());
     $trackDirectorSubmissionDao =& DAORegistry::getDAO('TrackDirectorSubmissionDAO');
     $user =& Request::getUser();
     $fileName = 'upload';
     if ($paperFileManager->uploadError($fileName)) {
         return false;
     }
     if ($paperFileManager->uploadedFileExists($fileName) && !HookRegistry::call('TrackDirectorAction::uploadDirectorVersion', array(&$trackDirectorSubmission))) {
         if ($trackDirectorSubmission->getDirectorFileId() != null) {
             $fileId = $paperFileManager->uploadDirectorDecisionFile($fileName, $trackDirectorSubmission->getDirectorFileId());
         } else {
             $fileId = $paperFileManager->uploadDirectorDecisionFile($fileName);
         }
     }
     if (isset($fileId) && $fileId != 0) {
         $trackDirectorSubmission->setDirectorFileId($fileId);
         $trackDirectorSubmissionDao->updateTrackDirectorSubmission($trackDirectorSubmission);
         // Add log
         import('paper.log.PaperLog');
         import('paper.log.PaperEventLogEntry');
         PaperLog::logEvent($trackDirectorSubmission->getPaperId(), PAPER_LOG_DIRECTOR_FILE, LOG_TYPE_DIRECTOR, $trackDirectorSubmission->getDirectorFileId(), 'log.director.directorFile');
     }
 }