function editorReview()
 {
     $articleId = Request::getUserVar('articleId');
     list($journal, $submission) = SubmissionEditHandler::validate($articleId, SECTION_EDITOR_ACCESS_REVIEW);
     $redirectTarget = 'submissionReview';
     // If the Upload button was pressed.
     $submit = Request::getUserVar('submit');
     if ($submit != null) {
         SectionEditorAction::uploadEditorVersion($submission);
     }
     if (Request::getUserVar('setCopyeditFile')) {
         // If the Send To Copyedit button was pressed
         $file = explode(',', Request::getUserVar('editorDecisionFile'));
         if (isset($file[0]) && isset($file[1])) {
             $round = $submission->getCurrentRound();
             if ($submission->getMostRecentEditorDecisionComment()) {
                 // The conditions are met for being able
                 // to send a file to copyediting.
                 SectionEditorAction::setCopyeditFile($submission, $file[0], $file[1]);
             }
             $redirectTarget = 'submissionEditing';
         }
     } else {
         if (Request::getUserVar('resubmit')) {
             // If the Resubmit button was pressed
             $file = explode(',', Request::getUserVar('editorDecisionFile'));
             if (isset($file[0]) && isset($file[1])) {
                 SectionEditorAction::resubmitFile($submission, $file[0], $file[1]);
             }
         }
     }
     Request::redirect(null, null, $redirectTarget, $articleId);
 }
 function editorReview()
 {
     $articleId = Request::getUserVar('articleId');
     $this->validate($articleId, SECTION_EDITOR_ACCESS_REVIEW);
     $submission =& $this->submission;
     $signoffDao =& DAORegistry::getDAO('SignoffDAO');
     $redirectTarget = 'submissionReview';
     // If the Upload button was pressed.
     $submit = Request::getUserVar('submit');
     if ($submit != null) {
         SectionEditorAction::uploadEditorVersion($submission);
     }
     if (Request::getUserVar('setCopyeditFile')) {
         // If the Send To Copyedit button was pressed
         $file = explode(',', Request::getUserVar('editorDecisionFile'));
         if (isset($file[0]) && isset($file[1])) {
             $round = $submission->getCurrentRound();
             if ($submission->getMostRecentEditorDecisionComment()) {
                 // The conditions are met for being able
                 // to send a file to copyediting.
                 SectionEditorAction::setCopyeditFile($submission, $file[0], $file[1]);
             }
             $redirectTarget = 'submissionEditing';
         }
     } else {
         if (Request::getUserVar('resubmit')) {
             // If the Resubmit button was pressed
             $file = explode(',', Request::getUserVar('editorDecisionFile'));
             if (isset($file[0]) && isset($file[1])) {
                 SectionEditorAction::resubmitFile($submission, $file[0], $file[1]);
                 $signoff = $signoffDao->build('SIGNOFF_COPYEDITING_INITIAL', ASSOC_TYPE_ARTICLE, $submission->getId());
                 $signoff->setFileId($file[0]);
                 $signoff->setFileRevision($file[1]);
                 $signoffDao->updateObject($signoff);
             }
         }
     }
     Request::redirect(null, null, $redirectTarget, $articleId);
 }
Пример #3
0
 /**
  * Rush a new submission into the end of the editing queue.
  * @param $article object
  */
 function expediteSubmission($article)
 {
     $user =& Request::getUser();
     import('submission.editor.EditorAction');
     import('submission.sectionEditor.SectionEditorAction');
     import('submission.proofreader.ProofreaderAction');
     $sectionEditorSubmissionDao =& DAORegistry::getDAO('SectionEditorSubmissionDAO');
     $sectionEditorSubmission =& $sectionEditorSubmissionDao->getSectionEditorSubmission($article->getArticleId());
     $submissionFile = $sectionEditorSubmission->getSubmissionFile();
     // Add a long entry before doing anything.
     import('article.log.ArticleLog');
     import('article.log.ArticleEventLogEntry');
     ArticleLog::logEvent($article->getArticleId(), ARTICLE_LOG_EDITOR_EXPEDITE, ARTICLE_LOG_TYPE_EDITOR, $user->getUserId(), 'log.editor.submissionExpedited', array('editorName' => $user->getFullName(), 'articleId' => $article->getArticleId()));
     // 1. Ensure that an editor is assigned.
     $editAssignments =& $sectionEditorSubmission->getEditAssignments();
     if (empty($editAssignments)) {
         // No editors are currently assigned; assign self.
         EditorAction::assignEditor($article->getArticleId(), $user->getUserId(), true);
     }
     // 2. Accept the submission and send to copyediting.
     $sectionEditorSubmission =& $sectionEditorSubmissionDao->getSectionEditorSubmission($article->getArticleId());
     if (!$sectionEditorSubmission->getCopyeditFile()) {
         SectionEditorAction::recordDecision($sectionEditorSubmission, SUBMISSION_EDITOR_DECISION_ACCEPT);
         $reviewFile = $sectionEditorSubmission->getReviewFile();
         SectionEditorAction::setCopyeditFile($sectionEditorSubmission, $reviewFile->getFileId(), $reviewFile->getRevision());
     }
     // 3. Add a galley.
     $sectionEditorSubmission =& $sectionEditorSubmissionDao->getSectionEditorSubmission($article->getArticleId());
     $galleys =& $sectionEditorSubmission->getGalleys();
     if (empty($galleys)) {
         // No galley present -- use copyediting file.
         import('file.ArticleFileManager');
         $copyeditFile =& $sectionEditorSubmission->getCopyeditFile();
         $fileType = $copyeditFile->getFileType();
         $articleFileManager =& new ArticleFileManager($article->getArticleId());
         $fileId = $articleFileManager->copyPublicFile($copyeditFile->getFilePath(), $fileType);
         if (strstr($fileType, 'html')) {
             $galley =& new ArticleHTMLGalley();
         } else {
             $galley =& new ArticleGalley();
         }
         $galley->setArticleId($article->getArticleId());
         $galley->setFileId($fileId);
         $galley->setLocale(Locale::getLocale());
         if ($galley->isHTMLGalley()) {
             $galley->setLabel('HTML');
         } else {
             if (strstr($fileType, 'pdf')) {
                 $galley->setLabel('PDF');
             } else {
                 if (strstr($fileType, 'postscript')) {
                     $galley->setLabel('Postscript');
                 } else {
                     if (strstr($fileType, 'xml')) {
                         $galley->setLabel('XML');
                     } else {
                         $galley->setLabel(Locale::translate('common.untitled'));
                     }
                 }
             }
         }
         $galleyDao =& DAORegistry::getDAO('ArticleGalleyDAO');
         $galleyDao->insertGalley($galley);
     }
     $sectionEditorSubmission->setStatus(STATUS_QUEUED);
     $sectionEditorSubmissionDao->updateSectionEditorSubmission($sectionEditorSubmission);
 }
