From 24bcd93ae138ce213d36b0ffdc90626046c9b40c Mon Sep 17 00:00:00 2001 From: Vitalii Bezsheiko Date: Fri, 12 Jan 2024 18:40:51 +0200 Subject: [PATCH 1/2] 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 12f2097c384..fba0dc73b31 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,6 +37,11 @@ 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; + } + $locales = $this->context->getSupportedSubmissionMetadataLocales(); if (!in_array($primaryLocale = $submission->getData('locale'), $locales)) { @@ -48,4 +54,11 @@ protected function mapByProperties(array $props, Submission $submission): array 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" + ] } } } From 85167f308071a743c820102f12557db19e6f61fc Mon Sep 17 00:00:00 2001 From: Vitalii Bezsheiko Date: Wed, 15 May 2024 13:37:58 +0300 Subject: [PATCH 2/2] Submodule update ##Vitaliy-1/i8885_editorial_activity## --- lib/pkp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pkp b/lib/pkp index f29ce267fba..4c0c5a758f8 160000 --- a/lib/pkp +++ b/lib/pkp @@ -1 +1 @@ -Subproject commit f29ce267fbacc8d9285f0454079a50fabf44b235 +Subproject commit 4c0c5a758f85347d224546e67dcd3c9f30bfde0a