From bb80b29aac0d020bc7979b5b7eb0303e1804dbb4 Mon Sep 17 00:00:00 2001 From: Kaitlin Newson Date: Tue, 18 Jun 2024 13:55:23 -0300 Subject: [PATCH] pkp/pkp-lib#9784 get unlocalized authorship metadata in onix export --- .../onix30/filter/MonographONIX30XmlFilter.inc.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/importexport/onix30/filter/MonographONIX30XmlFilter.inc.php b/plugins/importexport/onix30/filter/MonographONIX30XmlFilter.inc.php index 7ca4c146054..1ca7972e57c 100644 --- a/plugins/importexport/onix30/filter/MonographONIX30XmlFilter.inc.php +++ b/plugins/importexport/onix30/filter/MonographONIX30XmlFilter.inc.php @@ -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. - $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)));