action = $action; $this->errors = $requirementErrors; $this->publication = $publication; $this->submissionContext = $submissionContext; // Set separate messages and buttons if publication requirements have passed if (empty($requirementErrors)) { $msg = __('publication.publish.confirmation'); $submitLabel = __('publication.publish'); if ($publication->getData('issueId')) { $issue = Repo::issue()->get($publication->getData('issueId')); if ($issue) { if ($issue->getData('published')) { $msg = __('publication.publish.confirmation.backIssue', ['issue' => htmlspecialchars($issue->getIssueIdentification())]); } else { $msg = __('publication.publish.confirmation.futureIssue', ['issue' => htmlspecialchars($issue->getIssueIdentification())]); $submitLabel = __('editor.submission.schedulePublication'); } } } // If a publication date has already been set and the date has passed this will // be published immediately regardless of the issue assignment if ($publication->getData('datePublished') && $publication->getData('datePublished') <= Core::getCurrentDate()) { $timestamp = strtotime($publication->getData('datePublished')); $dateFormatLong = PKPString::convertStrftimeFormat($submissionContext->getLocalizedDateFormatLong()); $msg = __( 'publication.publish.confirmation.datePublishedInPast', [ 'datePublished' => date($dateFormatLong, $timestamp), ] ); $submitLabel = __('publication.publish'); } $this->addPage([ 'id' => 'default', 'submitButton' => [ 'label' => $submitLabel, ], ]); } else { $msg = '
' . __('publication.publish.requirements') . '
'; $msg .= '