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
46 use C4
::Members
; # to use GetMember
47 use C4
::Serials
; # CountSubscriptionFromBiblionumber
48 use C4
::Search
; # enabled_staff_search_views
49 use C4
::Acquisition
qw(GetOrdersByBiblionumber);
50 use Koha
::RecordProcessor
;
54 my $dbh = C4
::Context
->dbh;
56 my $biblionumber = $query->param('biblionumber');
57 $biblionumber = HTML
::Entities
::encode
($biblionumber);
60 my ( $template, $loggedinuser, $cookie ) = get_template_and_user
(
62 template_name
=> "catalogue/ISBDdetail.tt",
66 flagsrequired
=> { catalogue
=> 1 },
70 if ( not defined $biblionumber ) {
71 # biblionumber invalid -> report and exit
72 $template->param( unknownbiblionumber
=> 1,
73 biblionumber
=> $biblionumber
75 output_html_with_http_headers
$query, $cookie, $template->output;
79 my $record = GetMarcBiblio
($biblionumber,1);
81 if ( not defined $record ) {
82 # biblionumber invalid -> report and exit
83 $template->param( unknownbiblionumber
=> 1,
84 biblionumber
=> $biblionumber
86 output_html_with_http_headers
$query, $cookie, $template->output;
90 my $framework = GetFrameworkCode
( $biblionumber );
91 my $record_processor = Koha
::RecordProcessor
->new({
92 filters
=> 'ViewPolicy',
94 interface
=> 'intranet',
95 frameworkcode
=> $framework
98 $record_processor->process($record);
100 my $res = GetISBDView
({
102 'template' => 'intranet',
103 'framework' => $framework,
106 if($query->cookie("holdfor")){
107 my $holdfor_patron = GetMember
('borrowernumber' => $query->cookie("holdfor"));
109 holdfor
=> $query->cookie("holdfor"),
110 holdfor_surname
=> $holdfor_patron->{'surname'},
111 holdfor_firstname
=> $holdfor_patron->{'firstname'},
112 holdfor_cardnumber
=> $holdfor_patron->{'cardnumber'},
116 # count of item linked with biblio
117 my $itemcount = GetItemsCount
($biblionumber);
118 $template->param( count
=> $itemcount);
119 my $subscriptionsnumber = CountSubscriptionFromBiblionumber
($biblionumber);
121 if ($subscriptionsnumber) {
122 my $subscriptions = GetSubscriptionsFromBiblionumber
($biblionumber);
123 my $subscriptiontitle = $subscriptions->[0]{'bibliotitle'};
125 subscriptionsnumber
=> $subscriptionsnumber,
126 subscriptiontitle
=> $subscriptiontitle,
132 biblionumber
=> $biblionumber,
134 z3950_search_params
=> C4
::Search
::z3950_search_args
(GetBiblioData
($biblionumber)),
135 ocoins
=> GetCOinSBiblio
($record),
136 C4
::Search
::enabled_staff_search_views
,
137 searchid
=> scalar $query->param('searchid'),
140 my @allorders_using_biblio = GetOrdersByBiblionumber
($biblionumber);
141 my @deletedorders_using_biblio;
142 my @orders_using_biblio;
144 my @baskets_deletedorders;
146 foreach my $myorder (@allorders_using_biblio) {
147 my $basket = $myorder->{'basketno'};
148 if ((defined $myorder->{'datecancellationprinted'}) and ($myorder->{'datecancellationprinted'} ne '0000-00-00') ){
149 push @deletedorders_using_biblio, $myorder;
150 unless (grep(/^$basket$/, @baskets_deletedorders)){
151 push @baskets_deletedorders,$myorder->{'basketno'};
155 push @orders_using_biblio, $myorder;
156 unless (grep(/^$basket$/, @baskets_orders)){
157 push @baskets_orders,$myorder->{'basketno'};
162 my $count_orders_using_biblio = scalar @orders_using_biblio ;
163 $template->param (countorders
=> $count_orders_using_biblio);
165 my $count_deletedorders_using_biblio = scalar @deletedorders_using_biblio ;
166 $template->param (countdeletedorders
=> $count_deletedorders_using_biblio);
168 my $holds = C4
::Reserves
::GetReservesFromBiblionumber
({ biblionumber
=> $biblionumber, all_dates
=> 1 });
169 my $holdcount = scalar( @
$holds );
170 $template->param( holdcount
=> scalar ( @
$holds ) );
172 output_html_with_http_headers
$query, $cookie, $template->output;