-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkp/pkp-lib#8940 consider checkNo for default and custom pattern suff…
…ixes
- Loading branch information
Showing
7 changed files
with
130 additions
and
49 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
/** | ||
* @file plugins/pubIds/urn/classes/form/FieldPubIdUrn.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 A pub ID field that considers check number. | ||
*/ | ||
|
||
namespace APP\plugins\pubIds\urn\classes\form; | ||
|
||
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(); | ||
if (isset($this->applyCheckNumber)) { | ||
$config['applyCheckNumber'] = $this->applyCheckNumber; | ||
} | ||
return $config; | ||
} | ||
} |
10 changes: 5 additions & 5 deletions
10
plugins/pubIds/urn/classes/form/FieldUrn.php → .../pubIds/urn/classes/form/FieldTextUrn.php
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,28 @@ | ||
/** | ||
* @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 a pub ID field that considers check number. | ||
*/ | ||
|
||
pkp.Vue.component('field-pub-id-urn', { | ||
name: 'FieldPubIdUrn', | ||
extends: pkp.Vue.component('field-pub-id'), | ||
props: { | ||
applyCheckNumber: Boolean, | ||
}, | ||
methods: { | ||
generateId() { | ||
let 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; | ||
} | ||
}, | ||
}); |
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