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


PHP ArticleFileManager::uploadSAEFile方法代碼示例

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


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

示例1: execute

 /**
  * Save changes to the report file.
  * @return int the report file ID
  */
 function execute($fileName = null)
 {
     $sectionDecisionDao =& DAORegistry::getDAO('SectionDecisionDAO');
     $articleDao =& DAORegistry::getDAO('ArticleDAO');
     import('classes.file.ArticleFileManager');
     $articleFileManager = new ArticleFileManager($this->article->getArticleId());
     $fileName = isset($fileName) ? $fileName : 'uploadReportFile';
     $lastDecision = $this->article->getLastSectionDecision();
     $lastDecisionDecision = $lastDecision->getDecision();
     $lastDecisionType = $lastDecision->getReviewType();
     // Ensure to start a new round of review when needed, and if the file to upload is correct
     if (($lastDecisionDecision == SUBMISSION_SECTION_DECISION_APPROVED || $lastDecisionDecision == SUBMISSION_SECTION_DECISION_EXEMPTED || $lastDecisionType == REVIEW_TYPE_SAE && ($lastDecisionDecision == SUBMISSION_SECTION_DECISION_INCOMPLETE || $lastDecisionDecision == SUBMISSION_SECTION_DECISION_RESUBMIT)) && $articleFileManager->uploadedFileExists($fileName)) {
         $this->fileId = $articleFileManager->uploadSAEFile($fileName);
     } else {
         $this->fileId = 0;
     }
     if ($this->fileId && $this->fileId > 0) {
         $sectionDecision =& new SectionDecision();
         $sectionDecision->setSectionId($lastDecision->getSectionId());
         $sectionDecision->setDecision(0);
         $sectionDecision->setDateDecided(date(Core::getCurrentDate()));
         $sectionDecision->setArticleId($this->article->getArticleId());
         $sectionDecision->setReviewType(REVIEW_TYPE_SAE);
         if ($lastDecisionType == $sectionDecision->getReviewType()) {
             $lastRound = (int) $lastDecision->getRound();
             $sectionDecision->setRound($lastRound + 1);
         } else {
             $sectionDecision->setRound(1);
         }
         $sectionDecisionDao->insertSectionDecision($sectionDecision);
         $articleDao->changeArticleStatus($this->article->getArticleId(), STATUS_QUEUED);
     }
     // Notifications
     import('lib.pkp.classes.notification.NotificationManager');
     $notificationManager = new NotificationManager();
     $journal =& Request::getJournal();
     $url = Request::url($journal->getPath(), 'sectionEditor', 'submission', array($this->article->getArticleId(), 'submissionReview'));
     $sectionEditorsDao =& DAORegistry::getDAO('SectionEditorsDAO');
     $sectionEditors =& $sectionEditorsDao->getEditorsBySectionId($journal->getId(), $lastDecision->getSectionId());
     foreach ($sectionEditors as $sectionEditor) {
         $notificationSectionEditors[] = array('id' => $sectionEditor->getId());
     }
     foreach ($notificationSectionEditors as $userRole) {
         $notificationManager->createNotification($userRole['id'], 'notification.type.sae', $this->article->getProposalId(), $url, 1, NOTIFICATION_TYPE_METADATA_MODIFIED);
     }
     return $this->fileId;
 }
開發者ID:elavaud,項目名稱:hrp_ct,代碼行數:51,代碼來源:SAEFileForm.inc.php


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