Skip to content

Commit

Permalink
pkp/pkp-lib#8885 Add editorial activity related props to the submissi…
Browse files Browse the repository at this point in the history
…on schema
  • Loading branch information
Vitaliy-1 committed Apr 27, 2024
1 parent 3cdeadf commit cfa1b75
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
13 changes: 13 additions & 0 deletions classes/submission/maps/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

use APP\core\Application;
use APP\submission\Submission;
use PKP\submission\PKPSubmission;

class Schema extends \PKP\submission\maps\Schema
{
Expand All @@ -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)) {
Expand All @@ -48,4 +54,11 @@ protected function mapByProperties(array $props, Submission $submission): array

return $this->withExtensions($output, $submission);
}

protected function appSpecificProps(): array
{
return [
'scheduledIn',
];
}
}
9 changes: 9 additions & 0 deletions schemas/submission.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
}
}

0 comments on commit cfa1b75

Please sign in to comment.