@@ -, +, @@
- Apply the patch
- Add several records to your OPAC cart.
- Go to your cart, and choose 'Download'
- Dowload and open the exported records
- Add several records to a list (i did it from the cart ;-))
- Open the list
- Choose 'Download list'
- Download and open the exported records
- Sign off :-D
---
.../bootstrap/en/modules/opac-downloadcart.tt | 1 +
.../bootstrap/en/modules/opac-downloadshelf.tt | 1 +
opac/opac-downloadcart.pl | 16 ++++++++++++----
opac/opac-downloadshelf.pl | 14 +++++++++++---
4 files changed, 25 insertions(+), 7 deletions(-)
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadcart.tt
+++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadcart.tt
@@ -14,6 +14,7 @@
+
[% FOREACH csv_profile IN csv_profiles %]
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadshelf.tt
+++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadshelf.tt
@@ -53,6 +53,7 @@
+
[% FOREACH csv_profile IN csv_profiles %]
--- a/opac/opac-downloadcart.pl
+++ a/opac/opac-downloadcart.pl
@@ -52,8 +52,10 @@ if ($bib_list && $format) {
my @bibs = split( /\//, $bib_list );
- my $marcflavour = C4::Context->preference('marcflavour');
+ my $marcflavour = C4::Context->preference('marcflavour');
my $output;
+ my $extension;
+ my $type;
# CSV
if ($format =~ /^\d+$/) {
@@ -76,6 +78,11 @@ if ($bib_list && $format) {
elsif ($format eq 'bibtex') {
$output .= marc2bibtex($record, $biblio);
}
+ elsif ( $format eq 'isbd' ) {
+ $output .= GetISBDView($biblio, "opac");
+ $extension = "txt";
+ $type = "text/plain";
+ }
}
}
@@ -83,9 +90,10 @@ if ($bib_list && $format) {
$format = "csv" if ($format =~ m/^\d+$/);
print $query->header(
- -type => 'application/octet-stream',
- -'Content-Transfer-Encoding' => 'binary',
- -attachment=>"cart.$format");
+ -type => ($type) ? $type : 'application/octet-stream',
+ -'Content-Transfer-Encoding' => 'binary',
+ -attachment => ($extension) ? "cart.$format.$extension" : "cart.$format"
+ );
print $output;
} else {
--- a/opac/opac-downloadshelf.pl
+++ a/opac/opac-downloadshelf.pl
@@ -57,6 +57,8 @@ if ( ShelfPossibleAction( (defined($borrowernumber) ? $borrowernumber : -1), $sh
my ($items, $totitems) = GetShelfContents($shelfid);
my $marcflavour = C4::Context->preference('marcflavour');
my $output;
+ my $extension;
+ my $type;
# CSV
if ($format =~ /^\d+$/) {
@@ -83,6 +85,11 @@ if ( ShelfPossibleAction( (defined($borrowernumber) ? $borrowernumber : -1), $sh
elsif ($format eq 'bibtex') {
$output .= marc2bibtex($record, $biblionumber);
}
+ elsif ( $format eq 'isbd' ) {
+ $output .= GetISBDView($biblionumber, "opac");
+ $extension = "txt";
+ $type = "text/plain";
+ }
}
}
@@ -90,9 +97,10 @@ if ( ShelfPossibleAction( (defined($borrowernumber) ? $borrowernumber : -1), $sh
$format = "csv" if ($format =~ m/^\d+$/);
print $query->header(
- -type => 'application/octet-stream',
- -'Content-Transfer-Encoding' => 'binary',
- -attachment=>"shelf.$format");
+ -type => ($type) ? $type : 'application/octet-stream',
+ -'Content-Transfer-Encoding' => 'binary',
+ -attachment => ($extension) ? "shelf.$format.$extension" : "shelf.$format"
+ );
print $output;
} else {
--