/** * Upload a review on behalf of its reviewer. * @param $reviewId int */ function uploadReviewForReviewer($reviewId, $article, $request) { $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO'); $userDao =& DAORegistry::getDAO('UserDAO'); $user =& $request->getUser(); $reviewAssignment =& $reviewAssignmentDao->getById($reviewId); $reviewer =& $userDao->getUser($reviewAssignment->getReviewerId(), true); if (HookRegistry::call('SectionEditorAction::uploadReviewForReviewer', array(&$reviewAssignment, &$reviewer))) { return; } // Upload the review file. import('classes.file.ArticleFileManager'); $articleFileManager = new ArticleFileManager($reviewAssignment->getSubmissionId()); // Only upload the file if the reviewer has yet to submit a recommendation if (($reviewAssignment->getRecommendation() === null || $reviewAssignment->getRecommendation() === '') && !$reviewAssignment->getCancelled()) { $fileName = 'upload'; if ($articleFileManager->uploadedFileExists($fileName)) { if ($reviewAssignment->getReviewerFileId() != null) { $fileId = $articleFileManager->uploadReviewFile($fileName, $reviewAssignment->getReviewerFileId()); } else { $fileId = $articleFileManager->uploadReviewFile($fileName); } } } if (isset($fileId) && $fileId != 0) { // Only confirm the review for the reviewer if // he has not previously done so. if ($reviewAssignment->getDateConfirmed() == null) { $reviewAssignment->setDeclined(0); $reviewAssignment->setDateConfirmed(Core::getCurrentDate()); } $reviewAssignment->setReviewerFileId($fileId); $reviewAssignment->stampModified(); $reviewAssignmentDao->updateReviewAssignment($reviewAssignment); // Add log import('classes.article.log.ArticleLog'); ArticleLog::logEvent($request, $article, ARTICLE_LOG_REVIEW_FILE_BY_PROXY, 'log.review.reviewFileByProxy', array('reviewerName' => $reviewer->getFullName(), 'round' => $reviewAssignment->getRound(), 'userName' => $user->getFullName(), 'reviewId' => $reviewAssignment->getId())); } }
/** * Upload the annotated version of an article. * @param $reviewId int */ function uploadReviewerVersion($reviewId) { import('classes.file.ArticleFileManager'); $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO'); $sectionDecisionDao =& DAORegistry::getDAO('SectionDecisionDAO'); $reviewAssignment =& $reviewAssignmentDao->getById($reviewId); $sectionDecision =& $sectionDecisionDao->getSectionDecision($reviewAssignment->getDecisionId()); $articleFileManager = new ArticleFileManager($sectionDecision->getArticleId()); // Only upload the file if the reviewer has yet to submit a recommendation // and if review forms are not used if (($reviewAssignment->getRecommendation() === null || $reviewAssignment->getRecommendation() === '') && !$reviewAssignment->getCancelled()) { $fileName = 'upload'; if ($articleFileManager->uploadedFileExists($fileName)) { // Check if file already uploaded $reviewFile =& $reviewAssignment->getReviewerFile(); if ($reviewFile != null) { $articleFileManager->deleteFile($reviewFile->getFileId()); } HookRegistry::call('ReviewerAction::uploadReviewFile', array(&$reviewAssignment)); if ($reviewAssignment->getReviewerFileId() != null) { $fileId = $articleFileManager->uploadReviewFile($fileName, $reviewAssignment->getDecisionId(), $reviewAssignment->getReviewerFileId()); } else { $fileId = $articleFileManager->uploadReviewFile($fileName, $reviewAssignment->getDecisionId()); } } } if (isset($fileId) && $fileId != 0) { $reviewAssignment->setReviewerFileId($fileId); $reviewAssignment->stampModified(); $reviewAssignmentDao->updateReviewAssignment($reviewAssignment); // Add log import('classes.article.log.ArticleLog'); import('classes.article.log.ArticleEventLogEntry'); $userDao =& DAORegistry::getDAO('UserDAO'); $reviewer =& $userDao->getUser($reviewAssignment->getReviewerId()); $entry = new ArticleEventLogEntry(); $entry->setArticleId($sectionDecision->getArticleId()); $entry->setUserId($reviewer->getId()); $entry->setDateLogged(Core::getCurrentDate()); $entry->setEventType(ARTICLE_LOG_REVIEW_FILE); $entry->setLogLevel('N'); $entry->setLogMessage('log.review.reviewerFile'); $entry->setAssocType(ARTICLE_LOG_TYPE_REVIEW); $entry->setAssocId($reviewAssignment->getId()); ArticleLog::logEventEntry($sectionDecision->getArticleId(), $entry); //Send a notification to section editors import('lib.pkp.classes.notification.NotificationManager'); $articleDao =& DAORegistry::getDAO('ArticleDAO'); $article =& $articleDao->getArticle($sectionDecision->getArticleId()); $notificationManager = new NotificationManager(); $notificationUsers = $article->getAssociatedUserIds(false, false); $user =& Request::getUser(); $message = $article->getProposalId() . ':<br/>' . $user->getUsername(); foreach ($notificationUsers as $userRole) { $url = Request::url(null, $userRole['role'], 'submission', array($article->getId(), 'submissionReview'), null, 'peerReview'); $notificationManager->createNotification($userRole['id'], 'notification.type.reviewerFile', $message, $url, 1, NOTIFICATION_TYPE_REVIEWER_COMMENT); } } }
/** * Upload the revised version of an article. * @param $authorSubmission object */ function uploadRevisedVersion($authorSubmission) { import('classes.file.ArticleFileManager'); $journal =& Request::getJournal(); $articleFileManager = new ArticleFileManager($authorSubmission->getId()); $authorSubmissionDao =& DAORegistry::getDAO('AuthorSubmissionDAO'); $articleFileDao =& DAORegistry::getDAO('ArticleFileDAO'); $CBPPlatformDao =& DAORegistry::getDAO('CBPPlatformDAO'); $fileName = 'upload'; if ($articleFileManager->uploadedFileExists($fileName)) { HookRegistry::call('AuthorAction::uploadRevisedVersion', array(&$authorSubmission)); if ($authorSubmission->getRevisedFileId() != null) { //%CBP% modification to only upload a new review version, not another editor version. $fileId = $articleFileManager->uploadReviewFile($fileName, $authorSubmission->getRevisedFileId()); } else { $fileId = $articleFileManager->uploadReviewFile($fileName); } } if (isset($fileId) && $fileId != 0) { $authorSubmission->setRevisedFileId($fileId); $authorSubmissionDao->updateAuthorSubmission($authorSubmission); //%CBP% if it's a workshop, update the review_round with the latest verison of the file (as we're not dealing with rounds) $workshop = $CBPPlatformDao->getWorkshop($journal->getJournalId()); if ($workshop == "workshop") { $articleFile = $articleFileDao->getArticleFile($fileId); $CBPPlatformDao->setReviewRoundFileRevision($articleFile->getArticleId(), $articleFile->getRevision(), $articleFile->getRound(), $articleFile->getFileId()); } // Add log entry $user =& Request::getUser(); import('classes.article.log.ArticleLog'); import('classes.article.log.ArticleEventLogEntry'); ArticleLog::logEvent($authorSubmission->getId(), ARTICLE_LOG_AUTHOR_REVISION, ARTICLE_LOG_TYPE_AUTHOR, $user->getId(), 'log.author.documentRevised', array('authorName' => $user->getFullName(), 'fileId' => $fileId, 'articleId' => $authorSubmission->getId())); } //%CBP% if the submission has been approved by the editor, update the galley reference to the latest version just uploaded if ($authorSubmission->getSubmissionStatus() == STATUS_QUEUED_EDITING || $authorSubmission->getSubmissionStatus() == STATUS_PUBLISHED) { $CBPPlatformDao->setGalleyFileId($authorSubmission->getId(), $fileId); } }
/** * Upload the annotated version of an article. * @param $reviewId int * @param $reviewerSubmission object * @param $request object */ function uploadReviewerVersion($reviewId, $reviewerSubmission, $request) { import('classes.file.ArticleFileManager'); $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO'); $reviewAssignment =& $reviewAssignmentDao->getById($reviewId); $articleFileManager = new ArticleFileManager($reviewAssignment->getSubmissionId()); // Only upload the file if the reviewer has yet to submit a recommendation // and if review forms are not used if (($reviewAssignment->getRecommendation() === null || $reviewAssignment->getRecommendation() === '') && !$reviewAssignment->getCancelled()) { $fileName = 'upload'; if ($articleFileManager->uploadedFileExists($fileName)) { HookRegistry::call('ReviewerAction::uploadReviewFile', array(&$reviewAssignment)); if ($reviewAssignment->getReviewerFileId() != null) { $fileId = $articleFileManager->uploadReviewFile($fileName, $reviewAssignment->getReviewerFileId()); } else { $fileId = $articleFileManager->uploadReviewFile($fileName); } } } if (isset($fileId) && $fileId != 0) { $reviewAssignment->setReviewerFileId($fileId); $reviewAssignment->stampModified(); $reviewAssignmentDao->updateReviewAssignment($reviewAssignment); $userDao =& DAORegistry::getDAO('UserDAO'); $reviewer =& $userDao->getUser($reviewAssignment->getReviewerId()); // Add log import('classes.article.log.ArticleLog'); ArticleLog::logEvent($request, $reviewerSubmission, ARTICLE_LOG_REVIEW_FILE, 'log.review.reviewerFile', array('reviewId' => $reviewAssignment->getId())); } }
/** * Upload a review on behalf of its reviewer. * @param $reviewId int */ function uploadReviewForReviewer($reviewId) { $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO'); $sectionDecisionDao =& DAORegistry::getDAO('SectionDecisionDAO'); $userDao =& DAORegistry::getDAO('UserDAO'); $articleDao =& DAORegistry::getDAO('ArticleDAO'); $user =& Request::getUser(); $reviewAssignment =& $reviewAssignmentDao->getById($reviewId); $sectionDecision =& $sectionDecisionDao->getSectionDecision($reviewAssignment->getDecisionId()); $article =& $articleDao->getArticle($sectionDecision->getArticleId()); $reviewer =& $userDao->getUser($reviewAssignment->getReviewerId(), true); if (HookRegistry::call('SectionEditorAction::uploadReviewForReviewer', array(&$reviewAssignment, &$reviewer))) { return; } // Upload the review file. import('classes.file.ArticleFileManager'); $articleFileManager = new ArticleFileManager($sectionDecision->getArticleId()); // Only upload the file if the reviewer has yet to submit a recommendation if (($reviewAssignment->getRecommendation() === null || $reviewAssignment->getRecommendation() === '') && !$reviewAssignment->getCancelled()) { $fileName = 'upload'; if ($articleFileManager->uploadedFileExists($fileName)) { // Check if file already uploaded $reviewFile =& $reviewAssignment->getReviewerFile(); if ($reviewFile != null) { $articleFileManager->deleteFile($reviewFile->getFileId()); } if ($reviewAssignment->getReviewerFileId() != null) { $fileId = $articleFileManager->uploadReviewFile($fileName, $reviewAssignment->getDecisionId(), $reviewAssignment->getReviewerFileId()); } else { $fileId = $articleFileManager->uploadReviewFile($fileName, $reviewAssignment->getDecisionId()); } } } if (isset($fileId) && $fileId != 0) { // Only confirm the review for the reviewer if // he has not previously done so. if ($reviewAssignment->getDateConfirmed() == null) { $reviewAssignment->setDeclined(0); $reviewAssignment->setDateConfirmed(Core::getCurrentDate()); } $reviewAssignment->setReviewerFileId($fileId); $reviewAssignment->stampModified(); $reviewAssignmentDao->updateReviewAssignment($reviewAssignment); // Add log import('classes.article.log.ArticleLog'); import('classes.article.log.ArticleEventLogEntry'); Locale::requireComponents(array(LOCALE_COMPONENT_APPLICATION_COMMON)); $entry = new ArticleEventLogEntry(); $entry->setArticleId($sectionDecision->getArticleId()); $entry->setUserId($user->getId()); $entry->setDateLogged(Core::getCurrentDate()); $entry->setEventType(ARTICLE_LOG_REVIEW_FILE_BY_PROXY); $entry->setLogMessage('log.review.reviewFileByProxy', array('reviewerName' => $reviewer->getFullName(), 'articleId' => $article->getProposalId(), 'userName' => $user->getFullName())); $entry->setAssocType(ARTICLE_LOG_TYPE_REVIEW); $entry->setAssocId($reviewAssignment->getId()); ArticleLog::logEventEntry($sectionDecision->getArticleId(), $entry); } }
/** * Upload the annotated version of an article. * @param $reviewId int */ function uploadReviewerVersion($reviewId) { import("file.ArticleFileManager"); $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO'); $reviewAssignment =& $reviewAssignmentDao->getReviewAssignmentById($reviewId); $articleFileManager = new ArticleFileManager($reviewAssignment->getArticleId()); // Only upload the file if the reviewer has yet to submit a recommendation // and if review forms are not used if (($reviewAssignment->getRecommendation() === null || $reviewAssignment->getRecommendation() === '') && !$reviewAssignment->getCancelled()) { $fileName = 'upload'; if ($articleFileManager->uploadedFileExists($fileName)) { HookRegistry::call('ReviewerAction::uploadReviewFile', array(&$reviewAssignment)); if ($reviewAssignment->getReviewerFileId() != null) { $fileId = $articleFileManager->uploadReviewFile($fileName, $reviewAssignment->getReviewerFileId()); } else { $fileId = $articleFileManager->uploadReviewFile($fileName); } } } if (isset($fileId) && $fileId != 0) { $reviewAssignment->setReviewerFileId($fileId); $reviewAssignment->stampModified(); $reviewAssignmentDao->updateReviewAssignment($reviewAssignment); // Add log import('article.log.ArticleLog'); import('article.log.ArticleEventLogEntry'); $userDao =& DAORegistry::getDAO('UserDAO'); $reviewer =& $userDao->getUser($reviewAssignment->getReviewerId()); $entry = new ArticleEventLogEntry(); $entry->setArticleId($reviewAssignment->getArticleId()); $entry->setUserId($reviewer->getId()); $entry->setDateLogged(Core::getCurrentDate()); $entry->setEventType(ARTICLE_LOG_REVIEW_FILE); $entry->setLogMessage('log.review.reviewerFile'); $entry->setAssocType(ARTICLE_LOG_TYPE_REVIEW); $entry->setAssocId($reviewAssignment->getId()); ArticleLog::logEventEntry($reviewAssignment->getArticleId(), $entry); } }