Skip to content

Commit

Permalink
pkp/pkp-lib#9771 Move ORCID functionality into core application
Browse files Browse the repository at this point in the history
  • Loading branch information
ewhanson committed May 23, 2024
1 parent 19fa8ba commit e60a651
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 0 deletions.
20 changes: 20 additions & 0 deletions api/v1/orcid/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

/**
* @defgroup api_v1_orcid ORCID API requests
*/

/**
* @file api/v1/orcid/index.php
*
* Copyright (c) 2024 Simon Fraser University
* Copyright (c) 2024 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @ingroup api_v1_orcid
*
* @brief Handle requests for ORCID API functions.
*
*/

return new \PKP\handler\APIHandler(new \PKP\API\v1\orcid\OrcidController());
37 changes: 37 additions & 0 deletions classes/orcid/actions/SendSubmissionToOrcid.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

/**
* @file classes/orcid/actions/SendSubmissionToOrcid.php
*
* Copyright (c) 2014-2024 Simon Fraser University
* Copyright (c) 2000-2024 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @class SendSubmissionToOrcid
*
* @brief Compile and trigger deposits of submissions to ORCID.
*/

namespace APP\orcid\actions;

use PKP\orcid\actions\PKPSendSubmissionToOrcid;
use PKP\orcid\PKPOrcidWork;

class SendSubmissionToOrcid extends PKPSendSubmissionToOrcid
{
/**
* @inheritDoc
*/
protected function getOrcidWork(array $authors): ?PKPOrcidWork
{
return null;
}

/**
* @inheritDoc
*/
protected function canDepositSubmission(): bool
{
return false;
}
}
1 change: 1 addition & 0 deletions dbscripts/xml/upgrade.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
<migration class="PKP\migration\upgrade\v3_5_0\I9809_ReviewCancelDate"/>
<migration class="PKP\migration\upgrade\v3_5_0\I9860_EditorialMastheadNavMenuItem"/>
<migration class="PKP\migration\upgrade\v3_5_0\I8826_AddMissingForeignKeys" />
<migration class="PKP\migration\upgrade\v3_5_0\I9771_OrcidMigration"/>
</upgrade>

<!-- Update plugin configuration - should be done as the final upgrade task -->
Expand Down
6 changes: 6 additions & 0 deletions pages/catalog/CatalogBookHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
use PKP\core\PKPRequest;
use PKP\db\DAORegistry;
use PKP\facades\Locale;
use PKP\orcid\OrcidManager;
use PKP\plugins\Hook;
use PKP\plugins\PluginRegistry;
use PKP\security\authorization\ContextRequiredPolicy;
Expand Down Expand Up @@ -293,6 +294,11 @@ public function book($args, $request)
'licenseUrl' => $this->publication->getData('licenseUrl'),
]);

// Add Orcid icon
$templateMgr->assign([
'orcidIcon' => OrcidManager::getIcon(),
]);

// Ask robots not to index outdated versions and point to the canonical url for the latest version
if ($this->publication->getId() != $submission->getData('currentPublicationId')) {
$templateMgr->addHeader('noindex', '<meta name="robots" content="noindex">');
Expand Down
2 changes: 2 additions & 0 deletions plugins/themes/default/styles/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
@import "../../../../lib/pkp/styles/variables.less";
@import "../../../../lib/pkp/styles/utils.less";
@import "../../../../lib/pkp/styles/helpers.less";
// General ORCID styles
@import '../../../../lib/pkp/styles/orcid.less';

// Styles unique to this theme
@import "variables.less";
Expand Down
2 changes: 2 additions & 0 deletions registry/emailTemplates.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,6 @@
<email key="EDITORIAL_REMINDER" name="mailable.editorialReminder.name" subject="emails.editorialReminder.subject" body="emails.editorialReminder.body"/>
<email key="SUBMISSION_SAVED_FOR_LATER" name="mailable.submissionSavedForLater.name" subject="emails.submissionSavedForLater.subject" body="emails.submissionSavedForLater.body"/>
<email key="SUBMISSION_NEEDS_EDITOR" name="mailable.submissionNeedsEditor.name" subject="emails.submissionNeedsEditor.subject" body="emails.submissionNeedsEditor.body"/>
<email key="ORCID_COLLECT_AUTHOR_ID" name="orcidProfile.orcidCollectAuthorId.name" subject="emails.orcidCollectAuthorId.subject" body="emails.orcidCollectAuthorId.body"/>
<email key="ORCID_REQUEST_AUTHOR_AUTHORIZATION" name="orcidProfile.orcidRequestAuthorAuthorization.name" subject="emails.orcidRequestAuthorAuthorization.subject" body="emails.orcidRequestAuthorAuthorization.body"/>
</emails>

0 comments on commit e60a651

Please sign in to comment.