From f71271af7e9e894f21c2ef9e7dc8e0e1e91d7fd5 Mon Sep 17 00:00:00 2001 From: Dimitris Efstathiou Date: Wed, 30 Aug 2023 08:24:19 +0300 Subject: [PATCH] pkp/pkp-lib#9268 Add orcidProfile plugin's schema properties to codebase --- OrcidProfilePlugin.php | 83 ------------------------------------------ 1 file changed, 83 deletions(-) diff --git a/OrcidProfilePlugin.php b/OrcidProfilePlugin.php index 579efedc..79cd5616 100755 --- a/OrcidProfilePlugin.php +++ b/OrcidProfilePlugin.php @@ -144,89 +144,6 @@ public function register($category, $path, $mainContextId = null) Hook::add('ThankReviewerForm::thankReviewer', $this->handleThankReviewer(...)); - // Add more ORCiD fields to author Schema - Hook::add('Schema::get::author', function ($hookName, $args) { - $schema = &$args[0]; - - $schema->properties->orcidSandbox = (object)[ - 'type' => 'string', - 'apiSummary' => true, - 'validation' => ['nullable'] - ]; - $schema->properties->orcidAccessToken = (object)[ - 'type' => 'string', - 'apiSummary' => true, - 'validation' => ['nullable'] - ]; - $schema->properties->orcidAccessScope = (object)[ - 'type' => 'string', - 'apiSummary' => true, - 'validation' => ['nullable'] - ]; - $schema->properties->orcidRefreshToken = (object)[ - 'type' => 'string', - 'apiSummary' => true, - 'validation' => ['nullable'] - ]; - $schema->properties->orcidAccessExpiresOn = (object)[ - 'type' => 'string', - 'apiSummary' => true, - 'validation' => ['nullable'] - ]; - $schema->properties->orcidAccessDenied = (object)[ - 'type' => 'string', - 'apiSummary' => true, - 'validation' => ['nullable'] - ]; - $schema->properties->orcidEmailToken = (object)[ - 'type' => 'string', - 'apiSummary' => true, - 'validation' => ['nullable'] - ]; - $schema->properties->orcidWorkPutCode = (object)[ - 'type' => 'string', - 'apiSummary' => true, - 'validation' => ['nullable'] - ]; - }); - - // Add more ORCiD fields to user Schema - Hook::add('Schema::get::user', function ($hookName, $args) { - $schema = &$args[0]; - - $schema->properties->orcidAccessToken = (object)[ - 'type' => 'string', - 'apiSummary' => true, - 'validation' => ['nullable'] - ]; - $schema->properties->orcidAccessScope = (object)[ - 'type' => 'string', - 'apiSummary' => true, - 'validation' => ['nullable'] - ]; - $schema->properties->orcidRefreshToken = (object)[ - 'type' => 'string', - 'apiSummary' => true, - 'validation' => ['nullable'] - ]; - $schema->properties->orcidAccessExpiresOn = (object)[ - 'type' => 'string', - 'apiSummary' => true, - 'validation' => ['nullable'] - ]; - $schema->properties->orcidAccessDenied = (object)[ - 'type' => 'string', - 'apiSummary' => true, - 'validation' => ['nullable'] - ]; - $schema->properties->orcidReviewPutCode = (object)[ - 'type' => 'string', - 'apiSummary' => true, - 'validation' => ['nullable'] - ]; - }); - Services::get('schema')->get(PKPSchemaService::SCHEMA_USER, true); - Hook::add('Mailer::Mailables', $this->addMailable(...)); Hook::add('Author::edit', $this->handleAuthorFormExecute(...)); Hook::add('Form::config::before', $this->addOrcidFormFields(...));