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
29 my ( $template, $borrowernumber, $cookie ) = get_template_and_user
(
31 template_name
=> "catalogue/detail.tmpl",
35 flagsrequired
=> { catalogue
=> 1 },
39 my $biblionumber = $query->param('biblionumber');
41 # change back when ive fixed request.pl
42 my @items = &GetItemsInfo
( $biblionumber, 'intra' );
43 my $dat = &GetBiblioData
($biblionumber);
46 print $query->redirect("/cgi-bin/koha/koha-tmpl/errors/404.pl");
49 #coping with subscriptions
50 my $subscriptionsnumber = CountSubscriptionFromBiblionumber
($biblionumber);
51 my @subscriptions = GetSubscriptions
( $dat->{title
}, $dat->{issn
}, $biblionumber );
54 foreach my $subscription (@subscriptions) {
56 $cell{subscriptionid
} = $subscription->{subscriptionid
};
57 $cell{subscriptionnotes
} = $subscription->{notes
};
59 #get the three latest serials.
60 $cell{latestserials
} =
61 GetLatestSerials
( $subscription->{subscriptionid
}, 3 );
65 $dat->{'count'} = @items;
68 foreach my $itm (@items) {
70 unless ( ( $itm->{'notforloan'} > 0 )
71 || ( $itm->{'itemnotforloan'} > 0 ) );
72 $itm->{ $itm->{'publictype'} } = 1;
75 $template->param( norequests
=> $norequests );
77 ## get notes and subjects from MARC record
78 my $dbh = C4
::Context
->dbh;
79 my $marcflavour = C4
::Context
->preference("marcflavour");
80 my $record = GetMarcBiblio
($biblionumber);
81 my $marcnotesarray = GetMarcNotes
( $record, $marcflavour );
82 my $marcauthorsarray = GetMarcAuthors
( $record, $marcflavour );
83 my $marcsubjctsarray = GetMarcSubjects
( $record, $marcflavour );
86 MARCNOTES
=> $marcnotesarray,
87 MARCSUBJCTS
=> $marcsubjctsarray,
88 MARCAUTHORS
=> $marcauthorsarray
91 my @results = ( $dat, );
92 foreach ( keys %{$dat} ) {
93 $template->param( "$_" => $dat->{$_} . "" );
97 ITEM_RESULTS
=> \
@items,
98 biblionumber
=> $biblionumber,
99 subscriptions
=> \
@subs,
100 subscriptionsnumber
=> $subscriptionsnumber,
101 subscriptiontitle
=> $dat->{title
},
104 output_html_with_http_headers
$query, $cookie, $template->output;