16 use \PKP\components\forms\FormComponent;
17 use \PKP\components\forms\FieldOptions;
18 use \PKP\components\forms\FieldSelect;
19 use \PKP\components\forms\FieldText;
20 use \PKP\components\forms\FieldUploadImage;
21 use \APP\components\forms\FieldSelectIssue;
23 define(
'FORM_ISSUE_ENTRY',
'issueEntry');
47 $issueOptions = [[
'value' =>
'',
'label' =>
'']];
49 'contextId' => $publicationContext->getId(),
50 'isPublished' =>
false,
52 if (count($unpublishedIterator)) {
53 $issueOptions[] = [
'value' =>
'',
'label' =>
'--- ' . __(
'editor.issues.futureIssues') .
' ---'];
54 foreach ($unpublishedIterator as $issue) {
56 'value' => (int) $issue->getId(),
57 'label' => $issue->getIssueIdentification(),
62 'contextId' => $publicationContext->getId(),
63 'isPublished' =>
true,
65 if (count($publishedIterator)) {
66 $issueOptions[] = [
'value' =>
'',
'label' =>
'--- ' . __(
'editor.issues.backIssues') .
' ---'];
67 foreach ($publishedIterator as $issue) {
69 'value' => (int) $issue->getId(),
70 'label' => $issue->getIssueIdentification(),
76 $sections =
\Services::get(
'section')->getSectionList($publicationContext->getId());
78 foreach ($sections as $section) {
80 'label' => (($section[
'group'])? __(
'publication.inactiveSection', [
'section' => $section[
'title']]) : $section[
'title']),
81 'value' => (
int) $section[
'id'],
86 'label' => __(
'issue.issue'),
87 'options' => $issueOptions,
88 'publicationStatus' => $publication->getData(
'status'),
89 'value' => $publication->getData(
'issueId') ? $publication->getData(
'issueId') : 0,
92 'label' => __(
'section.section'),
93 'options' => $sectionOptions,
94 'value' => (
int) $publication->getData(
'sectionId'),
98 $categoryOptions = [];
100 $categories = $categoryDao->getByContextId($publicationContext->getId())->toAssociativeArray();
101 foreach ($categories as $category) {
102 $label = $category->getLocalizedTitle();
103 if ($category->getParentId()) {
104 $label = $categories[$category->getParentId()]->getLocalizedTitle() .
' > ' . $label;
106 $categoryOptions[] = [
107 'value' => (int) $category->getId(),
111 if (!empty($categoryOptions)) {
113 'label' => __(
'submission.submit.placement.categories'),
114 'value' => (array) $publication->getData(
'categoryIds'),
115 'options' => $categoryOptions,
120 'label' => __(
'editor.article.coverImage'),
121 'value' => $publication->getData(
'coverImage'),
122 'isMultilingual' =>
true,
123 'baseUrl' => $baseUrl,
125 'url' => $temporaryFileApiUrl,
129 'label' => __(
'editor.issues.pages'),
130 'value' => $publication->getData(
'pages'),
133 'label' => __(
'publication.urlPath'),
134 'description' => __(
'publication.urlPath.description'),
135 'value' => $publication->getData(
'urlPath'),
137 ->addField(
new FieldText(
'datePublished', [
138 'label' => __(
'publication.datePublished'),
139 'description' => __(
'publication.datePublished.description'),
140 'value' => $publication->getData(
'datePublished'),