[% CGI.param('modifier').grep('available').size ? ' checked="checked"' : '' %] />
<label class="results_header_lbl">[% l('Limit to available items') %]</label>
+ <div class="results_header_div"></div>
+ <div class='results_header_sel'>
+ <a href="[% mkurl(ctx.opac_root _ '/export') %]">
+ [% l('Export All as MARC') %]</a>
+ </div>
<div class="clear-both"></div>
</div>
</div>
my $self = shift;
my %args = @_;
my $internal = $args{internal};
+ my $export = $args{export};
my $cgi = $self->cgi;
my $ctx = $self->ctx;
my $e = $self->editor;
return $bbag_err;
}
- $ctx->{page} = 'rresult' unless $internal;
+ $ctx->{page} = 'rresult' unless ($internal || $export);
$ctx->{ids} = [];
$ctx->{records} = [];
$ctx->{search_facets} = {};
(!defined $cgi->param("query") or $cgi->param("query") =~ /^\s*$/));
$self->timelog("Calling item barcode search");
return $self->item_barcode_shortcut if (
- $cgi->param("qtype") and ($cgi->param("qtype") eq "item_barcode") and not $internal
+ $cgi->param("qtype") and ($cgi->param("qtype") eq "item_barcode")
+ and not ($internal || $export)
);
$self->timelog("Calling call number browse");
return $self->call_number_browse_standalone if (
if ($internal) {
$limit = $offset + $limit + 1;
$offset = 0;
+ } elsif ($export) {
+ $limit = 1000;
+ $offset = 0;
}
my ($user_query, $query, $site, $depth) = _prepare_biblio_search($cgi, $ctx);
return $self->generic_redirect($url);
}
- return Apache2::Const::OK if @$rec_ids == 0 or $internal;
+ return Apache2::Const::OK if @$rec_ids == 0 || $internal || $export;
$self->load_rresults_bookbag_item_notes($rec_ids) if $ctx->{bookbag};
return Apache2::Const::OK;
}
+# KCLS:
+# Export a search result set as MARC records
+# Does not support metarecord searches
+sub load_export {
+ my $self = shift;
+ my $ctx = $self->ctx;
+ $ctx->{page} = 'export';
+
+ $self->load_rresults(export => 1);
+ my @bib_ids = @{$ctx->{ids}};
+
+ $logger->info("Exporting IDs: @bib_ids");
+
+ return Apache2::Const::OK unless @bib_ids;
+
+ my $url = sprintf(
+ "%s://%s/exporter?id=%s",
+ $self->ctx->{proto},
+ $self->ctx->{hostname},
+ join('&id=', @bib_ids)
+ );
+
+ $logger->info("Exporting with URL: $url");
+
+ return $self->generic_redirect($url);
+}
+
# If the calling search results in 1 record and the client
# is configured to do so, redirect the search results to
# the record details page.