@@ -, +, @@
modal dialog
- View an existing list in the OPAC and click the "download list" link.
- A modal dialog should be displayed with the download form.
- Submitting the form without selecting a format should trigger either a
browser-based form validation error (in HTML5-supporting browsers) or
a JavaScript alert (if your browser doesn't support the "required"
attribute.
- Choosing a download format and submitting the form should close
the dialog and trigger the correct download.
- Clicking the "Cancel" link should close the dialog.
- Clicking the "download list" link should take you to a page which
contains the same form which appeared in the modal dialog.
- Submitting the form without selecting a format should trigger either a
browser-based form validation error (in HTML5-supporting browsers) or
a JavaScript alert (if your browser doesn't support the "required"
attribute..
- Choosing a download format and submitting the form should result in
the corect download.
- Clicking the "Cancel" link should return you to the correct list.
---
.../bootstrap/en/modules/opac-downloadshelf.tt | 102 +++++++++++++++++----
.../opac-tmpl/bootstrap/en/modules/opac-shelves.tt | 17 +++-
opac/opac-downloadshelf.pl | 20 +++-
3 files changed, 118 insertions(+), 21 deletions(-)
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadshelf.tt
+++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadshelf.tt
@@ -1,12 +1,44 @@
-[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Download list[% INCLUDE 'doc-head-close.inc' %]
-[% BLOCK cssinclude %][% END %]
-
-
-
-
-
-
-
+[% USE Koha %]
+[% IF ( fullpage ) %]
+ [% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Download list [% shelfname %][% INCLUDE 'doc-head-close.inc' %]
+ [% BLOCK cssinclude %][% END %]
+
+
+ [% INCLUDE 'masthead.inc' %]
+
+
+
+
+ [% IF ( OpacNav||loggedinusername ) %]
+
+
+ [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
+
+
+ [% END %]
+
+ [% IF ( OpacNav||loggedinusername ) %]
+
+ [% ELSE %]
+
+ [% END %]
+[% END # / IF fullpage %]
+
+
[% UNLESS ( invalidlist ) %]
[% IF ( format ) %]
@@ -14,10 +46,10 @@
Your download should begin automatically.
[% ELSE %]
-
Download list
+
Download list [% shelfname %]
-
+ [% IF ( modal ) %]
+
+ [% END %]
[% END # / IF format %]
[% ELSE %]
@@ -46,9 +94,25 @@
[% END # / invalidlist %]
-
-
-
-
-[% INCLUDE 'opac-bottom.inc' is_popup=1 %]
-[% BLOCK jsinclude %][% END %]
+
+[% IF ( fullpage ) %]
+
+
+
+
+ [% INCLUDE 'opac-bottom.inc' %]
+ [% BLOCK jsinclude %]
+
+ [% END %]
+[% END # / IF fullpage %]
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt
+++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt
@@ -156,7 +156,7 @@
+
+
+
+
+
Loading
+
+
+
+
+
@@ -905,6 +915,11 @@ $(function() {
});
[% END %]
+ // If JS is enabled add paramter to download link
+ var dialoglink = $(".download").attr("href");
+ dialoglink += "&context=modal";
+ $(".download").attr("href",dialoglink);
+
$("#CheckAll").click(function(){
$(".checkboxed").checkCheckboxes();
enableCheckboxActions();
--- a/opac/opac-downloadshelf.pl
+++ a/opac/opac-downloadshelf.pl
@@ -46,6 +46,8 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user (
my $shelfid = $query->param('shelfid');
my $format = $query->param('format');
+my $context = $query->param('context');
+my $showprivateshelves = $query->param('showprivateshelves');
my $dbh = C4::Context->dbh;
if ( ShelfPossibleAction( (defined($borrowernumber) ? $borrowernumber : -1), $shelfid, 'view' ) ) {
@@ -94,8 +96,24 @@ if ( ShelfPossibleAction( (defined($borrowernumber) ? $borrowernumber : -1), $sh
print $output;
} else {
+
+ # get details of the list
+ my ($shelfnumber,$shelfname,$owner,$category,$sorton) = GetShelf($shelfid);
+
+ # if modal context is passed set a variable so that page markup can be different
+ if($context eq "modal"){
+ $template->param(modal => 1);
+ } else {
+ $template->param(fullpage => 1);
+ }
$template->param(csv_profiles => GetCsvProfilesLoop('marc'));
- $template->param(shelfid => $shelfid);
+ $template->param(
+ showprivateshelves => $showprivateshelves,
+ shelfid => $shelfid,
+ shelfname => $shelfname,
+ shelfnumber => $shelfnumber,
+ viewshelf => $shelfnumber
+ );
output_html_with_http_headers $query, $cookie, $template->output;
}
--