Skip to content

Commit

Permalink
pkp#229 OrcidProfilePlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
withanage committed Feb 12, 2023
1 parent f3042a8 commit 182d0bd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
23 changes: 12 additions & 11 deletions OrcidProfilePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -1319,17 +1319,18 @@ private function buildOrcidExternalIds($submission, $publication, $context, $iss
}

# Add issue ids if they exist
$pubId = $issue->getStoredPubId('doi');
$doiObject = $issue->getData('doiObject');
if ($doiObject) {
$externalIds[] = [
'external-id-type' => self::PUBID_TO_ORCID_EXT_ID['doi'],
'external-id-value' => $doiObject->getData('doi'),
'external-id-url' => [
'value' => $doiObject->getResolvingUrl()
],
'external-id-relationship' => 'part-of'
];
if($issue) {
$doiObject = $issue->getData('doiObject');
if ($doiObject) {
$externalIds[] = [
'external-id-type' => self::PUBID_TO_ORCID_EXT_ID['doi'],
'external-id-value' => $doiObject->getData('doi'),
'external-id-url' => [
'value' => $doiObject->getResolvingUrl()
],
'external-id-relationship' => 'part-of'
];
}
}
}
} else {
Expand Down
3 changes: 2 additions & 1 deletion mailables/OrcidRequestAuthorAuthorization.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

use APP\journal\Journal;
use APP\plugins\generic\orcidProfile\mailables\traits\OrcidVariables;
use APP\server\Server;
use APP\submission\Submission;
use PKP\mail\Mailable;
use PKP\mail\traits\Configurable;
Expand All @@ -34,7 +35,7 @@ class OrcidRequestAuthorAuthorization extends Mailable
protected static ?string $emailTemplateKey = 'ORCID_REQUEST_AUTHOR_AUTHORIZATION';
protected static array $toRoleIds = [Role::ROLE_ID_AUTHOR];

public function __construct(Journal $context, Submission $submission, string $oauthUrl)
public function __construct(Journal|Server $context, Submission $submission, string $oauthUrl)
{
parent::__construct([$context, $submission]);
$this->setupOrcidVariables($oauthUrl);
Expand Down

0 comments on commit 182d0bd

Please sign in to comment.