From 94cef1aceaa7a50979133dc6934dc1a023d3b918 Mon Sep 17 00:00:00 2001 From: withanage Date: Sat, 18 Jan 2025 07:53:05 +0100 Subject: [PATCH] handle reviewer stages --- .../filter/NativeXmlSubmissionFilter.php | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/plugins/importexport/native/filter/NativeXmlSubmissionFilter.php b/plugins/importexport/native/filter/NativeXmlSubmissionFilter.php index d012ee943e7..0ef6f04e2fc 100644 --- a/plugins/importexport/native/filter/NativeXmlSubmissionFilter.php +++ b/plugins/importexport/native/filter/NativeXmlSubmissionFilter.php @@ -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 @@ -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; } @@ -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, + ); + } + } }