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
24 use C4::Serials; #uses getsubscriptionfrom biblionumber
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);
45 #coping with subscriptions
46 my $subscriptionsnumber = CountSubscriptionFromBiblionumber($biblionumber);
47 my @subscriptions = GetSubscriptions( $dat->{title}, $dat->{issn}, $biblionumber );
50 foreach my $subscription (@subscriptions) {
52 $cell{subscriptionid} = $subscription->{subscriptionid};
53 $cell{subscriptionnotes} = $subscription->{notes};
55 #get the three latest serials.
56 $cell{latestserials} =
57 GetLatestSerials( $subscription->{subscriptionid}, 3 );
61 $dat->{'count'} = @items;
64 foreach my $itm (@items) {
66 unless ( ( $itm->{'notforloan'} > 0 )
67 || ( $itm->{'itemnotforloan'} > 0 ) );
68 $itm->{ $itm->{'publictype'} } = 1;
71 $template->param( norequests => $norequests );
73 ## get notes and subjects from MARC record
74 my $dbh = C4::Context->dbh;
75 my $marcflavour = C4::Context->preference("marcflavour");
76 my $record = GetMarcBiblio($biblionumber);
77 my $marcnotesarray = GetMarcNotes( $record, $marcflavour );
78 my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
79 my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
82 MARCNOTES => $marcnotesarray,
83 MARCSUBJCTS => $marcsubjctsarray,
84 MARCAUTHORS => $marcauthorsarray
87 my @results = ( $dat, );
88 foreach ( keys %{$dat} ) {
89 $template->param( "$_" => $dat->{$_} . "" );
93 ITEM_RESULTS => \@items,
94 biblionumber => $biblionumber,
95 subscriptions => \@subs,
96 subscriptionsnumber => $subscriptionsnumber,
97 subscriptiontitle => $dat->{title},
100 output_html_with_http_headers $query, $cookie, $template->output;