3 # Copyright 2000-2002 Katipo Communications
5 # This file is part of Koha.
7 # Koha is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or
10 # (at your option) any later version.
12 # Koha is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with Koha; if not, see <http://www.gnu.org/licenses>.
22 ISBDdetail.pl : script to show a biblio in ISBD format
30 This script needs a biblionumber as parameter
37 #use warnings; FIXME - Bug 2505
47 use C4
::Members
; # to use GetMember
48 use C4
::Branch
; # GetBranchDetail
49 use C4
::Serials
; # CountSubscriptionFromBiblionumber
50 use C4
::Search
; # enabled_staff_search_views
51 use C4
::Acquisition
qw(GetOrdersByBiblionumber);
54 #---- Internal function
58 my $dbh = C4
::Context
->dbh;
60 my $biblionumber = $query->param('biblionumber');
61 $biblionumber = HTML
::Entities
::encode
($biblionumber);
64 my ( $template, $loggedinuser, $cookie ) = get_template_and_user
(
66 template_name
=> "catalogue/ISBDdetail.tt",
70 flagsrequired
=> { catalogue
=> 1 },
74 my $res = GetISBDView
($biblionumber, "intranet");
75 if ( not defined $res ) {
76 # biblionumber invalid -> report and exit
77 $template->param( unknownbiblionumber
=> 1,
78 biblionumber
=> $biblionumber
80 output_html_with_http_headers
$query, $cookie, $template->output;
84 if($query->cookie("holdfor")){
85 my $holdfor_patron = GetMember
('borrowernumber' => $query->cookie("holdfor"));
87 holdfor
=> $query->cookie("holdfor"),
88 holdfor_surname
=> $holdfor_patron->{'surname'},
89 holdfor_firstname
=> $holdfor_patron->{'firstname'},
90 holdfor_cardnumber
=> $holdfor_patron->{'cardnumber'},
94 # count of item linked with biblio
95 my $itemcount = GetItemsCount
($biblionumber);
96 $template->param( count
=> $itemcount);
97 my $subscriptionsnumber = CountSubscriptionFromBiblionumber
($biblionumber);
99 if ($subscriptionsnumber) {
100 my $subscriptions = GetSubscriptionsFromBiblionumber
($biblionumber);
101 my $subscriptiontitle = $subscriptions->[0]{'bibliotitle'};
103 subscriptionsnumber
=> $subscriptionsnumber,
104 subscriptiontitle
=> $subscriptiontitle,
107 my $record = GetMarcBiblio
($biblionumber);
111 biblionumber
=> $biblionumber,
113 z3950_search_params
=> C4
::Search
::z3950_search_args
(GetBiblioData
($biblionumber)),
114 ocoins
=> GetCOinSBiblio
($record),
115 C4
::Search
::enabled_staff_search_views
,
116 searchid
=> scalar $query->param('searchid'),
119 my @allorders_using_biblio = GetOrdersByBiblionumber
($biblionumber);
120 my @deletedorders_using_biblio;
121 my @orders_using_biblio;
123 my @baskets_deletedorders;
125 foreach my $myorder (@allorders_using_biblio) {
126 my $basket = $myorder->{'basketno'};
127 if ((defined $myorder->{'datecancellationprinted'}) and ($myorder->{'datecancellationprinted'} ne '0000-00-00') ){
128 push @deletedorders_using_biblio, $myorder;
129 unless (grep(/^$basket$/, @baskets_deletedorders)){
130 push @baskets_deletedorders,$myorder->{'basketno'};
134 push @orders_using_biblio, $myorder;
135 unless (grep(/^$basket$/, @baskets_orders)){
136 push @baskets_orders,$myorder->{'basketno'};
141 my $count_orders_using_biblio = scalar @orders_using_biblio ;
142 $template->param (countorders
=> $count_orders_using_biblio);
144 my $count_deletedorders_using_biblio = scalar @deletedorders_using_biblio ;
145 $template->param (countdeletedorders
=> $count_deletedorders_using_biblio);
147 my $holds = C4
::Reserves
::GetReservesFromBiblionumber
({ biblionumber
=> $biblionumber, all_dates
=> 1 });
148 my $holdcount = scalar( @
$holds );
149 $template->param( holdcount
=> scalar ( @
$holds ) );
151 output_html_with_http_headers
$query, $cookie, $template->output;