Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TESTS ONLY] pkp/pkp-lib#8885 #4131

Merged
merged 2 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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',
];
}
}
2 changes: 1 addition & 1 deletion lib/pkp
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"
]
}
}
}
Loading