當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ArticleFileManager::uploadCopyeditFile方法代碼示例

本文整理匯總了PHP中ArticleFileManager::uploadCopyeditFile方法的典型用法代碼示例。如果您正苦於以下問題:PHP ArticleFileManager::uploadCopyeditFile方法的具體用法?PHP ArticleFileManager::uploadCopyeditFile怎麽用?PHP ArticleFileManager::uploadCopyeditFile使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ArticleFileManager的用法示例。


在下文中一共展示了ArticleFileManager::uploadCopyeditFile方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: uploadCopyeditVersion

 /**
  * Upload the copyedit version of an article.
  * @param $sectionEditorSubmission object
  * @param $copyeditStage string
  */
 function uploadCopyeditVersion($sectionEditorSubmission, $copyeditStage)
 {
     $articleId = $sectionEditorSubmission->getId();
     import('classes.file.ArticleFileManager');
     $articleFileManager = new ArticleFileManager($articleId);
     $articleFileDao =& DAORegistry::getDAO('ArticleFileDAO');
     $signoffDao =& DAORegistry::getDAO('SignoffDAO');
     // Perform validity checks.
     $initialSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_INITIAL', ASSOC_TYPE_ARTICLE, $articleId);
     $authorSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_AUTHOR', ASSOC_TYPE_ARTICLE, $articleId);
     if ($copyeditStage == 'final' && $authorSignoff->getDateCompleted() == null) {
         return;
     }
     if ($copyeditStage == 'author' && $initialSignoff->getDateCompleted() == null) {
         return;
     }
     $fileName = 'upload';
     if ($articleFileManager->uploadedFileExists($fileName) && !HookRegistry::call('SectionEditorAction::uploadCopyeditVersion', array(&$sectionEditorSubmission))) {
         if ($sectionEditorSubmission->getFileBySignoffType('SIGNOFF_COPYEDITING_INITIAL', true) != null) {
             $copyeditFileId = $articleFileManager->uploadCopyeditFile($fileName, $sectionEditorSubmission->getFileBySignoffType('SIGNOFF_COPYEDITING_INITIAL', true));
         } else {
             $copyeditFileId = $articleFileManager->uploadCopyeditFile($fileName);
         }
     }
     if (isset($copyeditFileId) && $copyeditFileId != 0) {
         if ($copyeditStage == 'initial') {
             $signoff =& $initialSignoff;
             $signoff->setFileId($copyeditFileId);
             $signoff->setFileRevision($articleFileDao->getRevisionNumber($copyeditFileId));
         } elseif ($copyeditStage == 'author') {
             $signoff =& $authorSignoff;
             $signoff->setFileId($copyeditFileId);
             $signoff->setFileRevision($articleFileDao->getRevisionNumber($copyeditFileId));
         } elseif ($copyeditStage == 'final') {
             $signoff = $signoffDao->build('SIGNOFF_COPYEDITING_FINAL', ASSOC_TYPE_ARTICLE, $articleId);
             $signoff->setFileId($copyeditFileId);
             $signoff->setFileRevision($articleFileDao->getRevisionNumber($copyeditFileId));
         }
         $signoffDao->updateObject($signoff);
     }
 }
開發者ID:yuricampos,項目名稱:ojs,代碼行數:46,代碼來源:SectionEditorAction.inc.php

示例2: uploadCopyeditVersion

 /**
  * Upload the revised version of a copyedit file.
  * @param $authorSubmission object
  * @param $copyeditStage string
  */
 function uploadCopyeditVersion($authorSubmission, $copyeditStage)
 {
     import('classes.file.ArticleFileManager');
     $articleFileManager = new ArticleFileManager($authorSubmission->getId());
     $authorSubmissionDao =& DAORegistry::getDAO('AuthorSubmissionDAO');
     $articleFileDao =& DAORegistry::getDAO('ArticleFileDAO');
     $signoffDao =& DAORegistry::getDAO('SignoffDAO');
     // Authors cannot upload if the assignment is not active, i.e.
     // they haven't been notified or the assignment is already complete.
     $authorSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_AUTHOR', ASSOC_TYPE_ARTICLE, $authorSubmission->getId());
     if (!$authorSignoff->getDateNotified() || $authorSignoff->getDateCompleted()) {
         return;
     }
     $fileName = 'upload';
     if ($articleFileManager->uploadedFileExists($fileName)) {
         HookRegistry::call('AuthorAction::uploadCopyeditVersion', array(&$authorSubmission, &$copyeditStage));
         if ($authorSignoff->getFileId() != null) {
             $fileId = $articleFileManager->uploadCopyeditFile($fileName, $authorSignoff->getFileId());
         } else {
             $fileId = $articleFileManager->uploadCopyeditFile($fileName);
         }
     }
     $authorSignoff->setFileId($fileId);
     if ($copyeditStage == 'author') {
         $authorSignoff->setFileRevision($articleFileDao->getRevisionNumber($fileId));
     }
     $signoffDao->updateObject($authorSignoff);
 }
開發者ID:jasonzou,項目名稱:OJS-2.4.6,代碼行數:33,代碼來源:AuthorAction.inc.php

