Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3897 from bozana/6293
pkp/pkp-lib#6293 consider urnCheckNo setting, fix checkDuplicate in PubIdPlugin
- Loading branch information
Showing
8 changed files
with
160 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
/** | ||
* @file plugins/pubIds/urn/classes/form/FieldPubIdUrn.inc.php | ||
* | ||
* Copyright (c) 2014-2022 Simon Fraser University | ||
* Copyright (c) 2000-2022 John Willinsky | ||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING. | ||
* | ||
* @class FieldPubIdUrn | ||
* | ||
* @brief URN field, that is used for pattern suffixes and that considers check number. | ||
*/ | ||
|
||
namespace Plugins\Generic\URN; | ||
|
||
use PKP\components\forms\FieldPubId; | ||
|
||
class FieldPubIdUrn extends FieldPubId | ||
{ | ||
/** @copydoc Field::$component */ | ||
public $component = 'field-pub-id-urn'; | ||
|
||
public bool $applyCheckNumber = false; | ||
|
||
/** | ||
* @copydoc Field::getConfig() | ||
*/ | ||
public function getConfig() | ||
{ | ||
$config = parent::getConfig(); | ||
$config['applyCheckNumber'] = $this->applyCheckNumber; | ||
return $config; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* @defgroup plugins_pubIds_urn_js | ||
*/ | ||
/** | ||
* @file plugins/pubIds/urn/js/FieldPubIdUrn.js | ||
* | ||
* 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. | ||
* | ||
* @brief A Vue.js component for URN field, that is used for pattern suffixes and that considers check number. | ||
*/ | ||
|
||
pkp.Vue.component('field-pub-id-urn', { | ||
name: 'FieldPubIdUrn', | ||
extends: pkp.Vue.component('field-pub-id'), | ||
props: { | ||
applyCheckNumber: { | ||
type: Boolean, | ||
required: true | ||
} | ||
}, | ||
methods: { | ||
generateId() { | ||
var id = pkp.Vue.component('field-pub-id').options.methods['generateId'].apply(this); | ||
return this.applyCheckNumber | ||
? id + $.pkp.plugins.generic.urn.getCheckNumber(id, this.prefix) | ||
: id; | ||
} | ||
}, | ||
}); |
Oops, something went wrong.