added compare_bib_entry_by_name()
This commit is contained in:
committed by
Martin Monperrus
parent
ef908a3298
commit
724eea77e4
@@ -1805,6 +1805,26 @@ function compare_bib_entry_by_raw_abbrv($a, $b)
|
||||
return strcmp($a->getRawAbbrv(),$b->getRawAbbrv());
|
||||
}
|
||||
|
||||
/** compares two instances of BibEntry by author or editor
|
||||
*/
|
||||
function compare_bib_entry_by_name($a, $b)
|
||||
{
|
||||
if ($a->hasField(AUTHOR))
|
||||
$namesA = $a->getAuthor();
|
||||
else if ($a->hasField(EDITOR))
|
||||
$namesA = $a->getField(EDITOR);
|
||||
else
|
||||
$namesA = __('No author');
|
||||
|
||||
if ($b->hasField(AUTHOR))
|
||||
$namesB = $b->getAuthor();
|
||||
else if ($b->hasField(EDITOR))
|
||||
$namesB = $b->getField(EDITOR);
|
||||
else
|
||||
$namesB = __('No author');
|
||||
|
||||
return strcmp($namesA, $namesB);
|
||||
}
|
||||
|
||||
/** compares two instances of BibEntry by month
|
||||
* @author Jan Geldmacher
|
||||
|
||||
Reference in New Issue
Block a user