2 # NOTE: Use standard 8-space tabs for this file (indents are 4 spaces)
4 # Copyright 2000-2002 Katipo Communications
6 # This file is part of Koha.
8 # Koha is free software; you can redistribute it and/or modify it under the
9 # terms of the GNU General Public License as published by the Free Software
10 # Foundation; either version 2 of the License, or (at your option) any later
13 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
14 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License along with
18 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
19 # Suite 330, Boston, MA 02111-1307 USA
24 use C4::Serials; #uses getsubscriptionfrom biblionumber
25 use C4::Interface::CGI::Output;
30 my $dbh=C4::Context->dbh;
32 my ($template, $borrowernumber, $cookie)
33 = get_template_and_user({template_name => "catalogue/detailprint.tmpl",
37 flagsrequired => {borrow => 1},
40 my $biblionumber=$query->param('biblionumber');
41 $template->param(biblionumber => $biblionumber);
42 my $retrieve_from=C4::Context->preference('retrieve_from');
43 my ($record,$frameworkcode);
46 if ($retrieve_from eq "zebra"){
47 ($record,@itemrecords)=ZEBRAgetrecord($biblionumber);
49 $record =XMLgetbiblio($dbh,$biblionumber);
50 $record=XML_xml2hash_onerecord($record);
51 my @itemxmls=XMLgetallitems($dbh,$biblionumber);
52 foreach my $itemrecord(@itemxmls){
53 my $itemhash=XML_xml2hash_onerecord($itemrecord);
54 push @itemrecords, $itemhash;
58 my $dat = XMLmarc2koha_onerecord($dbh,$record,"biblios");
60 foreach my $itemrecord (@itemrecords){
62 my $item= XMLmarc2koha_onerecord($dbh,$itemrecord,"holdings");
63 $item=ItemInfo($dbh,$item);
64 $item->{itemtype}=$dat->{itemtype};
65 $norequests = 0 unless $item->{'notforloan'};
66 $item->{$item->{'publictype'}} = 1; ## NOT sure what this is kept from old db probably useless now
70 my $subscriptionsnumber = GetSubscriptionsFromBiblionumber($biblionumber);
72 $dat->{'count'}=@items;
73 $template->param(count =>$dat->{'count'});
74 $template->param(norequests => $norequests);
76 ## get notes subjects and URLS from MARC record
78 my $marcflavour = C4::Context->preference("marcflavour");
79 my $marcnotesarray = &getMARCnotes($dbh,$record,$marcflavour);
80 my $marcsubjctsarray = &getMARCsubjects($dbh,$record,$marcflavour);
81 my $marcurlssarray = &getMARCurls($dbh,$record,$marcflavour);
82 $template->param(MARCURLS => $marcurlssarray);
83 $template->param(MARCNOTES => $marcnotesarray);
84 $template->param(MARCSUBJCTS => $marcsubjctsarray);
87 my @results = ($dat,);
89 my $resultsarray=\@results;
90 my $itemsarray=\@items;
93 $template->param(BIBLIO_RESULTS => $resultsarray,
94 ITEM_RESULTS => $itemsarray,
95 subscriptionsnumber => $subscriptionsnumber,
98 output_html_with_http_headers $query, $cookie, $template->output;