Skip to content
Open
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
25 changes: 21 additions & 4 deletions classes/components/forms/publication/PublishForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,35 @@ public function __construct($action, $publication, $submissionContext, $requirem

// Set separate messages and buttons if publication requirements have passed
if (empty($requirementErrors)) {
// Get any warnings that should be displayed when publishing.
$submission = Repo::submission()->get($publication->getData('submissionId'));
$warnings = Repo::publication()->validatePublishWarnings(
$publication,
$submission,
$submissionContext->getSupportedSubmissionLocales(),
$submissionContext->getPrimaryLocale()
);

if (!empty($warnings)) {
$msg = '<div class="pkpNotification"><b>' . __('publication.publish.warning') . '</b>';
$msg .= '<ul>';
foreach ($warnings as $error) {
$msg .= '<li>' . $error . '</li>';
}
$msg .= '</ul></div><br>';
}

$issue = $publication->getData('issueId')
? Repo::issue()->get($publication->getData('issueId'))
: null;
$msg = __('publication.publish.confirmation');
$msg .= __('publication.publish.confirmation');
$submitLabel = __('publication.publish');

// If the publication is marked as ready to publish,
// it will be published immediately regardless of the issue assignment
// or to a future issue, it will be published immediately
if ($publication->getData('status') == Publication::STATUS_READY_TO_PUBLISH) {
$msg = match($issue?->getData('published')) {
$msg .= match($issue?->getData('published')) {
true => __(
'publication.publish.confirmation.backIssue',
['issue' => htmlspecialchars($issue->getIssueIdentification())]
Expand All @@ -81,7 +99,7 @@ public function __construct($action, $publication, $submissionContext, $requirem
}

if ($publication->getData('status') == Publication::STATUS_READY_TO_SCHEDULE) {
$msg = __(
$msg .= __(
'publication.publish.confirmation.futureIssue',
['issue' => htmlspecialchars($issue->getIssueIdentification())]
);
Expand All @@ -92,7 +110,6 @@ public function __construct($action, $publication, $submissionContext, $requirem
$publicationVersion = $publication->getVersion();

if (!isset($publicationVersion)) {
$submission = Repo::submission()->get($publication->getData('submissionId'));
$nextVersion = Repo::submission()->getNextAvailableVersion($submission, Publication::DEFAULT_VERSION_STAGE, false);

$msg .= '<p>' . __('publication.required.versionStage') . '</p>';
Expand Down
2 changes: 1 addition & 1 deletion plugins/generic/crossref
Loading