Bugzilla – Attachment 104717 Details for
Bug 25402
Put OPAC cart download options into dropdown menu
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25402: Put OPAC cart download options into dropdown menu
Bug-25402-Put-OPAC-cart-download-options-into-drop.patch (text/plain), 5.12 KB, created by
Owen Leonard
on 2020-05-11 20:58:50 UTC
(
hide
)
Description:
Bug 25402: Put OPAC cart download options into dropdown menu
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2020-05-11 20:58:50 UTC
Size:
5.12 KB
patch
obsolete
>From c20175deeadcf08ed50b06e396621d3647057162 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >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 >--- > .../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 %] > <a class="btn btn-link send" href="opac-basket.pl"><i class="fa fa-fw fa-envelope" aria-hidden="true"></i> Send</a> > [% END %] >- <a class="btn btn-link download" href="opac-basket.pl"><i class="fa fa-fw fa-download" aria-hidden="true"></i> Download</a> >+ >+ <div id="download-cart" class="btn-group dropdown"> >+ <a id="format" class="btn btn-link dropdown-toggle" data-toggle="dropdown" href="#"><i class="fa fa-fw fa-download" aria-hidden="true"></i> Download <b class="caret"></b></a> >+ <ul class="dropdown-menu pull-left" role="menu" aria-labelledby="format"> >+ <li><a role="menuitem" class="download-cart" data-format="bibtex" href="#">BibTeX</a></li> >+ <li><a role="menuitem" class="download-cart" data-format="isbd" href="#">ISBD</a></li> >+ <li><a role="menuitem" class="download-cart" data-format="iso2709" href="#">MARC</a></li> >+ <li><a role="menuitem" class="download-cart" data-format="ris" href="#">RIS (Zotero, EndNote, others)</a></li> >+ [% FOREACH csv_profile IN csv_profiles %] >+ <li> >+ <a role="menuitem" class="download-cart" data-format="[% csv_profile.export_format_id | html %]" href="#">CSV - [% csv_profile.profile | html %]</a> >+ </li> >+ [% END %] >+ </ul> >+ </div> >+ > <a class="btn btn-link remove empty" href="opac-basket.pl"><i class="fa fa-fw fa-trash" aria-hidden="true"></i> Empty and close</a> > <a class="btn btn-link close" href="opac-basket.pl"><i class="fa fa-fw fa-times-circle" aria-hidden="true"></i> Hide window</a> > [% IF ( verbose ) %] >@@ -295,6 +310,10 @@ > <form name="myform" action="opac-basket.pl" method="get"> > <input type="hidden" name="records" id="records" /> > </form> >+ <form method="post" id="download_cart" action="/cgi-bin/koha/opac-downloadcart.pl"> >+ <input type="hidden" name="format" id="download_format" value="" /> >+ <input type="hidden" name="bib_list" value="[% bib_list | html %]" /> >+ </form> > > </div> <!-- / #userbasket --> > </div> <!-- / .span10 --> >@@ -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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 25402
:
104717
|
105046
|
106001
|
106113
|
106114