X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=opac%2Fopac-downloadcart.pl;h=12d6777c57874dfd8f9adc785cfe3e77bc46779d;hb=363e986c60b8d3a0fc6badf3739e58fbb3e65801;hp=ff1b58f49caacc96feac4383f9014640b7e121e9;hpb=6e0c124c9c271df11b3dd06666b5556c94e26bef;p=koha_fer diff --git a/opac/opac-downloadcart.pl b/opac/opac-downloadcart.pl index ff1b58f49c..12d6777c57 100755 --- a/opac/opac-downloadcart.pl +++ b/opac/opac-downloadcart.pl @@ -22,7 +22,6 @@ use warnings; use CGI; use Encode qw(encode); -use Switch; use C4::Auth; use C4::Biblio; @@ -61,19 +60,23 @@ if ($bib_list && $format) { $output = marc2csv(\@bibs, $format); - # Other formats + # Other formats } else { - foreach my $biblio (@bibs) { - - my $record = GetMarcBiblio($biblio); - next unless $record; - - switch ($format) { - case "iso2709" { $output .= $record->as_usmarc(); } - case "ris" { $output .= marc2ris($record); } - case "bibtex" { $output .= marc2bibtex($record, $biblio); } - } - } + foreach my $biblio (@bibs) { + + my $record = GetMarcBiblio($biblio, 1); + next unless $record; + + if ($format eq 'iso2709') { + $output .= $record->as_usmarc(); + } + elsif ($format eq 'ris') { + $output .= marc2ris($record); + } + elsif ($format eq 'bibtex') { + $output .= marc2bibtex($record, $biblio); + } + } } # If it was a CSV export we change the format after the export so the file extension is fine @@ -86,7 +89,7 @@ if ($bib_list && $format) { print $output; } else { - $template->param(csv_profiles => GetCsvProfilesLoop()); + $template->param(csv_profiles => GetCsvProfilesLoop('marc')); $template->param(bib_list => $bib_list); output_html_with_http_headers $query, $cookie, $template->output; }