Пример #4
0
 /**
  * Rush a new submission into the end of the editing queue.
  * @param $article object
  */
 function expediteSubmission($article, $request)
 {
     $user =& $request->getUser();
     import('classes.submission.editor.EditorAction');
     import('classes.submission.sectionEditor.SectionEditorAction');
     import('classes.submission.proofreader.ProofreaderAction');
     $sectionEditorSubmissionDao =& DAORegistry::getDAO('SectionEditorSubmissionDAO');
     $sectionEditorSubmission =& $sectionEditorSubmissionDao->getSectionEditorSubmission($article->getId());
     $submissionFile = $sectionEditorSubmission->getSubmissionFile();
     // Add a log entry before doing anything.
     import('classes.article.log.ArticleLog');
     import('classes.article.log.ArticleEventLogEntry');
     ArticleLog::logEvent($request, $article, ARTICLE_LOG_EDITOR_EXPEDITE, 'log.editor.submissionExpedited', array('editorName' => $user->getFullName()));
     // 1. Ensure that an editor is assigned.
     $editAssignments =& $sectionEditorSubmission->getEditAssignments();
     if (empty($editAssignments)) {
         // No editors are currently assigned; assign self.
         EditorAction::assignEditor($article->getId(), $user->getId(), true, false, $request);
     }
     // 2. Accept the submission and send to copyediting.
     $sectionEditorSubmission =& $sectionEditorSubmissionDao->getSectionEditorSubmission($article->getId());
     if (!$sectionEditorSubmission->getFileBySignoffType('SIGNOFF_COPYEDITING_INITIAL', true)) {
         SectionEditorAction::recordDecision($sectionEditorSubmission, SUBMISSION_EDITOR_DECISION_ACCEPT, $request);
         $reviewFile = $sectionEditorSubmission->getReviewFile();
         SectionEditorAction::setCopyeditFile($sectionEditorSubmission, $reviewFile->getFileId(), $reviewFile->getRevision(), $request);
     }
     // 3. Add a galley.
     $sectionEditorSubmission =& $sectionEditorSubmissionDao->getSectionEditorSubmission($article->getId());
     $galleys =& $sectionEditorSubmission->getGalleys();
     if (empty($galleys)) {
         // No galley present -- use copyediting file.
         import('classes.file.ArticleFileManager');
         $copyeditFile =& $sectionEditorSubmission->getFileBySignoffType('SIGNOFF_COPYEDITING_INITIAL');
         $fileType = $copyeditFile->getFileType();
         $articleFileManager = new ArticleFileManager($article->getId());
         $fileId = $articleFileManager->copyPublicFile($copyeditFile->getFilePath(), $fileType);
         if (strstr($fileType, 'html')) {
             $galley = new ArticleHTMLGalley();
         } else {
             $galley = new ArticleGalley();
         }
         $galley->setArticleId($article->getId());
         $galley->setFileId($fileId);
         $galley->setLocale(AppLocale::getLocale());
         if ($galley->isHTMLGalley()) {
             $galley->setLabel('HTML');
         } else {
             if (strstr($fileType, 'pdf')) {
                 $galley->setLabel('PDF');
             } else {
                 if (strstr($fileType, 'postscript')) {
                     $galley->setLabel('Postscript');
                 } else {
                     if (strstr($fileType, 'xml')) {
                         $galley->setLabel('XML');
                     } else {
                         $galley->setLabel(__('common.untitled'));
                     }
                 }
             }
         }
         $galleyDao =& DAORegistry::getDAO('ArticleGalleyDAO');
         $galleyDao->insertGalley($galley);
         // Update file search index
         import('classes.search.ArticleSearchIndex');
         ArticleSearchIndex::updateFileIndex($article->getId(), ARTICLE_SEARCH_GALLEY_FILE, $fileId);
     }
     $sectionEditorSubmission->setStatus(STATUS_QUEUED);
     $sectionEditorSubmissionDao->updateSectionEditorSubmission($sectionEditorSubmission);
 }