Bug 5105 - Remove use of depreciated Switch module
[koha.git] / basket / downloadcart.pl
index 38c6277..456f0a4 100755 (executable)
@@ -22,7 +22,6 @@ use warnings;
 
 use CGI;
 use Encode qw(encode);
-use Switch;
 
 use C4::Auth;
 use C4::Biblio;
@@ -64,16 +63,20 @@ if ($bib_list && $format) {
     # Other formats
     } else {
 
-       foreach my $biblio (@bibs) {
+        foreach my $biblio (@bibs) {
 
-           my $record = GetMarcBiblio($biblio);
+            my $record = GetMarcBiblio($biblio);
 
-           switch ($format) {
-               case "iso2709" { $output .= $record->as_usmarc(); }
-               case "ris"     { $output .= marc2ris($record); }
-               case "bibtex"  { $output .= marc2bibtex($record, $biblio); }
-           }
-       }
+            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