示例3: uploadCopyeditVersion

 /**
  * Upload the copyedited version of an article.
  * @param $copyeditorSubmission object
  * @param $copyeditStage string
  * @param $request object
  */
 function uploadCopyeditVersion($copyeditorSubmission, $copyeditStage, $request)
 {
     import('classes.file.ArticleFileManager');
     $articleFileDao =& DAORegistry::getDAO('ArticleFileDAO');
     $copyeditorSubmissionDao =& DAORegistry::getDAO('CopyeditorSubmissionDAO');
     $signoffDao =& DAORegistry::getDAO('SignoffDAO');
     if ($copyeditStage == 'initial') {
         $signoff = $signoffDao->build('SIGNOFF_COPYEDITING_INITIAL', ASSOC_TYPE_ARTICLE, $copyeditorSubmission->getId());
     } else {
         if ($copyeditStage == 'final') {
             $signoff = $signoffDao->build('SIGNOFF_COPYEDITING_FINAL', ASSOC_TYPE_ARTICLE, $copyeditorSubmission->getId());
         }
     }
     // Only allow an upload if they're in the initial or final copyediting
     // stages.
     if ($copyeditStage == 'initial' && ($signoff->getDateNotified() == null || $signoff->getDateCompleted() != null)) {
         return;
     } else {
         if ($copyeditStage == 'final' && ($signoff->getDateNotified() == null || $signoff->getDateCompleted() != null)) {
             return;
         } else {
             if ($copyeditStage != 'initial' && $copyeditStage != 'final') {
                 return;
             }
         }
     }
     $articleFileManager = new ArticleFileManager($copyeditorSubmission->getId());
     $user =& $request->getUser();
     $fileName = 'upload';
     if ($articleFileManager->uploadedFileExists($fileName)) {
         HookRegistry::call('CopyeditorAction::uploadCopyeditVersion', array(&$copyeditorSubmission));
         if ($signoff->getFileId() != null) {
             $fileId = $articleFileManager->uploadCopyeditFile($fileName, $copyeditorSubmission->getFileBySignoffType('SIGNOFF_COPYEDITING_INITIAL', true));
         } else {
             $fileId = $articleFileManager->uploadCopyeditFile($fileName);
         }
     }
     if (isset($fileId) && $fileId != 0) {
         $signoff->setFileId($fileId);
         $signoff->setFileRevision($articleFileDao->getRevisionNumber($fileId));
         $signoffDao->updateObject($signoff);
         // Add log
         import('classes.article.log.ArticleLog');
         ArticleLog::logEvent($request, $copyeditorSubmission, ARTICLE_LOG_COPYEDITOR_FILE, 'log.copyedit.copyeditorFile', array('copyeditorName' => $user->getFullName(), 'fileId' => $fileId));
     }
 }
開發者ID:ramonsodoma,項目名稱:ojs,代碼行數:52,代碼來源:CopyeditorAction.inc.php

示例4: uploadCopyeditVersion

 /**
  * Upload the copyedited version of an article.
  * @param $copyeditorSubmission object
  */
 function uploadCopyeditVersion($copyeditorSubmission, $copyeditStage)
 {
     import("file.ArticleFileManager");
     $articleFileDao =& DAORegistry::getDAO('ArticleFileDAO');
     $copyeditorSubmissionDao =& DAORegistry::getDAO('CopyeditorSubmissionDAO');
     $signoffDao =& DAORegistry::getDAO('SignoffDAO');
     if ($copyeditStage == 'initial') {
         $signoff = $signoffDao->build('SIGNOFF_COPYEDITING_INITIAL', ASSOC_TYPE_ARTICLE, $copyeditorSubmission->getArticleId());
     } else {
         if ($copyeditStage == 'final') {
             $signoff = $signoffDao->build('SIGNOFF_COPYEDITING_FINAL', ASSOC_TYPE_ARTICLE, $copyeditorSubmission->getArticleId());
         }
     }
     // Only allow an upload if they're in the initial or final copyediting
     // stages.
     if ($copyeditStage == 'initial' && ($signoff->getDateNotified() == null || $signoff->getDateCompleted() != null)) {
         return;
     } else {
         if ($copyeditStage == 'final' && ($signoff->getDateNotified() == null || $signoff->getDateCompleted() != null)) {
             return;
         } else {
             if ($copyeditStage != 'initial' && $copyeditStage != 'final') {
                 return;
             }
         }
     }
     $articleFileManager = new ArticleFileManager($copyeditorSubmission->getArticleId());
     $user =& Request::getUser();
     $fileName = 'upload';
     if ($articleFileManager->uploadedFileExists($fileName)) {
         HookRegistry::call('CopyeditorAction::uploadCopyeditVersion', array(&$copyeditorSubmission));
         if ($signoff->getFileId() != null) {
             $fileId = $articleFileManager->uploadCopyeditFile($fileName, $copyeditorSubmission->getFileBySignoffType('SIGNOFF_COPYEDITING_INITIAL', true));
         } else {
             $fileId = $articleFileManager->uploadCopyeditFile($fileName);
         }
     }
     if (isset($fileId) && $fileId != 0) {
         $signoff->setFileId($fileId);
         $signoff->setFileRevision($articleFileDao->getRevisionNumber($fileId));
         $signoffDao->updateObject($signoff);
         // Add log
         import('article.log.ArticleLog');
         import('article.log.ArticleEventLogEntry');
         $entry = new ArticleEventLogEntry();
         $entry->setArticleId($copyeditorSubmission->getArticleId());
         $entry->setUserId($user->getId());
         $entry->setDateLogged(Core::getCurrentDate());
         $entry->setEventType(ARTICLE_LOG_COPYEDIT_COPYEDITOR_FILE);
         $entry->setLogMessage('log.copyedit.copyeditorFile');
         $entry->setAssocType(ARTICLE_LOG_TYPE_COPYEDIT);
         $entry->setAssocId($fileId);
         ArticleLog::logEventEntry($copyeditorSubmission->getArticleId(), $entry);
     }
 }
開發者ID:philschatz,項目名稱:ojs,代碼行數:59,代碼來源:CopyeditorAction.inc.php


注:本文中的ArticleFileManager::uploadCopyeditFile方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。