| Server IP : 10.10.92.66 / Your IP : 104.23.243.85 Web Server : Apache/2.4.52 (Ubuntu) System : Linux jurnalpolinema 5.15.0-177-generic #187-Ubuntu SMP Sat Apr 11 22:54:33 UTC 2026 x86_64 User : jurnal ( 1001) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/jurnal/public_html/classes/components/forms/publication/ |
Upload File : |
<?php
/**
* @file classes/components/form/publication/PublishForm.inc.php
*
* Copyright (c) 2014-2021 Simon Fraser University
* Copyright (c) 2000-2021 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @class PublishForm
* @ingroup classes_controllers_form
*
* @brief A preset form for confirming a publication's issue before publishing.
* It may also be used for scheduling a publication in an issue for later
* publication.
*/
namespace APP\components\forms\publication;
use \PKP\components\forms\FormComponent;
use \PKP\components\forms\FieldHTML;
use function PHP81_BC\strftime;
define('FORM_PUBLISH', 'publish');
class PublishForm extends FormComponent {
/** @copydoc FormComponent::$id */
public $id = FORM_PUBLISH;
/** @copydoc FormComponent::$method */
public $method = 'PUT';
/** @var \Publication */
public $publication;
/** @var \Context */
public $submissionContext;
/**
* Constructor
*
* @param $action string URL to submit the form to
* @param $publication Publication The publication to change settings for
* @param $submissionContext \Context journal or press
* @param $requirementErrors array A list of pre-publication requirements that are not met.
*/
public function __construct($action, $publication, $submissionContext, $requirementErrors) {
$this->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 = \Services::get('issue')->get($publication->getData('issueId'));
if ($issue) {
if ($issue->getData('published')) {
$msg = __('publication.publish.confirmation.backIssue', ['issue' => $issue->getIssueIdentification()]);
} else {
$msg = __('publication.publish.confirmation.futureIssue', ['issue' => $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 = $submissionContext->getLocalizedDateFormatLong();
$msg = __(
'publication.publish.confirmation.datePublishedInPast',
[
'datePublished' => strftime($dateFormatLong, $timestamp),
]
);
$submitLabel = __('publication.publish');
}
$this->addPage([
'id' => 'default',
'submitButton' => [
'label' => $submitLabel,
],
]);
} else {
$msg = '<p>' . __('publication.publish.requirements') . '</p>';
$msg .= '<ul>';
foreach ($requirementErrors as $error) {
$msg .= '<li>' . $error . '</li>';
}
$msg .= '</ul>';
$this->addPage([
'id' => 'default',
]);
}
$this->addGroup([
'id' => 'default',
'pageId' => 'default',
])
->addField(new FieldHTML('validation', [
'description' => $msg,
'groupId' => 'default',
]));
}
}