Bugzilla – Attachment 39916 Details for
Bug 13986
Printing a list only prints the results of the page you are viewing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[v3.18.x] Bug 13986 - Printing a list only prints the results of the page you are viewing
v318x-Bug-13986---Printing-a-list-only-prints-the-.patch (text/plain), 10.59 KB, created by
Kyle M Hall
on 2015-06-05 18:02:53 UTC
(
hide
)
Description:
[v3.18.x] Bug 13986 - Printing a list only prints the results of the page you are viewing
Filename:
MIME Type:
Creator:
Kyle M Hall
Created:
2015-06-05 18:02:53 UTC
Size:
10.59 KB
patch
obsolete
>From 3600c7a04e5afdf21d0a7d805954a41e12cf2d9e Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 13 Apr 2015 11:23:20 -0400 >Subject: [PATCH] [v3.18.x] Bug 13986 - Printing a list only prints the results of the page you are viewing > >The print list button only prints the page you are viewing, and not the >entire list. > >Test Plan: >1) Apply this patch >2) Create a list with enough items that it will paginate >3) Browse to that list, click the 'print list' button >4) Note the entire list prints, not just the visible items > >Tested in staff client, works as expected. >It would be great to have the same for OPAC as well (OPAC still prints first page only). >Signed-off-by: Marc Veron <veron@veron.ch> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> > >Bug 13986 - Implement fix for OPAC > >Tested wit OPAC, full list is printed. >Signed-off-by: Marc Veron <veron@veron.ch> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > C4/VirtualShelves/Page.pm | 16 ++++++++++------ > koha-tmpl/intranet-tmpl/prog/en/css/print.css | 2 +- > .../prog/en/includes/virtualshelves-toolbar.inc | 6 +----- > .../prog/en/modules/virtualshelves/shelves.tt | 14 ++++++++++++-- > .../opac-tmpl/bootstrap/en/modules/opac-shelves.tt | 13 +++++++++---- > opac/opac-shelves.pl | 6 +++++- > virtualshelves/shelves.pl | 1 + > 7 files changed, 39 insertions(+), 19 deletions(-) > >diff --git a/C4/VirtualShelves/Page.pm b/C4/VirtualShelves/Page.pm >index baf790f..d91e96d 100644 >--- a/C4/VirtualShelves/Page.pm >+++ b/C4/VirtualShelves/Page.pm >@@ -83,12 +83,15 @@ sub shelfpage { > @cart_list = split(/\//, $cart_list); > } > >- $shelflimit = ( $type eq 'opac' ? C4::Context->preference('OPACnumSearchResults') : C4::Context->preference('numSearchResults') ); >- $shelflimit = $shelflimit || ShelvesMax('MGRPAGE'); >- $shelfoffset = ( $itemoff - 1 ) * $shelflimit; # Sets the offset to begin retrieving items at >- $shelveslimit = $shelflimit; # Limits number of shelves returned for a given query (row_count) >- $shelvesoffset = ( $shelfoff - 1 ) * $shelflimit; # Sets the offset to begin retrieving shelves at (offset) >- # getting the Shelves list >+ # getting the Shelves list >+ unless ( $query->param('print') ) { >+ $shelflimit = ( $type eq 'opac' ? C4::Context->preference('OPACnumSearchResults') : C4::Context->preference('numSearchResults') ); >+ $shelflimit = $shelflimit || ShelvesMax('MGRPAGE'); >+ $shelfoffset = ( $itemoff - 1 ) * $shelflimit; # Sets the offset to begin retrieving items at >+ $shelveslimit = $shelflimit; # Limits number of shelves returned for a given query (row_count) >+ $shelvesoffset = ( $shelfoff - 1 ) * $shelflimit; # Sets the offset to begin retrieving shelves at (offset) >+ } >+ > my $category = ( ( $displaymode eq 'privateshelves' ) ? 1 : 2 ); > my ( $shelflist, $totshelves ) = GetShelves( $category, $shelveslimit, $shelvesoffset, $loggedinuser ); > >@@ -464,6 +467,7 @@ sub shelfpage { > $template->param( > pagination_bar => pagination_bar( $url, ( int( $totshelves / $shelveslimit ) ) + ( ( $totshelves % $shelveslimit ) > 0 ? 1 : 0 ), $shelfoff, "shelfoff" ) ); > } >+ > $template->param( > shelveslooppriv => \@shelveslooppriv, > shelvesloop => \@shelvesloop, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/print.css b/koha-tmpl/intranet-tmpl/prog/en/css/print.css >index 239059c..e0e346e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/css/print.css >+++ b/koha-tmpl/intranet-tmpl/prog/en/css/print.css >@@ -322,4 +322,4 @@ fieldset { > } > #cataloguing_additem_itemlist { > overflow : visible !important; >-} >\ No newline at end of file >+} >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc >index 4de9e19..1e00cc4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc >@@ -12,10 +12,6 @@ > sendList(); > return false; > }); >- $("#printlist").click(function(){ >- print(); >- return false; >- }); > $("#deleteshelf").click(function(e){ > if(confirmDelete(_("Are you sure you want to delete this list?"))){ > return true; >@@ -60,6 +56,6 @@ > </ul> > </div> > <div class="btn-group"><a class="btn btn-small" href="#" id="sendlist"><i class="icon-envelope"></i> Send list</a></div> >- <div class="btn-group"><a class="btn btn-small" id="printlist" href="#"><i class="icon-print"></i> Print list</a></div> >+ <div class="btn-group"><a class="btn btn-small" id="printlist" target="_blank" href="/cgi-bin/koha/virtualshelves/shelves.pl?viewshelf=[% shelfnumber %]&print=1"><i class="icon-print"></i> Print list</a></div> > [% END %] > </div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >index 97e47a7..44df96a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >@@ -1,6 +1,16 @@ > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › [% IF ( viewshelf ) %]Lists › Contents of [% shelfname | html %][% ELSE %]Lists[% END %][% IF ( shelves ) %] › Create new list[% END %][% IF ( edit ) %] › Edit list [% shelfname | html %][% END %]</title> > [% INCLUDE 'doc-head-close.inc' %] >+ >+[% IF print %] >+<script type="text/javascript"> >+ $( document ).ready(function() { >+ window.print(); >+ setTimeout('window.close()', 1); >+ }); >+</script> >+[% END %] >+ > [% IF ( viewshelf ) %] > <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script> > <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat.js"></script> >@@ -282,7 +292,7 @@ function placeHold () { > [% SET new_direction = 'asc' %] > [% END %] > >-<div id="searchheader"> >+<div id="searchheader" class="noprint"> > [% IF ( itemsloop ) %] > <div id="selection_ops"><span class="checkall"></span> | > <span class="clearall"></span> >@@ -402,7 +412,7 @@ function placeHold () { > [% IF ( allowaddingitem ) %] > <div class="yui-g"> > <form action="/cgi-bin/koha/virtualshelves/shelves.pl" method="post"> >- <fieldset class="brief"> >+ <fieldset class="brief noprint"> > <legend>Add an item to <i>[% shelfname | html %]</i></legend> > <ol> > <li> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >index a7f982b..f3c0099 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >@@ -43,7 +43,7 @@ > > [% INCLUDE 'masthead.inc' %] > <div class="main"> >- <ul class="breadcrumb"> >+ <ul class="breadcrumb noprint"> > <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">›</span></li> > [% IF ( loggedinusername ) %] > <li><a href="/cgi-bin/koha/opac-user.pl">[% FOREACH USER_INF IN USER_INFO %][% USER_INF.title %] [% USER_INF.firstname %] [% USER_INF.surname %][% END %]</a> <span class="divider">›</span></li> >@@ -91,7 +91,7 @@ > > <div class="container-fluid"> > <div class="row-fluid"> >- [% IF ( OpacNav||loggedinusername ) %] >+ [% IF ( OpacNav||loggedinusername ) && !print %] > <div class="span2"> > <div id="navigation"> > [% INCLUDE 'navigation.inc' IsPatronPage=1 %] >@@ -162,7 +162,7 @@ > <span class="sendlist"><a href="/cgi-bin/koha/opac-sendshelf.pl?shelfid=[% shelfnumber | html %]" class="send" onclick="open('/cgi-bin/koha/opac-sendshelf.pl?shelfid=[% shelfnumber | html %]','win_form','scrollbars=no,resizable=no,height=300,width=450,top=50,left=100'); return false; ">Send list</a></span> > [% END %] > >- <a class="print-small" href="/cgi-bin/koha/opac-shelves.pl" onclick="print(); return false;">Print list</a> >+ <a class="print-small" target="_blank" href="/cgi-bin/koha/opac-shelves.pl?viewshelf=[% shelfnumber %]&sort=[% sort %]&direction=[% direction %]&print=1">Print list</a> > > [% IF ( manageshelf ) %] > <span class="sep">|</span> >@@ -242,7 +242,7 @@ > > </div> <!-- / #toolbar --> > >- <div id="selections-toolbar" class="toolbar"> >+ <div id="selections-toolbar" class="toolbar noprint"> > <span class="checkall"></span> <span class="clearall"></span> <span class="sep">|</span> > <span class="links"> > <span id="selections">Select titles to: </span> >@@ -1017,6 +1017,11 @@ $(function() { > [% IF OPACLocalCoverImages %]KOHA.LocalCover.GetCoverFromBibnumber(false);[% END %] > [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %] > $('#sort-submit').hide(); >+ >+ [% IF print %] >+ window.print(); >+ setTimeout('window.close()', 1); >+ [% END %] > }); // document.ready > > function Check(f) { >diff --git a/opac/opac-shelves.pl b/opac/opac-shelves.pl >index 0f1e5c5..62bace1 100755 >--- a/opac/opac-shelves.pl >+++ b/opac/opac-shelves.pl >@@ -31,6 +31,10 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user({ > type => "opac", > authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ), > }); >-$template->param(listsview => 1); >+ >+$template->param( >+ listsview => 1, >+ print => $query->param('print') >+); > > shelfpage('opac', $query, $template, $loggedinuser, $cookie); >diff --git a/virtualshelves/shelves.pl b/virtualshelves/shelves.pl >index 52789ea..11f828c 100755 >--- a/virtualshelves/shelves.pl >+++ b/virtualshelves/shelves.pl >@@ -35,4 +35,5 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > flagsrequired => { catalogue => 1 }, > } > ); >+$template->param( print => $query->param('print') ); > shelfpage('intranet', $query, $template, $loggedinuser, $cookie); >-- >1.7.2.5
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 13986
:
37761
|
37773
|
38192
|
38291
|
38305
|
38496
|
38497
|
38725
|
38726
|
38780
|
38781
| 39916