X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=catalogue%2FMARCdetail.pl;h=8eadb77fa653ccd74afac48842a6675a0c4d2fa0;hb=26696e3b299ff9ca96d7a834a172f6534ef952d5;hp=ce8c93ece6f26eac1a4555637a4cea5de3ad6ed3;hpb=1a5270bdd05a3eb0c74dbee93c5b536ed3ef13b5;p=koha_fer diff --git a/catalogue/MARCdetail.pl b/catalogue/MARCdetail.pl index ce8c93ece6..8eadb77fa6 100755 --- a/catalogue/MARCdetail.pl +++ b/catalogue/MARCdetail.pl @@ -1,6 +1,7 @@ #!/usr/bin/perl # Copyright 2000-2002 Katipo Communications +# Copyright 2010 BibLibre # # This file is part of Koha. # @@ -69,10 +70,6 @@ my $popup = ; # if set to 1, then don't insert links, it's just to show the biblio my $subscriptionid = $query->param('subscriptionid'); -my $tagslib = &GetMarcStructure(1,$frameworkcode); - -my $record = GetMarcBiblio($biblionumber); -my $biblio = GetBiblioData($biblionumber); # open template my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { @@ -85,6 +82,21 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( } ); +my $record = GetMarcBiblio($biblionumber, 1); +$template->param( ocoins => GetCOinSBiblio($record) ); + +if ( not defined $record ) { + # biblionumber invalid -> report and exit + $template->param( unknownbiblionumber => 1, + biblionumber => $biblionumber + ); + output_html_with_http_headers $query, $cookie, $template->output; + exit; +} + +my $tagslib = &GetMarcStructure(1,$frameworkcode); +my $biblio = GetBiblioData($biblionumber); + if($query->cookie("holdfor")){ my $holdfor_patron = GetMember('borrowernumber' => $query->cookie("holdfor")); $template->param( @@ -165,7 +177,7 @@ for ( my $tabloop = 0 ; $tabloop <= 10 ; $tabloop++ ) { # loop through each subfield for my $i ( 0 .. $#subf ) { - $subf[$i][0] = "@" unless $subf[$i][0]; + $subf[$i][0] = "@" unless defined $subf[$i][0]; next if ( $tagslib->{ $fields[$x_i]->tag() }->{ $subf[$i][0] }->{tab} @@ -321,6 +333,8 @@ $template->param ( marcview => 1, z3950_search_params => C4::Search::z3950_search_args($biblio), C4::Search::enabled_staff_search_views, + searchid => $query->param('searchid'), ); + output_html_with_http_headers $query, $cookie, $template->output;