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
::Serials
; # CountSubscriptionFromBiblionumber
47 use C4
::Search
; # enabled_staff_search_views
51 use Koha
::RecordProcessor
;
55 my $dbh = C4
::Context
->dbh;
57 my $biblionumber = $query->param('biblionumber');
58 $biblionumber = HTML
::Entities
::encode
($biblionumber);
61 my ( $template, $loggedinuser, $cookie ) = get_template_and_user
(
63 template_name
=> "catalogue/ISBDdetail.tt",
67 flagsrequired
=> { catalogue
=> 1 },
71 if ( not defined $biblionumber ) {
72 # biblionumber invalid -> report and exit
73 $template->param( unknownbiblionumber
=> 1,
74 biblionumber
=> $biblionumber
76 output_html_with_http_headers
$query, $cookie, $template->output;
80 my $record = GetMarcBiblio
({
81 biblionumber
=> $biblionumber,
84 if ( not defined $record ) {
85 # biblionumber invalid -> report and exit
86 $template->param( unknownbiblionumber
=> 1,
87 biblionumber
=> $biblionumber
89 output_html_with_http_headers
$query, $cookie, $template->output;
93 my $biblio = Koha
::Biblios
->find( $biblionumber );
94 my $framework = GetFrameworkCode
( $biblionumber );
95 my $record_processor = Koha
::RecordProcessor
->new({
96 filters
=> 'ViewPolicy',
98 interface
=> 'intranet',
99 frameworkcode
=> $framework
102 $record_processor->process($record);
104 my $res = GetISBDView
({
106 'template' => 'intranet',
107 'framework' => $framework,
110 if($query->cookie("holdfor")){
111 my $holdfor_patron = Koha
::Patrons
->find( $query->cookie("holdfor") );
113 holdfor
=> $query->cookie("holdfor"),
114 holdfor_surname
=> $holdfor_patron->surname,
115 holdfor_firstname
=> $holdfor_patron->firstname,
116 holdfor_cardnumber
=> $holdfor_patron->cardnumber,
120 if( $query->cookie("searchToOrder") ){
121 my ( $basketno, $vendorid ) = split( /\//, $query->cookie("searchToOrder") );
123 searchtoorder_basketno
=> $basketno,
124 searchtoorder_vendorid
=> $vendorid
128 # count of item linked with biblio
129 my $itemcount = $biblio->items->count;
130 $template->param( count
=> $itemcount);
131 my $subscriptionsnumber = CountSubscriptionFromBiblionumber
($biblionumber);
133 if ($subscriptionsnumber) {
134 my $subscriptions = GetSubscriptionsFromBiblionumber
($biblionumber);
135 my $subscriptiontitle = $subscriptions->[0]{'bibliotitle'};
137 subscriptionsnumber
=> $subscriptionsnumber,
138 subscriptiontitle
=> $subscriptiontitle,
144 biblionumber
=> $biblionumber,
146 z3950_search_params
=> C4
::Search
::z3950_search_args
(GetBiblioData
($biblionumber)),
147 ocoins
=> $biblio->get_coins,
148 C4
::Search
::enabled_staff_search_views
,
149 searchid
=> scalar $query->param('searchid'),
153 my $holds = $biblio->holds;
154 $template->param( holdcount
=> $holds->count );
156 output_html_with_http_headers
$query, $cookie, $template->output;