From 7b3e4ddc63278c2f9ce615a8cb91ecf8c561f63e Mon Sep 17 00:00:00 2001 From: David Bourgault Date: Tue, 28 Nov 2017 11:23:01 -0500 Subject: [PATCH] Bug 19708 - Remove useless code from opac-basket This removes a lot of useless code relating to the print function from opac-basket.tt, opac-basket.pl and opac/basket.js. It also fixes the CSS so that no extra blank page is printed. To test: 0) Add an item to your cart 1) Print your basket Note the appearance of the page. There will be an extra blank page. 2) Apply patch 3) Reload basket 4) Print your basket The appearce should be identical. The extra blank page is gone. This only affects the OPAC. --- .../opac-tmpl/bootstrap/en/modules/opac-basket.tt | 37 +++------------------- koha-tmpl/opac-tmpl/bootstrap/js/basket.js | 5 --- opac/opac-basket.pl | 2 -- 3 files changed, 4 insertions(+), 40 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 760d6dc..6eca240 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt @@ -5,7 +5,7 @@ [% INCLUDE 'doc-head-open.inc' %] [% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Your cart [% INCLUDE 'doc-head-close.inc' %] -[% BLOCK cssinclude %][% END %] +[% BLOCK cssinclude %][% END %] [% INCLUDE 'bodytag.inc' bodyid='basket' %]
@@ -14,8 +14,6 @@

Your cart

- - [% UNLESS ( print_basket ) %]
[% IF ( verbose ) %] Brief display @@ -26,7 +24,7 @@ Send [% END %] Download - Print + Print Empty and close Hide window
@@ -59,22 +57,15 @@ [% END %]
- [% END # / UNLESS print_basket %] [% IF ( verbose ) %]
[% FOREACH BIBLIO_RESULT IN BIBLIO_RESULTS %]

- [% IF ( print_basket ) %] - [% BIBLIO_RESULT.title |html %] - [% IF ( BIBLIO_RESULT.subtitle ) %] [% FOREACH subtitl IN BIBLIO_RESULT.subtitle %] [% subtitl.subfield |html %] [% END %][% END %] - [% IF ( BIBLIO_RESULT.author ) %] [% BIBLIO_RESULT.author |html %][% END %] - [% ELSE %] [% BIBLIO_RESULT.title |html %] [% IF ( BIBLIO_RESULT.subtitle ) %] [% FOREACH subtitl IN BIBLIO_RESULT.subtitle %] [% subtitl.subfield |html %] [% END %][% END %] [% IF ( BIBLIO_RESULT.author ) %] [% BIBLIO_RESULT.author |html %][% END %] - [% END # / IF print_basket %]

@@ -247,7 +238,7 @@ - [% UNLESS ( print_basket ) %][% END %] + @@ -257,11 +248,9 @@ [% FOREACH BIBLIO_RESULT IN BIBLIO_RESULTS %] - [% UNLESS ( print_basket ) %] - - [% END %]
   Title Author Year
+ [% BIBLIO_RESULT.title |html %][% IF ( BIBLIO_RESULT.subtitle ) %] [% FOREACH subtitl IN BIBLIO_RESULT.subtitle %][% subtitl.subfield |html %][% END %][% END %] @@ -295,11 +284,9 @@ [% END # / verbose %] - [% UNLESS ( print_basket ) %]
- [% END %] @@ -310,16 +297,6 @@ [% INCLUDE 'opac-bottom.inc' %] [% BLOCK jsinclude %] - [% IF ( print_basket ) %] - - [% ELSE %] [% INCLUDE 'datatables.inc' %] - [% END # / IF print_basket %] [% END # / BLOCK jsinclude %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/basket.js b/koha-tmpl/opac-tmpl/bootstrap/js/basket.js index a422753..4d28f6c 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/js/basket.js +++ b/koha-tmpl/opac-tmpl/bootstrap/js/basket.js @@ -366,11 +366,6 @@ function downloadBasket() { open(loc,"win_form",'scrollbars=no,resizable=no,height=300,width=450,top=50,left=100'); } -function printBasket() { - var loc = document.location + "&print=1"; - document.location = loc; -} - function showMore() { var strCookie = ""; diff --git a/opac/opac-basket.pl b/opac/opac-basket.pl index f842587..87eea86 100755 --- a/opac/opac-basket.pl +++ b/opac/opac-basket.pl @@ -40,11 +40,9 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user ( ); my $bib_list = $query->param('bib_list'); -my $print_basket = $query->param('print'); my $verbose = $query->param('verbose'); if ($verbose) { $template->param( verbose => 1 ); } -if ($print_basket) { $template->param( print_basket => 1 ); } my @bibs = split( /\//, $bib_list ); my @results; -- 2.7.4