Skip to content

Commit

Permalink
Merge pull request #1599 from kaitlinnewson/9784-3_3_0
Browse files Browse the repository at this point in the history
pkp/pkp-lib#9784 get unlocalized authorship metadata in onix export
  • Loading branch information
bozana authored Jun 25, 2024
2 parents 3ae1bb3 + e0ed87a commit 3cba7d2
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,10 @@ function createProductNode($doc, $submission, $publicationFormat) {
$userGroupDao = DAORegistry::getDAO('UserGroupDAO'); /* @var $userGroupDao UserGroupDAO */
$userGroup = $userGroupDao->getById($author->getUserGroupId(), $submission->getContextId());

$userGroupOnixMap = array('AU' => 'A01', 'VE' => 'B01', 'CA' => 'A01', 'Trans' => 'B06', 'PE' => 'B21'); // From List17, ContributorRole types.
$userGroupOnixMap = array('default.groups.name.author' => 'A01', 'default.groups.name.volumeEditor' => 'B01', 'default.groups.name.chapterAuthor' => 'A01', 'default.groups.name.translator' => 'B06', 'default.groups.name.editor' => 'B21'); // From List17, ContributorRole types.

$role = array_key_exists($userGroup->getLocalizedAbbrev(), $userGroupOnixMap) ? $userGroupOnixMap[$userGroup->getLocalizedAbbrev()] : 'Z99'; // Z99 - unknown contributor type.
$nameKey = $userGroup->getData('nameLocaleKey');
$role = array_key_exists($nameKey, $userGroupOnixMap) ? $userGroupOnixMap[$nameKey] : 'Z99'; // Z99 - unknown contributor type.

$contributorNode->appendChild($this->_buildTextNode($doc, 'ContributorRole', $role));
$contributorNode->appendChild($this->_buildTextNode($doc, 'PersonName', $author->getFullName(false)));
Expand Down

0 comments on commit 3cba7d2

Please sign in to comment.