Browse Source

added source author to form on doi lookups of chapters

9.x-1.0
Paul Pound 7 years ago
parent
commit
c6647e3a41
  1. 8
      includes/doi.inc
  2. 3
      includes/utilities.inc

8
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) { foreach ($crossref_xml->getElementsbyTagName('person_name') as $person) {
if ($person->getAttribute('contributor_role') == 'author' && if ($person->getAttribute('contributor_role') == 'author' &&
$person->getAttribute('sequence') == 'first' $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'); $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; return $form;
} }

3
includes/utilities.inc

@ -21,7 +21,8 @@ function upei_roblib_ill_clean_array($values) {
if (isset($arr['ISBN'])) { if (isset($arr['ISBN'])) {
$arr['ISBN'] = array($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 // We want ArticleAuthor
unset($arr['Author']); unset($arr['Author']);
} }

Loading…
Cancel
Save