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
56 changes: 33 additions & 23 deletions classes/components/forms/context/MetadataSettingsForm.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?php

/**
* @file classes/components/form/context/MetadataSettingsForm.php
*
* Copyright (c) 2014-2021 Simon Fraser University
* Copyright (c) 2000-2021 John Willinsky
* Copyright (c) 2014-2026 Simon Fraser University
* Copyright (c) 2000-2026 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @class MetadataSettingsForm
Expand All @@ -27,28 +28,37 @@ public function __construct($action, $context)
{
parent::__construct($action, $context);

$this->addField(new FieldOptions('enablePublisherId', [
'label' => __('submission.publisherId'),
'description' => __('submission.publisherId.description'),
'options' => [
[
'value' => 'publication',
'label' => __('submission.publisherId.enable', ['objects' => __('submission.publications')]),
],
[
'value' => 'galley',
'label' => __('submission.publisherId.enable', ['objects' => __('submission.layout.galleys')]),
],
[
'value' => 'issue',
'label' => __('submission.publisherId.enable', ['objects' => __('issue.issues')]),
$this
->addField(new FieldOptions('enablePublisherId', [
'label' => __('submission.publisherId'),
'description' => __('submission.publisherId.description'),
'options' => [
[
'value' => 'publication',
'label' => __('submission.publisherId.enable', ['objects' => __('submission.publications')]),
],
[
'value' => 'galley',
'label' => __('submission.publisherId.enable', ['objects' => __('submission.layout.galleys')]),
],
[
'value' => 'issue',
'label' => __('submission.publisherId.enable', ['objects' => __('issue.issues')]),
],
[
'value' => 'issueGalley',
'label' => __('submission.publisherId.enable', ['objects' => __('editor.issues.galleys')]),
],
],
[
'value' => 'issueGalley',
'label' => __('submission.publisherId.enable', ['objects' => __('editor.issues.galleys')]),
'value' => $context->getData('enablePublisherId') ? $context->getData('enablePublisherId') : [],
]))
->addField(new FieldOptions('enableArticleNumber', [
'label' => __('submission.articleNumber'),
'description' => __('submission.articleNumber.description'),
'options' => [
['value' => true, 'label' => __('manager.setup.metadata.articleNumber.enable')]
],
],
'value' => $context->getData('enablePublisherId') ? $context->getData('enablePublisherId') : [],
]));
'value' => (bool) $context->getData('enableArticleNumber'),
]));
}
}
14 changes: 12 additions & 2 deletions classes/core/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
/**
* @file classes/core/Application.php
*
* Copyright (c) 2014-2021 Simon Fraser University
* Copyright (c) 2003-2021 John Willinsky
* Copyright (c) 2014-2026 Simon Fraser University
* Copyright (c) 2003-2026 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @class Application
Expand Down Expand Up @@ -140,6 +140,16 @@ public function getPluginCategories(): array
];
}

/**
* Get the supported metadata setting names for this application.
*/
public static function getMetadataFields(): array
{
return array_merge(parent::getMetadataFields(), [
'articleNumber',
]);
}

/**
* Get the top-level context DAO.
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/pkp
7 changes: 7 additions & 0 deletions locale/en/manager.po
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,13 @@ msgstr "Continuous Publication"
msgid "manager.setup.issuelessPublication"
msgstr "Issueless Publication"

msgid "manager.setup.metadata.articleNumber.description"
msgstr ""
"The article number can be used in citations and other metadata instead of page numbers."

msgid "manager.setup.metadata.articleNumber.enable"
msgstr "Enable article number metadata"

msgid "manager.statistics.statistics"
msgstr "Journal Statistics"

Expand Down
5 changes: 5 additions & 0 deletions locale/en/submission.po
Original file line number Diff line number Diff line change
Expand Up @@ -469,3 +469,8 @@ msgstr ""
msgid "submission.submit.form.contributorRoleRequired"
msgstr "Please select the contributor's role."

msgid "submission.articleNumber"
msgstr "Article Number"

msgid "submission.articleNumber.description"
msgstr "The article number can be used in citations and other metadata instead of page numbers."
2 changes: 1 addition & 1 deletion plugins/generic/citationStyleLanguage
2 changes: 1 addition & 1 deletion plugins/generic/crossref
2 changes: 1 addition & 1 deletion plugins/generic/jatsTemplate
6 changes: 6 additions & 0 deletions schemas/context.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@
"nullable"
]
},
"enableArticleNumber": {
"type": "boolean",
"validation": [
"nullable"
]
},
"enableOpenAccessNotification": {
"type": "boolean",
"validation": [
Expand Down
6 changes: 6 additions & 0 deletions schemas/publication.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
"nullable"
]
},
"articleNumber": {
"type": "string",
"validation": [
"nullable"
]
},
"galleys": {
"type": "array",
"apiSummary": true,
Expand Down
22 changes: 16 additions & 6 deletions templates/frontend/objects/article_details.tpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{**
* templates/frontend/objects/article_details.tpl
*
* Copyright (c) 2014-2025 Simon Fraser University
* Copyright (c) 2003-2025 John Willinsky
* Copyright (c) 2014-2026 Simon Fraser University
* Copyright (c) 2003-2026 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @brief View of an Article which displays all details about the article.
Expand Down Expand Up @@ -129,7 +129,7 @@
{$contributorRoleName|escape}
</span>
{if !$contributorRoleName@last}{translate key="common.commaListSeparator"}{/if}
{strip}
{/strip}
{/foreach}
</span>
{if $author->getData('orcid')}
Expand Down Expand Up @@ -190,7 +190,7 @@
</h2>
<span class="value">
{foreach name="keywords" from=$publication->getLocalizedData('keywords') item="keyword"}
{$keyword.name|escape}{if !$smarty.foreach.keywords.last}{translate key="common.commaListSeparator"}{/if}
{$keyword.name|escape}{if !$smarty.foreach.keywords.last}{translate key="common.commaListSeparator"}{/if}
{/foreach}
</span>
</section>
Expand Down Expand Up @@ -417,9 +417,8 @@
{/if}

{* Issue article appears in *}
{if $issue || $section || $categories}
{if $issue || $section || $categories || $publication->getData('articleNumber')}
<div class="item issue">

{if $issue}
<section class="sub_item">
<h2 class="label">
Expand Down Expand Up @@ -458,6 +457,17 @@
</div>
</section>
{/if}

{if $publication->getData('articleNumber')}
<section class="sub_item">
<h2 class="label">
{translate key="submission.articleNumber"}
</h2>
<div class="value">
{$publication->getData('articleNumber')|escape}
</div>
</section>
{/if}
</div>
{/if}

Expand Down
Loading