Skip to content

Commit

Permalink
#9453 Add support for OMP - Multiple stageIds
Browse files Browse the repository at this point in the history
  • Loading branch information
defstat committed May 1, 2024
1 parent 5a589a4 commit 9c3d107
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
15 changes: 11 additions & 4 deletions api/v1/reviews/PKPReviewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,14 @@ public function getHistory(Request $illuminateRequest): JsonResponse

$submission = Repo::submission()->get($submissionId, $contextId);
$publication = $submission->getCurrentPublication();
//$publicationTitlePrefix = $publication->getData('prefix');
$publicationTitle = $publication->getData('title');

$section = Repo::section()->get($submission->getSectionId());
$publicationType = $section->getData('title');
$publicationType = null;
if ($submission->getSectionId()) {
$section = Repo::section()->get($submission->getSectionId());
$publicationType = $section->getData('title');
}

$publicationAbstract = $publication->getData('abstract');
$publicationKeywords = $publication->getData('keywords');

Expand Down Expand Up @@ -172,27 +175,31 @@ public function getHistory(Request $illuminateRequest): JsonResponse
->filterByFileStages([SubmissionFile::SUBMISSION_FILE_REVIEW_ATTACHMENT])
->filterByAssoc(PKPApplication::ASSOC_TYPE_REVIEW_ASSIGNMENT, [$reviewAssignmentId])
->getMany();

$attachmentsProps = Repo::submissionFile()
->getSchemaMap()
->mapMany($attachments, $fileGenres)
->toArray();

$stageId = $reviewAssignment->getStageId();
$lastReviewAssignment = Repo::reviewAssignment()->getCollector()
->filterByContextIds([$contextId])
->filterBySubmissionIds([$submissionId])
->filterByReviewerIds([$reviewerId])
->filterByStageId($stageId)
->filterByLastReviewRound(true)
->getMany()
->first();

$filesProps = [];
if ($lastReviewAssignment->getDeclined() != 1) {
if ($lastReviewAssignment && $lastReviewAssignment->getDeclined() != 1) {
$files = Repo::submissionFile()->getCollector()
->filterBySubmissionIds([$submissionId])
->filterByReviewRoundIds([$reviewRoundId])
->filterByAssoc(PKPApplication::ASSOC_TYPE_REVIEW_ROUND, [$reviewAssignmentId])
->filterByFileStages([SubmissionFile::SUBMISSION_FILE_REVIEW_FILE])
->getMany();

$filesProps = Repo::submissionFile()
->getSchemaMap()
->mapMany($files, $fileGenres)
Expand Down
1 change: 1 addition & 0 deletions pages/reviewer/PKPReviewerHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public function submission(array $args, PKPRequest $request): void
->filterByContextIds([$request->getContext()->getId()])
->filterBySubmissionIds([$submissionId])
->filterByReviewerIds([$reviewAssignment->getReviewerId()])
->filterByStageId($reviewAssignment->getStageId())
->getMany()
->toArray();
$reviewRoundHistories = [];
Expand Down

0 comments on commit 9c3d107

Please sign in to comment.