sort biblio in authors by year desceding
authorDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 12 Jan 2015 14:57:30 +0000 (15:57 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 12 Jan 2015 14:57:30 +0000 (15:57 +0100)
html.pl

diff --git a/html.pl b/html.pl
index 1d5ef4c..994570c 100755 (executable)
--- a/html.pl
+++ b/html.pl
@@ -387,7 +387,9 @@ sub author_html {
        foreach my $category ( sort keys %{ $authors->{$authid}->{$type} } ) {
                my $label = $category_label->{$category} || 'Bez kategorije';
                print $fh qq|<h3>$label</h3>\n<ul>\n|;
-               foreach my $biblionumber ( @{ $authors->{$authid}->{$type}->{$category} } ) {
+               foreach my $biblionumber ( sort {
+                               $biblio_year->{$b} <=> $biblio_year->{$a} || $a <=> $b
+                       } @{ $authors->{$authid}->{$type}->{$category} } ) {
                        print $fh li_biblio( $biblionumber );
                }
                print $fh qq|</ul>\n|;