diff --git a/includes/doi.inc b/includes/doi.inc index fc3f2ab..305dff7 100644 --- a/includes/doi.inc +++ b/includes/doi.inc @@ -99,11 +99,17 @@ function upei_roblib_ill_populate_form_doi($crossref_xml, $form) { foreach ($crossref_xml->getElementsbyTagName('person_name') as $person) { if ($person->getAttribute('contributor_role') == 'author' && $person->getAttribute('sequence') == 'first' + ) { + $article_author = upei_roblib_ill_get_xml_node($person, 'surname') . ',' . upei_roblib_ill_get_xml_node($person, 'given_name'); + } + if ($person->getAttribute('contributor_role') == 'editor' && + $person->getAttribute('sequence') == 'first' ) { $author = upei_roblib_ill_get_xml_node($person, 'surname') . ',' . upei_roblib_ill_get_xml_node($person, 'given_name'); } } - $form['ArticleAuthor']['#value'] = $author; + $form['ArticleAuthor']['#value'] = $article_author; + $form['Author']['#value'] = $author; return $form; } diff --git a/includes/utilities.inc b/includes/utilities.inc index 19a07e5..800009e 100644 --- a/includes/utilities.inc +++ b/includes/utilities.inc @@ -21,7 +21,8 @@ function upei_roblib_ill_clean_array($values) { if (isset($arr['ISBN'])) { $arr['ISBN'] = array($arr['ISBN']); } - if (isset($arr['Genre']) && ($arr['Genre'] == 'article' || $arr['Genre'] == 'chapter') && isset($arr['Author'])) { + // The below checks are due to ebscos habit of sending sending the same info in both atitle and title etc. + if (isset($arr['Genre']) && $arr['Genre'] == 'article' && isset($arr['Author'])) { // We want ArticleAuthor unset($arr['Author']); }