my $shelfnumber = $query->param('shelfnumber');
my $format = $query->param('format');
my $context = $query->param('context');
-my $dbh = C4::Context->dbh;
my $shelf = Koha::Virtualshelves->find( $shelfnumber );
if ( $shelf and $shelf->can_be_viewed( $borrowernumber ) ) {
if ($format =~ /^\d+$/) {
my @biblios;
while ( my $content = $contents->next ) {
- push @biblios, $content->biblionumber->biblionumber;
+ push @biblios, $content->biblionumber;
}
$output = marc2csv(\@biblios, $format);
# Other formats
filters => 'ViewPolicy'
});
while ( my $content = $contents->next ) {
- my $biblionumber = $content->biblionumber->biblionumber;
-
- my $record = GetMarcBiblio($biblionumber, 1);
+ my $biblionumber = $content->biblionumber;
+
+ my $record = GetMarcBiblio({
+ biblionumber => $biblionumber,
+ embed_items => 1 });
+ my $framework = &GetFrameworkCode( $biblionumber );
+ $record_processor->options({
+ interface => 'opac',
+ frameworkcode => $framework
+ });
$record_processor->process($record);
next unless $record;
$output .= marc2bibtex($record, $biblionumber);
}
elsif ( $format eq 'isbd' ) {
- my $framework = GetFrameworkCode( $biblionumber );
$output .= GetISBDView({
'record' => $record,
'template' => 'opac',
} else {
$template->param(fullpage => 1);
}
- $template->param(csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc' }) ]);
+ $template->param(csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc', used_for => 'export_records' }) ]);
$template->param( shelf => $shelf );
output_html_with_http_headers $query, $cookie, $template->output;
}