From 54405c5a1a2a1bea15d0812c1d5a6c673a657477 Mon Sep 17 00:00:00 2001 From: Vitalii Bezsheiko Date: Fri, 12 Jan 2024 18:40:51 +0200 Subject: [PATCH] pkp/pkp-lib#8885 Add editorial activity related props to the submission schema --- classes/submission/maps/Schema.php | 13 +++++++++++++ schemas/submission.json | 9 +++++++++ 2 files changed, 22 insertions(+) diff --git a/classes/submission/maps/Schema.php b/classes/submission/maps/Schema.php index 272fda89697..7a7d6654461 100644 --- a/classes/submission/maps/Schema.php +++ b/classes/submission/maps/Schema.php @@ -15,6 +15,7 @@ use APP\core\Application; use APP\submission\Submission; +use PKP\submission\PKPSubmission; class Schema extends \PKP\submission\maps\Schema { @@ -36,10 +37,22 @@ protected function mapByProperties(array $props, Submission $submission): array ); } + if (in_array('scheduledIn', $props)) { + $output['scheduledIn'] = $submission->getData('status') == PKPSubmission::STATUS_SCHEDULED ? + $submission->getCurrentPublication()->getData('issueId') : null; + } + $output = $this->schemaService->addMissingMultilingualValues($this->schemaService::SCHEMA_SUBMISSION, $output, $this->context->getSupportedSubmissionLocales()); ksort($output); return $this->withExtensions($output, $submission); } + + protected function appSpecificProps(): array + { + return [ + 'scheduledIn', + ]; + } } diff --git a/schemas/submission.json b/schemas/submission.json index 1f98d04049b..56d02dc6a11 100644 --- a/schemas/submission.json +++ b/schemas/submission.json @@ -9,6 +9,15 @@ "type": "integer", "description": "The section this submission should be assigned to. This can only be passed when creating a new submission and the data is assigned to the first publication. After the submission is created, edit the publication to change the `sectionId`.", "writeOnly": true + }, + "scheduledIn": { + "type": "integer", + "description": "The submission status is `STATUS_SCHEDULED`. It shows the issue it is scheduled in.", + "apiSummary": true, + "readOnly": true, + "validation": [ + "nullable" + ] } } }