Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkp/pkp-lib#9784 get unlocalized authorship metadata in onix export #1599

Merged
merged 2 commits into from
Jun 25, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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('author' => 'A01', 'volumeEditor' => 'B01', 'chapterAuthor' => 'A01', 'translator' => 'B06', 'editor' => 'B21'); // From List17, ContributorRole types.
kaitlinnewson marked this conversation as resolved.
Show resolved Hide resolved

$role = array_key_exists($userGroup->getLocalizedAbbrev(), $userGroupOnixMap) ? $userGroupOnixMap[$userGroup->getLocalizedAbbrev()] : 'Z99'; // Z99 - unknown contributor type.
$abbrevKey = substr($userGroup->getData('abbrevLocaleKey'), strrpos($userGroup->getData('abbrevLocaleKey'), '.') + 1);
$role = array_key_exists($abbrevKey, $userGroupOnixMap) ? $userGroupOnixMap[$abbrevKey] : 'Z99'; // Z99 - unknown contributor type.

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