Bugzilla – Attachment 69432 Details for
Bug 19708
Printing code improvements in opac-basket.tt
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19708 - Remove useless code from opac-basket
Bug-19708---Remove-useless-code-from-opac-basket.patch (text/plain), 9.56 KB, created by
Biblibre Sandboxes
on 2017-12-01 13:27:32 UTC
(
hide
)
Description:
Bug 19708 - Remove useless code from opac-basket
Filename:
MIME Type:
Creator:
Biblibre Sandboxes
Created:
2017-12-01 13:27:32 UTC
Size:
9.56 KB
patch
obsolete
>From 51772d4879b603e795ede739b42ec702ca7597ef Mon Sep 17 00:00:00 2001 >From: David Bourgault <david.bourgault@inlibro.com> >Date: Tue, 28 Nov 2017 11:23:01 -0500 >Subject: [PATCH] Bug 19708 - Remove useless code from opac-basket >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >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. > >Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> >Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> >--- > .../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' %] > <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Your cart</title> > [% INCLUDE 'doc-head-close.inc' %] >-[% BLOCK cssinclude %]<style type="text/css">.item-status { display: inline; }</style>[% END %] >+[% BLOCK cssinclude %]<style type="text/css">.item-status { display: inline; } @media print { body { height: 99%; } }</style>[% END %] > </head> > [% INCLUDE 'bodytag.inc' bodyid='basket' %] > <div class="main"> >@@ -14,8 +14,6 @@ > <div class="span12"> > <div id="userbasket"> > <h2>Your cart</h2> >- >- [% UNLESS ( print_basket ) %] > <div id="toolbar" class="toolbar"> > [% IF ( verbose ) %] > <a href="opac-basket.pl" class="brief">Brief display</a> >@@ -26,7 +24,7 @@ > <a class="send" href="opac-basket.pl">Send</a> > [% END %] > <a class="download" href="opac-basket.pl">Download</a> >- <a class="print-large" href="opac-basket.pl">Print</a> >+ <a class="print-large" href="#">Print</a> > <a class="empty" href="opac-basket.pl">Empty and close</a> > <a class="hide close" href="opac-basket.pl">Hide window</a> > </div> >@@ -59,22 +57,15 @@ > </span> > [% END %] > </div> >- [% END # / UNLESS print_basket %] > > [% IF ( verbose ) %] > <form action="opac-basket.pl" method="get" name="bookbag_form" id="bookbag_form" class="checkboxed"> > [% FOREACH BIBLIO_RESULT IN BIBLIO_RESULTS %] > <h3> >- [% 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 %] > <input type="checkbox" class="cb" value="[% BIBLIO_RESULT.biblionumber %]" name="bib[% BIBLIO_RESULT.biblionumber %]" id="bib[% BIBLIO_RESULT.biblionumber %]"> > [% 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 %] > </h3> > <!-- COinS / Openurl --> > <span class="Z3988" title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.au=[% BIBLIO_RESULT.author %]&rft.btitle=[% BIBLIO_RESULT.title |url %]&rft.date=[% BIBLIO_RESULT.publicationyear %]&rft.tpages=[% BIBLIO_RESULT.item('size') %]&rft.isbn=[% BIBLIO_RESULT.isbn |url %]&rft.aucorp=&rft.place=[% BIBLIO_RESULT.place %]&rft.pub=[% BIBLIO_RESULT.publisher |url %]&rft.edition=[% BIBLIO_RESULT.edition %]&rft.series=[% BIBLIO_RESULT.series %]&rft.genre="></span> >@@ -247,7 +238,7 @@ > <table id="itemst" class="table table-bordered table-striped"> > <thead> > <tr> >- [% UNLESS ( print_basket ) %]<th> </th>[% END %] >+ <th class="noprint"> </th> > <th>Title</th> > <th>Author</th> > <th>Year</th> >@@ -257,11 +248,9 @@ > <tbody> > [% FOREACH BIBLIO_RESULT IN BIBLIO_RESULTS %] > <tr> >- [% UNLESS ( print_basket ) %] >- <td> >+ <td class="noprint"> > <input type="checkbox" class="cb" value="[% BIBLIO_RESULT.biblionumber %]" name="bib[% BIBLIO_RESULT.biblionumber %]" id="bib[% BIBLIO_RESULT.biblionumber %]"> > </td> >- [% END %] > <td> > <a href="#" onclick="openBiblio('[% BIBLIO_RESULT.dest %]',[% BIBLIO_RESULT.biblionumber %])">[% BIBLIO_RESULT.title |html %][% IF ( BIBLIO_RESULT.subtitle ) %] [% FOREACH subtitl IN BIBLIO_RESULT.subtitle %][% subtitl.subfield |html %][% END %][% END %]</a> > <!-- COinS / Openurl --> >@@ -295,11 +284,9 @@ > </form> > [% END # / verbose %] > >- [% UNLESS ( print_basket ) %] > <form name="myform" action="opac-basket.pl" method="get"> > <input type="hidden" name="records" id="records" /> > </form> >- [% END %] > > </div> <!-- / #userbasket --> > </div> <!-- / .span10 --> >@@ -310,16 +297,6 @@ > [% INCLUDE 'opac-bottom.inc' %] > > [% BLOCK jsinclude %] >- [% IF ( print_basket ) %] >- <script type="text/javascript"> >- //<![CDATA[ >- $(document).ready(function(){ >- print(); >- location.href="/cgi-bin/koha/opac-basket.pl?bib_list=[% bib_list %][% IF ( verbose ) %]&verbose=1[% END %]"; >- }); >- //]]> >- </script> >- [% ELSE %] > <script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script> > [% INCLUDE 'datatables.inc' %] > <script type="text/javascript"> >@@ -390,11 +367,6 @@ > downloadBasket(); > }); > >- $(".print-large").click(function(e){ >- e.preventDefault(); >- printBasket(); >- }); >- > $(".empty").click(function(e){ > e.preventDefault(); > delBasket(); >@@ -487,5 +459,4 @@ > } > //]]> > </script> >- [% 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
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 19708
:
69417
|
69432
|
69433
|
72613
|
72640
|
73270