X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=opac%2Fopac-downloadshelf.pl;h=ab1fe8daefd6c3f753816009c0fd9a888b786f7a;hb=574f613a1dfadfcd7c025139e6a63b1b1a0f729c;hp=5a3fb1fa1ea7e8d78d2fa4c171f6c98c09133d30;hpb=873a3cb9bc265be3a5f95e5c481403eb311bffbd;p=koha_fer diff --git a/opac/opac-downloadshelf.pl b/opac/opac-downloadshelf.pl index 5a3fb1fa1e..ab1fe8daef 100755 --- a/opac/opac-downloadshelf.pl +++ b/opac/opac-downloadshelf.pl @@ -22,7 +22,6 @@ use warnings; use CGI; use Encode qw(encode); -use Switch; use C4::Auth; use C4::Biblio; @@ -66,17 +65,22 @@ if ($shelfid && $format) { # Other formats } else { - foreach my $biblio (@$items) { - my $biblionumber = $biblio->{biblionumber}; + foreach my $biblio (@$items) { + my $biblionumber = $biblio->{biblionumber}; - my $record = GetMarcBiblio($biblionumber); + my $record = GetMarcBiblio($biblionumber); + next unless $record; - switch ($format) { - case "iso2709" { $output .= $record->as_usmarc(); } - case "ris" { $output .= marc2ris($record); } - case "bibtex" { $output .= marc2bibtex($record, $biblionumber); } - } - } + if ($format eq 'iso2709') { + $output .= $record->as_usmarc(); + } + elsif ($format eq 'ris' ) { + $output .= marc2ris($record); + } + elsif ($format eq 'bibtex') { + $output .= marc2bibtex($record, $biblionumber); + } + } } # If it was a CSV export we change the format after the export so the file extension is fine