X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=opac%2Fopac-ISBDdetail.pl;h=c80d41c8c547b109a4802cffc52896b365fb7a62;hb=8f75c19afdcbb7e5f266fe21eb7bec4d24e56e96;hp=88904da4513e864ae5d91e3a5b85f69cffb54d9d;hpb=efa66f1f556dcff71779c9b89148f2bb99149e51;p=koha_gimpoz diff --git a/opac/opac-ISBDdetail.pl b/opac/opac-ISBDdetail.pl index 88904da451..c80d41c8c5 100755 --- a/opac/opac-ISBDdetail.pl +++ b/opac/opac-ISBDdetail.pl @@ -1,6 +1,7 @@ #!/usr/bin/perl # Copyright 2000-2002 Katipo Communications +# parts copyright 2010 BibLibre # # This file is part of Koha. # @@ -61,7 +62,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( template_name => "opac-ISBDdetail.tmpl", query => $query, type => "opac", - authnotrequired => 1, + authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ), debug => 1, } ); @@ -84,7 +85,10 @@ my $upc = GetNormalizedUPC($record,$marcflavour); my $ean = GetNormalizedEAN($record,$marcflavour); my $oclc = GetNormalizedOCLCNumber($record,$marcflavour); my $isbn = GetNormalizedISBN(undef,$record,$marcflavour); -my $content_identifier_exists = 1 if ($isbn or $ean or $oclc or $upc); +my $content_identifier_exists; +if ( $isbn or $ean or $oclc or $upc ) { + $content_identifier_exists = 1; +} $template->param( normalized_upc => $upc, normalized_ean => $ean, @@ -97,8 +101,8 @@ $template->param( my $subscriptionsnumber = CountSubscriptionFromBiblionumber($biblionumber); my $dbh = C4::Context->dbh; my $dat = TransformMarcToKoha( $dbh, $record ); -my @subscriptions = - GetSubscriptions( $dat->{title}, $dat->{issn}, $biblionumber ); +my @subscriptions = GetSubscriptions( undef, undef, $biblionumber ); + my @subs; foreach my $subscription (@subscriptions) { my %cell; @@ -123,7 +127,7 @@ $template->param( my $norequests = 1; my $res = GetISBDView($biblionumber, "opac"); -my @items = &GetItemsInfo($biblionumber, 'opac'); +my @items = GetItemsInfo( $biblionumber ); my $itemtypes = GetItemTypes(); for my $itm (@items) { @@ -155,6 +159,16 @@ $template->param( reviews => $reviews, ); +#Search for title in links +if (my $search_for_title = C4::Context->preference('OPACSearchForTitleIn')){ + $dat->{author} ? $search_for_title =~ s/{AUTHOR}/$dat->{author}/g : $search_for_title =~ s/{AUTHOR}//g; + $dat->{title} =~ s/\/+$//; # remove trailing slash + $dat->{title} =~ s/\s+$//; # remove trailing space + $dat->{title} ? $search_for_title =~ s/{TITLE}/$dat->{title}/g : $search_for_title =~ s/{TITLE}//g; + $isbn ? $search_for_title =~ s/{ISBN}/$isbn/g : $search_for_title =~ s/{ISBN}//g; + $template->param('OPACSearchForTitleIn' => $search_for_title); +} + ## Amazon.com stuff #not used unless preference set if ( C4::Context->preference("OPACAmazonEnabled") == 1 ) {