3 # This file is part of Koha.
5 # Koha is free software; you can redistribute it and/or modify it under the
6 # terms of the GNU General Public License as published by the Free Software
7 # Foundation; either version 2 of the License, or (at your option) any later
10 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License along with
15 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
16 # Suite 330, Boston, MA 02111-1307 USA
23 use C4::Serials; #uses getsubscriptionfrom biblionumber
27 use C4::XISBN qw(get_xisbns);
30 my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
32 template_name => "catalogue/detail.tmpl",
36 flagsrequired => { catalogue => 1 },
40 my $biblionumber = $query->param('biblionumber');
42 # change back when ive fixed request.pl
43 my @items = &GetItemsInfo( $biblionumber, 'intra' );
44 my $dat = &GetBiblioData($biblionumber);
47 print $query->redirect("/cgi-bin/koha/koha-tmpl/errors/404.pl");
50 #coping with subscriptions
51 my $subscriptionsnumber = CountSubscriptionFromBiblionumber($biblionumber);
52 my @subscriptions = GetSubscriptions( $dat->{title}, $dat->{issn}, $biblionumber );
55 foreach my $subscription (@subscriptions) {
57 $cell{subscriptionid} = $subscription->{subscriptionid};
58 $cell{subscriptionnotes} = $subscription->{notes};
60 #get the three latest serials.
61 $cell{latestserials} =
62 GetLatestSerials( $subscription->{subscriptionid}, 3 );
66 $dat->{'count'} = @items;
69 foreach my $itm (@items) {
71 unless ( ( $itm->{'notforloan'} > 0 )
72 || ( $itm->{'itemnotforloan'} > 0 ) );
73 $itm->{ $itm->{'publictype'} } = 1;
76 $template->param( norequests => $norequests );
78 ## get notes and subjects from MARC record
79 my $dbh = C4::Context->dbh;
80 my $marcflavour = C4::Context->preference("marcflavour");
81 my $record = GetMarcBiblio($biblionumber);
82 my $marcnotesarray = GetMarcNotes( $record, $marcflavour );
83 my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
84 my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
87 MARCNOTES => $marcnotesarray,
88 MARCSUBJCTS => $marcsubjctsarray,
89 MARCAUTHORS => $marcauthorsarray
92 my @results = ( $dat, );
93 foreach ( keys %{$dat} ) {
94 $template->param( "$_" => $dat->{$_} . "" );
98 ITEM_RESULTS => \@items,
99 biblionumber => $biblionumber,
100 subscriptions => \@subs,
101 subscriptionsnumber => $subscriptionsnumber,
102 subscriptiontitle => $dat->{title},
106 if (C4::Context->preference("FRBRizeEditions")==1) {
108 my $xisbn=$dat->{'isbn'};
109 $xisbn =~ s/(p|-|:| )//g;
112 XISBNS => get_xisbns($xisbn)
115 if ($@) { warn "XISBN Failed $@"; }
118 output_html_with_http_headers $query, $cookie, $template->output;