From 04207c2e29d641b76d771d5e534481727a4627b4 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 6 May 2020 20:30:32 +0000 Subject: [PATCH] Bug 25402: Put OPAC cart download options into dropdown menu This patch modifies the process of downloading a cart so that it doesn't involve a separate popup window. To test, apply the patch and add some titles to the cart in the OPAC. - Open the cart - The "Download" button should now be a dropdown menu. - Selecting any of the download options should trigger a download prompt. - Test with and without some CSV profiles which have been configured for use in the OPAC Signed-off-by: Lucas Gass Signed-off-by: Katrin Fischer --- .../opac-tmpl/bootstrap/en/modules/opac-basket.tt | 27 +++++++++++++++++++--- opac/opac-basket.pl | 3 ++- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt index a89bf8b001..2a94ae9628 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt @@ -27,7 +27,22 @@ [% IF Koha.Preference( 'opacuserlogin' ) == 1 %] Send [% END %] - Download + + + Empty and close Hide window [% IF ( verbose ) %] @@ -295,6 +310,10 @@
+
+ + +
@@ -369,9 +388,11 @@ sendBasket(); }); - $(".download").click(function(e){ + $(".download-cart").on("click", function(e){ e.preventDefault(); - downloadBasket(); + var format = $(this).data("format"); + $("#download_format").val( format ); + $("#download_cart").submit(); }); $(".empty").click(function(e){ diff --git a/opac/opac-basket.pl b/opac/opac-basket.pl index 6a454bedf0..4a8d9f4d98 100755 --- a/opac/opac-basket.pl +++ b/opac/opac-basket.pl @@ -26,7 +26,7 @@ use C4::Circulation; use C4::Auth; use C4::Output; use Koha::RecordProcessor; - +use Koha::CsvProfiles; use Koha::AuthorisedValues; my $query = new CGI; @@ -167,6 +167,7 @@ my $resultsarray = \@results; # my $itemsarray=\@items; $template->param( + csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc', used_for => 'export_records', opac_option => 1 }) ], bib_list => $bib_list, BIBLIO_RESULTS => $resultsarray, ); -- 2.11.0