Skip to content

Commit

Permalink
*5316* Fixed author sequencing
Browse files Browse the repository at this point in the history
  • Loading branch information
asmecher committed Apr 15, 2010
1 parent 0538886 commit 224b581
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions plugins/importexport/crossref/CrossRefExportDom.inc.php
Expand Up @@ -175,8 +175,10 @@ function &generateJournalArticleDom(&$doc, &$journal, &$issue, &$section, &$arti
$contributorsNode =& XMLCustomWriter::createElement($doc, 'contributors');

/* AuthorList */
$isFirst = true;
foreach ($article->getAuthors() as $author) {
$authorNode =& CrossRefExportDom::generateAuthorDom($doc, $author);
$authorNode =& CrossRefExportDom::generateAuthorDom($doc, $author, $isFirst);
$isFirst = false;
XMLCustomWriter::appendChild($contributorsNode, $authorNode);
}
XMLCustomWriter::appendChild($journalArticleNode, $contributorsNode);
Expand Down Expand Up @@ -215,12 +217,12 @@ function &generateDOIdataDom(&$doc, $DOI, $url) {
* @param $author Author
* @return XMLNode
*/
function &generateAuthorDom(&$doc, &$author) {
function &generateAuthorDom(&$doc, &$author, $isFirst = false) {
$authorNode =& XMLCustomWriter::createElement($doc, 'person_name');
XMLCustomWriter::setAttribute($authorNode, 'contributor_role', 'author');

/* there should only be 1 primary contact per article */
if ($author->getPrimaryContact()) {
if ($isFirst) {
XMLCustomWriter::setAttribute($authorNode, 'sequence', 'first');
} else {
XMLCustomWriter::setAttribute($authorNode, 'sequence', 'additional');
Expand Down

0 comments on commit 224b581

Please sign in to comment.