first commit
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
{**
|
||||
* plugins/pubIds/urn/templates/settingsForm.tpl
|
||||
*
|
||||
* Copyright (c) 2014-2021 Simon Fraser University
|
||||
* Copyright (c) 2003-2021 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* URN plugin settings
|
||||
*
|
||||
*}
|
||||
|
||||
<div id="description">{translate key="plugins.pubIds.urn.manager.settings.description"}</div>
|
||||
|
||||
<script src="{$baseUrl}/plugins/pubIds/urn/js/URNSettingsFormHandler.js"></script>
|
||||
<script>
|
||||
$(function() {ldelim}
|
||||
// Attach the form handler.
|
||||
$('#urnSettingsForm').pkpHandler('$.pkp.plugins.pubIds.urn.js.URNSettingsFormHandler');
|
||||
{rdelim});
|
||||
</script>
|
||||
<form class="pkp_form" id="urnSettingsForm" method="post" action="{url router=\PKP\core\PKPApplication::ROUTE_COMPONENT op="manage" category="pubIds" plugin=$pluginName verb="save"}">
|
||||
{csrf}
|
||||
{include file="common/formErrors.tpl"}
|
||||
{fbvFormArea id="urnObjectsFormArea" title="plugins.pubIds.urn.manager.settings.urnObjects"}
|
||||
<p class="pkp_help">{translate key="plugins.pubIds.urn.manager.settings.explainURNs"}</p>
|
||||
{fbvFormSection list="true"}
|
||||
{fbvElement type="checkbox" label="plugins.pubIds.urn.manager.settings.enableIssueURN" id="enableIssueURN" maxlength="40" checked=$enableIssueURN|compare:true}
|
||||
{fbvElement type="checkbox" label="plugins.pubIds.urn.manager.settings.enablePublicationURN" id="enablePublicationURN" maxlength="40" checked=$enablePublicationURN|compare:true}
|
||||
{fbvElement type="checkbox" label="plugins.pubIds.urn.manager.settings.enableRepresentationURN" id="enableRepresentationURN" maxlength="40" checked=$enableRepresentationURN|compare:true}
|
||||
{/fbvFormSection}
|
||||
{/fbvFormArea}
|
||||
{fbvFormArea id="urnPrefixFormArea" title="plugins.pubIds.urn.manager.settings.urnPrefix"}
|
||||
{fbvFormSection}
|
||||
<p class="pkp_help">{translate key="plugins.pubIds.urn.manager.settings.urnPrefix.description"}</p>
|
||||
{fbvElement type="text" id="urnPrefix" value=$urnPrefix required="true" label="plugins.pubIds.urn.manager.settings.urnPrefix" maxlength="40" size=$fbvStyles.size.MEDIUM}
|
||||
{/fbvFormSection}
|
||||
{/fbvFormArea}
|
||||
{fbvFormArea id="urnSuffixFormArea" title="plugins.pubIds.urn.manager.settings.urnSuffix"}
|
||||
<p class="pkp_help">{translate key="plugins.pubIds.urn.manager.settings.urnSuffix.description"}</p>
|
||||
{fbvFormSection list="true"}
|
||||
{if !in_array($urnSuffix, array("pattern", "customId"))}
|
||||
{assign var="checked" value=true}
|
||||
{else}
|
||||
{assign var="checked" value=false}
|
||||
{/if}
|
||||
{fbvElement type="radio" id="urnSuffixDefault" name="urnSuffix" value="default" label="plugins.pubIds.urn.manager.settings.urnSuffixDefault" checked=$checked}
|
||||
<span class="instruct">{translate key="plugins.pubIds.urn.manager.settings.urnSuffixDefault.description"}</span>
|
||||
{/fbvFormSection}
|
||||
{fbvFormSection list="true"}
|
||||
{fbvElement type="radio" id="urnSuffixCustomId" name="urnSuffix" value="customId" label="plugins.pubIds.urn.manager.settings.urnSuffixCustomIdentifier" checked=$urnSuffix|compare:"customId"}
|
||||
{/fbvFormSection}
|
||||
{fbvFormSection list="true"}
|
||||
{fbvElement type="radio" id="urnSuffixPattern" name="urnSuffix" value="pattern" label="plugins.pubIds.urn.manager.settings.urnSuffixPattern" checked=$urnSuffix|compare:"pattern"}
|
||||
<p class="pkp_help">{translate key="plugins.pubIds.urn.manager.settings.urnSuffixPattern.example"}</p>
|
||||
{fbvElement type="text" label="plugins.pubIds.urn.manager.settings.urnSuffixPattern.issues" id="urnIssueSuffixPattern" value=$urnIssueSuffixPattern maxlength="40" inline=true size=$fbvStyles.size.MEDIUM}
|
||||
{fbvElement type="text" label="plugins.pubIds.urn.manager.settings.urnSuffixPattern.submissions" id="urnPublicationSuffixPattern" value=$urnPublicationSuffixPattern maxlength="40" inline=true size=$fbvStyles.size.MEDIUM}
|
||||
{fbvElement type="text" label="plugins.pubIds.urn.manager.settings.urnSuffixPattern.representations" id="urnRepresentationSuffixPattern" value=$urnRepresentationSuffixPattern maxlength="40" inline=true size=$fbvStyles.size.MEDIUM}
|
||||
{/fbvFormSection}
|
||||
{/fbvFormArea}
|
||||
{fbvFormArea id="urnCheckNoFormArea" title="plugins.pubIds.urn.manager.settings.checkNo"}
|
||||
{fbvFormSection list="true" }
|
||||
{fbvElement type="checkbox" id="urnCheckNo" name="urnCheckNo" label="plugins.pubIds.urn.manager.settings.checkNo.label" checked=$urnCheckNo|compare:true}
|
||||
{/fbvFormSection}
|
||||
{/fbvFormArea}
|
||||
{fbvFormArea id="urnNamespaceFormArea" title="plugins.pubIds.urn.manager.settings.namespace"}
|
||||
{fbvFormSection}
|
||||
<p class="pkp_help">{translate key="plugins.pubIds.urn.manager.settings.namespace.description"}</p>
|
||||
{fbvElement type="select" id="urnNamespace" required="true" from=$urnNamespaces selected=$urnNamespace translate=false size=$fbvStyles.size.MEDIUM label="plugins.pubIds.urn.manager.settings.namespace"}
|
||||
{/fbvFormSection}
|
||||
{/fbvFormArea}
|
||||
{fbvFormArea id="urnResolverFormArea" title="plugins.pubIds.urn.manager.settings.urnResolver"}
|
||||
{fbvFormSection}
|
||||
<p class="pkp_help">{translate key="plugins.pubIds.urn.manager.settings.urnResolver.description"}</p>
|
||||
{fbvElement type="text" id="urnResolver" value=$urnResolver required="true" label="plugins.pubIds.urn.manager.settings.urnResolver"}
|
||||
{/fbvFormSection}
|
||||
{/fbvFormArea}
|
||||
{fbvFormArea id="urnReassignFormArea" title="plugins.pubIds.urn.manager.settings.urnReassign"}
|
||||
{fbvFormSection}
|
||||
<div class="instruct">{translate key="plugins.pubIds.urn.manager.settings.urnReassign.description"}</div>
|
||||
{include file="linkAction/linkAction.tpl" action=$clearPubIdsLinkAction contextId="urnSettingsForm"}
|
||||
{/fbvFormSection}
|
||||
{/fbvFormArea}
|
||||
{fbvFormButtons submitText="common.save"}
|
||||
</form>
|
||||
<p><span class="formRequired">{translate key="common.requiredField"}</span></p>
|
||||
@@ -0,0 +1,35 @@
|
||||
{**
|
||||
* @file plugins/pubIds/urn/templates/urnAssign.tpl
|
||||
*
|
||||
* Copyright (c) 2014-2021 Simon Fraser University
|
||||
* Copyright (c) 2003-2021 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* Assign URN to an object option.
|
||||
*}
|
||||
|
||||
{assign var=pubObjectType value=$pubIdPlugin->getPubObjectType($pubObject)}
|
||||
{assign var=enableObjectURN value=$pubIdPlugin->getSetting($currentContext->getId(), "enable`$pubObjectType`URN")}
|
||||
{if $enableObjectURN}
|
||||
{fbvFormArea id="pubIdURNFormArea" class="border" title="plugins.pubIds.urn.editor.urn"}
|
||||
{if $pubObject->getStoredPubId($pubIdPlugin->getPubIdType())}
|
||||
{fbvFormSection}
|
||||
<p class="pkp_help">{translate key="plugins.pubIds.urn.editor.assignURN.assigned" pubId=$pubObject->getStoredPubId($pubIdPlugin->getPubIdType())}</p>
|
||||
{/fbvFormSection}
|
||||
{else}
|
||||
{assign var=pubId value=$pubIdPlugin->getPubId($pubObject)}
|
||||
{if !$canBeAssigned}
|
||||
{fbvFormSection}
|
||||
{if !$pubId}
|
||||
<p class="pkp_help">{translate key="plugins.pubIds.urn.editor.assignURN.emptySuffix"}</p>
|
||||
{else}
|
||||
<p class="pkp_help">{translate key="plugins.pubIds.urn.editor.assignURN.pattern" pubId=$pubId}</p>
|
||||
{/if}
|
||||
{/fbvFormSection}
|
||||
{else}
|
||||
{assign var=templatePath value=$pubIdPlugin->getTemplateResource('urnAssignCheckBox.tpl')}
|
||||
{include file=$templatePath pubId=$pubId pubObjectType=$pubObjectType}
|
||||
{/if}
|
||||
{/if}
|
||||
{/fbvFormArea}
|
||||
{/if}
|
||||
@@ -0,0 +1,16 @@
|
||||
{**
|
||||
* @file plugins/pubIds/urn/templates/urnAssignCheckBox.tpl
|
||||
*
|
||||
* Copyright (c) 2014-2021 Simon Fraser University
|
||||
* Copyright (c) 2003-2021 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* Displayed only if the URN can be assigned.
|
||||
* Assign URN form check box included in urnSuffixEdit.tpl and urnAssign.tpl.
|
||||
*}
|
||||
|
||||
{capture assign=translatedObjectType}{translate key="plugins.pubIds.urn.editor.urnObjectType"|cat:$pubObjectType}{/capture}
|
||||
{capture assign=assignCheckboxLabel}{translate key="plugins.pubIds.urn.editor.assignURN" pubId=$pubId pubObjectType=$translatedObjectType}{/capture}
|
||||
{fbvFormSection list=true}
|
||||
{fbvElement type="checkbox" id="assignURN" checked="true" value="1" label=$assignCheckboxLabel translate=false disabled=$disabled}
|
||||
{/fbvFormSection}
|
||||
@@ -0,0 +1,72 @@
|
||||
{**
|
||||
* plugins/pubIds/urn/templates/urnSuffixEdit.tpl
|
||||
*
|
||||
* Copyright (c) 2014-2021 Simon Fraser University
|
||||
* Copyright (c) 2003-2021 John Willinsky
|
||||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
|
||||
*
|
||||
* Edit custom URN suffix for an object (issue, submission, file)
|
||||
*
|
||||
*}
|
||||
{load_script context="publicIdentifiersForm" scripts=$scripts}
|
||||
|
||||
{assign var=pubObjectType value=$pubIdPlugin->getPubObjectType($pubObject)}
|
||||
{assign var=enableObjectURN value=$pubIdPlugin->getSetting($currentContext->getId(), "enable`$pubObjectType`URN")}
|
||||
{if $enableObjectURN}
|
||||
{assign var=storedPubId value=$pubObject->getStoredPubId($pubIdPlugin->getPubIdType())}
|
||||
{fbvFormArea id="pubIdURNFormArea" class="border" title="plugins.pubIds.urn.editor.urn"}
|
||||
{assign var=formArea value=true}
|
||||
{if $pubIdPlugin->getSetting($currentJournal->getId(), 'urnSuffix') == 'customId' || $storedPubId}
|
||||
{if empty($storedPubId)} {* edit custom suffix *}
|
||||
{fbvFormSection}
|
||||
{assign var=checkNo value=$pubIdPlugin->getSetting($currentContext->getId(), 'urnCheckNo')}
|
||||
<p class="pkp_help">{translate key="plugins.pubIds.urn.manager.settings.urnSuffix.description"}</p>
|
||||
{fbvElement type="text" label="plugins.pubIds.urn.manager.settings.urnPrefix" id="urnPrefix" disabled=true value=$pubIdPlugin->getSetting($currentContext->getId(), 'urnPrefix') size=$fbvStyles.size.SMALL inline=true }
|
||||
{fbvElement type="text" label="plugins.pubIds.urn.manager.settings.urnSuffix" id="urnSuffix" value=$urnSuffix size=$fbvStyles.size.MEDIUM inline=true }
|
||||
{if $checkNo}{fbvElement type="button" label="plugins.pubIds.urn.editor.addCheckNo" id="checkNo" inline=true}{/if}
|
||||
{/fbvFormSection}
|
||||
{if $canBeAssigned}
|
||||
<p class="pkp_help">{translate key="plugins.pubIds.urn.editor.canBeAssigned"}</p>
|
||||
{assign var=templatePath value=$pubIdPlugin->getTemplateResource('urnAssignCheckBox.tpl')}
|
||||
{include file=$templatePath pubId="" pubObjectType=$pubObjectType}
|
||||
{else}
|
||||
<p class="pkp_help">{translate key="plugins.pubIds.urn.editor.customSuffixMissing"}</p>
|
||||
{/if}
|
||||
{else} {* stored pub id and clear option *}
|
||||
<p>
|
||||
{$storedPubId|escape}<br />
|
||||
{capture assign=translatedObjectType}{translate key="plugins.pubIds.urn.editor.urnObjectType"|cat:$pubObjectType}{/capture}
|
||||
{capture assign=assignedMessage}{translate key="plugins.pubIds.urn.editor.assigned" pubObjectType=$translatedObjectType}{/capture}
|
||||
<p class="pkp_help">{$assignedMessage}</p>
|
||||
{include file="linkAction/linkAction.tpl" action=$clearPubIdLinkActionURN contextId="publicIdentifiersForm"}
|
||||
</p>
|
||||
{/if}
|
||||
{else} {* pub id preview *}
|
||||
<p>{$pubIdPlugin->getPubId($pubObject)|escape}</p>
|
||||
{if $canBeAssigned}
|
||||
<p class="pkp_help">{translate key="plugins.pubIds.urn.editor.canBeAssigned"}</p>
|
||||
{assign var=templatePath value=$pubIdPlugin->getTemplateResource('urnAssignCheckBox.tpl')}
|
||||
{include file=$templatePath pubId="" pubObjectType=$pubObjectType}
|
||||
{else}
|
||||
<p class="pkp_help">{translate key="plugins.pubIds.urn.editor.patternNotResolved"}</p>
|
||||
{/if}
|
||||
{/if}
|
||||
{/fbvFormArea}
|
||||
{/if}
|
||||
{* issue pub object *}
|
||||
{if $pubObjectType == 'Issue'}
|
||||
{assign var=enablePublicationURN value=$pubIdPlugin->getSetting($currentContext->getId(), "enablePublicationURN")}
|
||||
{assign var=enableRepresentationURN value=$pubIdPlugin->getSetting($currentContext->getId(), "enableRepresentationURN")}
|
||||
{if $enablePublicationURN || $enableRepresentationURN}
|
||||
{if !$formArea}
|
||||
{assign var="formAreaTitle" value="plugins.pubIds.urn.editor.urn"}
|
||||
{else}
|
||||
{assign var="formAreaTitle" value=""}
|
||||
{/if}
|
||||
{fbvFormArea id="pubIdURNIssueobjectsFormArea" class="border" title=$formAreaTitle}
|
||||
{fbvFormSection list="true" description="plugins.pubIds.urn.editor.clearIssueObjectsURN.description"}
|
||||
{include file="linkAction/linkAction.tpl" action=$clearIssueObjectsPubIdsLinkActionURN contextId="publicIdentifiersForm"}
|
||||
{/fbvFormSection}
|
||||
{/fbvFormArea}
|
||||
{/if}
|
||||
{/if}
|
||||
Reference in New Issue
Block a user