Skip to content

Commit

Permalink
Merge pull request #4131 from Vitaliy-1/i8885_editorial_activity
Browse files Browse the repository at this point in the history
[TESTS ONLY] pkp/pkp-lib#8885
  • Loading branch information
Vitaliy-1 authored May 16, 2024
2 parents 81400f3 + 85167f3 commit a4f9cae
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
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"
]
}
}
}

0 comments on commit a4f9cae

Please sign in to comment.