From ba7ebb56ff69b4f6196343a3077c0811acffad7c Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 25 Oct 2012 11:43:18 -0400 Subject: [PATCH] Bug 8893 - show more information on printout Content-Type: text/plain; charset="utf-8" My proposed solution eliminates the special print view page altogether and has the Print button trigger the browser's print function. I've tweaked the print stylesheet to improve the output. Normally I don't think print buttons in the interface are necessary, since a user could be expected to be able to print the page using browser controls. But I think it's best not to remove the button when people are used to seeing it. The behavior people will find now is different when clicking the button from different catalogue pages. A user on the MARC detail page, instead of getting the generic print view will get a print of the page they're on. Overall I think this is more in line with what a user would expect. --- catalogue/detailprint.pl | 96 -------------------- koha-tmpl/intranet-tmpl/prog/en/css/print.css | 25 +++-- .../intranet-tmpl/prog/en/includes/cat-toolbar.inc | 3 +- .../prog/en/modules/catalogue/detailprint.tt | 54 ----------- 4 files changed, 16 insertions(+), 162 deletions(-) delete mode 100755 catalogue/detailprint.pl delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detailprint.tt diff --git a/catalogue/detailprint.pl b/catalogue/detailprint.pl deleted file mode 100755 index fe92fe5..0000000 --- a/catalogue/detailprint.pl +++ /dev/null @@ -1,96 +0,0 @@ -#!/usr/bin/perl - -# Copyright 2000-2002 Katipo Communications -# -# This file is part of Koha. -# -# Koha is free software; you can redistribute it and/or modify it under the -# terms of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at your option) any later -# version. -# -# Koha is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR -# A PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with Koha; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -use strict; -#use warnings; FIXME - Bug 2505 - -use C4::Context; -use CGI; -use C4::Auth; -use C4::Biblio; -use C4::Items; -use C4::Output; -use C4::Dates; - -my $query = new CGI; -my $type = $query->param('type'); -($type) || ( $type = 'intra' ); - -my $biblionumber = $query->param('biblionumber'); - -# change back when ive fixed request.pl -my @items = GetItemsInfo( $biblionumber ); -my $norequests = 1; -foreach my $itm (@items) { - $norequests = 0 unless $itm->{'notforloan'}; -} - -my $dat = GetBiblioData($biblionumber); -my $record = GetMarcBiblio($biblionumber); -my $addauthor = GetMarcAuthors($record,C4::Context->preference("marcflavour")); -my $authorcount = scalar @$addauthor; - -$dat->{'additional'} = ""; -foreach (@$addauthor) { - $dat->{'additional'} .= "|" . $_->{'a'}; -} # for - -$dat->{'count'} = @items; -$dat->{'norequests'} = $norequests; - -my @results; - -$results[0] = $dat; - -my $resultsarray = \@results; -my $itemsarray = \@items; - -my $startfrom = $query->param('startfrom'); -($startfrom) || ( $startfrom = 0 ); - -my ( $template, $loggedinuser, $cookie ) = get_template_and_user( - { - template_name => ('catalogue/detailprint.tmpl'), - query => $query, - type => "intranet", - authnotrequired => ( $type eq 'opac' ), - flagsrequired => { catalogue => 1 }, - } -); - -my $count = 1; - -# now to get the items into a hash we can use and whack that thru - -my $nextstartfrom = ( $startfrom + 20 < $count - 20 ) ? ( $startfrom + 20 ) : ( $count - 20 ); -my $prevstartfrom = ( $startfrom - 20 > 0 ) ? ( $startfrom - 20 ) : (0); - -$template->param( - startfrom => $startfrom + 1, - endat => $startfrom + 20, - numrecords => $count, - nextstartfrom => $nextstartfrom, - prevstartfrom => $prevstartfrom, - BIBLIO_RESULTS => $resultsarray, - ITEM_RESULTS => $itemsarray, - loggedinuser => $loggedinuser, - biblionumber => $biblionumber, -); - -output_html_with_http_headers $query, $cookie, $template->output; diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/print.css b/koha-tmpl/intranet-tmpl/prog/en/css/print.css index 955b68b..239059c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/css/print.css +++ b/koha-tmpl/intranet-tmpl/prog/en/css/print.css @@ -286,25 +286,30 @@ td.debit { text-align : left; } -div#breadcrumbs, -div#toplevelnav, -div#login, -div#header_search, -div#toolbar, -div#changelanguage, -div#menu, +#breadcrumbs, +#toplevelnav, +#login, +#header, +#header_search, +#toolbar, +#changelanguage, +#menu, +.gradient, div.yui-b, .noprint, form#sortbyform, #cartDetails, fieldset.action, .list-actions, -.print { +.print, +.ui-tabs-nav { display: none; } -div#yui-main div.yui-b { - display : block; +div#yui-main div.yui-b, +.ui-tabs .ui-tabs-panel, +.ui-tabs .ui-tabs-hide { + display : block !important; } .yui-t1 #yui-main div.yui-b, diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc index 740a3b5..413527a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc @@ -23,8 +23,7 @@ function addToCart() { addRecord('[% biblionumber %]'); } function addToShelf() { window.open('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?biblionumber=[% biblionumber %]','Add_to_virtualshelf','width=500,height=400,toolbar=false,scrollbars=yes'); } - function printBiblio() {window.open('/cgi-bin/koha/catalogue/detailprint.pl?biblionumber=[% biblionumber %]','Print_Biblio','width=700,height=500,toolbar=false,scrollbars=yes'); - } + function printBiblio() {window.print(); } [% IF ( CAN_user_editcatalogue_edit_catalogue ) %] function confirm_deletion() { var count = [% count %]; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detailprint.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detailprint.tt deleted file mode 100644 index 3f4312a..0000000 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detailprint.tt +++ /dev/null @@ -1,54 +0,0 @@ -[% INCLUDE 'doc-head-open.inc' %] -Koha › Catalog › Details for [% title |html %] -[% INCLUDE 'doc-head-close.inc' %] - - - - - - -
-[% FOREACH BIBLIO_RESULT IN BIBLIO_RESULTS %] - - - -[% IF ( BIBLIO_RESULT.author ) %][% END %] -[% IF ( BIBLIO_RESULT.additional ) %][% END %] -[% IF ( BIBLIO_RESULT.publishercode ) %][% END %] - - [% IF ( BIBLIO_RESULT.collection ) %][% END %] - [% IF ( BIBLIO_RESULT.subject ) %][% END %] - [% IF ( BIBLIO_RESULT.copyrightdate ) %][% END %] - [% IF ( BIBLIO_RESULT.notes ) %][% END %] - [% IF ( BIBLIO_RESULT.unititle ) %][% END %] - [% IF ( BIBLIO_RESULT.dewey ) %][% END %] - [% IF ( BIBLIO_RESULT.classification ) %][% END %] - [% IF ( BIBLIO_RESULT.lccn ) %][% END %] - [% IF ( BIBLIO_RESULT.url ) %][% END %] - [% IF ( BIBLIO_RESULT.ISBN ) %][% END %] -
[% BIBLIO_RESULT.title |html %] [% BIBLIO_RESULT.subtitle %]
Biblio record number: [% BIBLIO_RESULT.biblionumber %]
Author: [% BIBLIO_RESULT.author %]
Additional author: [% BIBLIO_RESULT.additional %]
Publisher: [% BIBLIO_RESULT.publishercode %]
Publication details: [% IF ( BIBLIO_RESULT.publicationyear ) %][% BIBLIO_RESULT.publicationyear %][% END %] - [% IF ( BIBLIO_RESULT.pages ) %], [% END %][% BIBLIO_RESULT.pages %] - [% IF ( BIBLIO_RESULT.size ) %], [% END %][% BIBLIO_RESULT.size %]
Collection: [% BIBLIO_RESULT.seriestitle %]
Subject: [% BIBLIO_RESULT.subject %]
Copyright date: [% BIBLIO_RESULT.copyrightdate %]
Notes: [% BIBLIO_RESULT.notes %]
Unititle: [% BIBLIO_RESULT.unititle %]
Dewey: [% BIBLIO_RESULT.dewey %]
Classification: [% BIBLIO_RESULT.classification %]
LCCN: [% BIBLIO_RESULT.lccn %]
URL: [% BIBLIO_RESULT.url %]
ISBN: [% BIBLIO_RESULT.ISBN %]
-[% END %] - - - - [% FOREACH ITEM_RESULT IN ITEM_RESULTS %] - - - - - - - - - [% END %] -
Item typeCall numberLocationDate dueLast seenBarcode
[% ITEM_RESULT.description %][% ITEM_RESULT.itemcallnumber %][% ITEM_RESULT.branchname %][% IF ( ITEM_RESULT.bulk ) %], [% ITEM_RESULT.bulk %][% ELSE %] [% END %][% ITEM_RESULT.datedue %][% ITEM_RESULT.datelastseen %][% ITEM_RESULT.barcode %]
- -[% INCLUDE 'intranet-bottom.inc' %] -- 1.7.9.5