Bug 20495: Remove get_saved_report
[koha.git] / opac / opac-downloadcart.pl
index c3217f0..76fa095 100755 (executable)
@@ -68,10 +68,15 @@ if ($bib_list && $format) {
         });
         foreach my $biblio (@bibs) {
 
-            my $record_unfiltered = GetMarcBiblio($biblio, 1);
-            my $record_filtered   = $record_unfiltered->clone();
-            my $record            =
-                $record_processor->process($record_filtered);
+            my $record = GetMarcBiblio({
+                biblionumber => $biblio,
+                embed_items  => 1 });
+            my $framework = &GetFrameworkCode( $biblio );
+            $record_processor->options({
+                interface => 'opac',
+                frameworkcode => $framework
+            });
+            $record_processor->process($record);
 
             next unless $record;
 
@@ -108,7 +113,7 @@ if ($bib_list && $format) {
     print $output;
 
 } else { 
-    $template->param(csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc' }) ]);
+    $template->param(csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc', used_for => 'export_records' }) ]);
     $template->param(bib_list => $bib_list); 
     output_html_with_http_headers $query, $cookie, $template->output;
 }