Skip to content

Commit

Permalink
handle reviewer stages
Browse files Browse the repository at this point in the history
  • Loading branch information
withanage committed Jan 18, 2025
1 parent 4788455 commit 94cef1a
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions plugins/importexport/native/filter/NativeXmlSubmissionFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@
use APP\facades\Repo;
use APP\submission\Submission;
use PKP\core\Core;
use PKP\db\DAORegistry;
use PKP\filter\Filter;
use PKP\filter\FilterGroup;
use PKP\observers\events\BatchMetadataChanged;
use PKP\submission\reviewRound\ReviewRound;
use PKP\workflow\WorkflowStageDAO;

class NativeXmlSubmissionFilter extends NativeImportFilter
Expand Down Expand Up @@ -104,6 +106,9 @@ public function handleElement($node)
$submission = Repo::submission()->get($submission->getId());

$deployment->addImportedRootEntity(Application::ASSOC_TYPE_SUBMISSION, $submission);
//add Empty review stage for reviewed submissions
$stageName = $node->getAttribute('stage');
$this->handleSubmissionStage($stageName, $submission);

return $submission;
}
Expand Down Expand Up @@ -238,4 +243,22 @@ public function getImportFilter($elementName)
{
assert(false); // Subclasses should override
}

/**
* @param string $stageName
* @param Submission|null $submission
* @return void
* @throws \Exception
*/
public function handleSubmissionStage(string $stageName, ?Submission $submission): void
{
if ($stageName === "externalReview" or $stageName === "internalReview") {
$reviewRoundDao = DAORegistry::getDAO('ReviewRoundDAO');
$reviewRound = $reviewRoundDao->build(
$submission->getId(),
$submission->getData('stageId'),
ReviewRound::REVIEW_ROUND_STATUS_PENDING_REVIEWERS,
);
}
}
}

0 comments on commit 94cef1a

Please sign in to comment.