X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=opac%2Fopac-detail.pl;h=6f10c6bde380cf62da420964863177e45f66f7fe;hb=cc3bc2920744e35256b45b784c9788a64fe6dd04;hp=9a1177e32ed6caca888061aad65ad49d9fe7731e;hpb=9905247a481c7eb4db6d2cc38ea3f1041d66aa4b;p=koha.git diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 9a1177e32e..6f10c6bde3 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -32,7 +32,7 @@ use C4::Biblio; use C4::Items; use C4::Circulation; use C4::Tags qw(get_tags); -use C4::XISBN qw(get_xisbns get_biblionumber_from_isbn); +use C4::XISBN qw(get_xisbns); use C4::External::Amazon; use C4::External::Syndetics qw(get_syndetics_index get_syndetics_summary get_syndetics_toc get_syndetics_excerpt get_syndetics_reviews get_syndetics_anotes ); use C4::Members; @@ -52,6 +52,8 @@ use C4::CourseReserves qw(GetItemCourseReservesInfo); use Koha::Biblios; use Koha::RecordProcessor; use Koha::AuthorisedValues; +use Koha::IssuingRules; +use Koha::Items; use Koha::ItemTypes; use Koha::Acquisition::Orders; use Koha::Virtualshelves; @@ -171,7 +173,6 @@ if ( $xslfile ) { } my $OpacBrowseResults = C4::Context->preference("OpacBrowseResults"); -$template->{VARS}->{'OpacBrowseResults'} = $OpacBrowseResults; # We look for the busc param to build the simple paging from the search if ($OpacBrowseResults) { @@ -198,6 +199,7 @@ if ($session->param('busc')) { } } else { for my $value (@{$arrParamsBusc->{$_}}) { + next if !defined($value); $pasarParams .= '&' if ($j); $pasarParams .= $_ . '=' . Encode::decode('UTF-8', uri_escape_utf8($value)); $j++; @@ -457,6 +459,7 @@ if ($session->param('busc')) { } $template->param('listResults' => \@listResults) if (@listResults); $template->param('indexPag' => 1 + $offset, 'totalPag' => $arrParamsBusc{'total'}, 'indexPagEnd' => scalar(@arrBiblios) + $offset); + $template->param( 'offset' => $offset ); } } @@ -586,10 +589,9 @@ foreach my $subscription (@subscriptions) { $cell{latestserials} = GetLatestSerials( $subscription->{subscriptionid}, $serials_to_display ); if ( $borrowernumber ) { - my $sub = getalert($borrowernumber,'issue',$subscription->{subscriptionid}); - if (@$sub[0]) { - $cell{hasalert} = 1; - } + my $subscription_object = Koha::Subscriptions->find( $subscription->{subscriptionid} ); + my $subscriber = $subscription_object->subscribers->find( $borrowernumber ); + $cell{hasalert} = 1 if $subscriber; } push @subs, \%cell; } @@ -661,6 +663,7 @@ if ( not $viewallitems and @items > $max_items_to_display ) { } else { my $patron = Koha::Patrons->find( $borrowernumber ); for my $itm (@items) { + my $item = Koha::Items->find( $itm->{itemnumber} ); $itm->{holds_count} = $item_reserves{ $itm->{itemnumber} }; $itm->{priority} = $priority{ $itm->{itemnumber} }; $norequests = 0 @@ -671,7 +674,7 @@ if ( not $viewallitems and @items > $max_items_to_display ) { && !$itemtypes->{$itm->{'itype'}}->{notforloan} && $itm->{'itemnumber'}; - $allow_onshelf_holds = C4::Reserves::OnShelfHoldsAllowed( $itm, ( $patron ? $patron->unblessed : {} ) ) + $allow_onshelf_holds = Koha::IssuingRules->get_onshelfholds_policy( { item => $item, patron => $patron } ) unless $allow_onshelf_holds; # get collection code description, too @@ -719,7 +722,7 @@ if ( not $viewallitems and @items > $max_items_to_display ) { } } -if( $allow_onshelf_holds || CountItemsIssued($biblionumber) || $biblio->hasItemswaitingOrInTransit ) { +if( $allow_onshelf_holds || CountItemsIssued($biblionumber) || $biblio->has_items_waiting_or_intransit ) { $template->param( ReservableItems => 1 ); } @@ -753,6 +756,14 @@ if (!C4::Context->preference("OPACXSLTDetailsDisplay") ) { my $marcnotesarray = GetMarcNotes ($record,$marcflavour); my $subtitle = GetRecordValue('subtitle', $record, GetFrameworkCode($biblionumber)); +if( C4::Context->preference('ArticleRequests') ) { + my $patron = $borrowernumber ? Koha::Patrons->find($borrowernumber) : undef; + my $artreqpossible = $patron + ? $biblio->can_article_request( $patron ) + : Koha::ItemTypes->find($biblio->itemtype)->may_article_request; + $template->param( artreqpossible => $artreqpossible ); +} + $template->param( MARCNOTES => $marcnotesarray, norequests => $norequests, @@ -845,7 +856,7 @@ if ( C4::Context->preference('reviewson') ) { } } for my $review (@$reviews) { - my $patron = Koha::Patrons->find( $review->{borrowernumber} ); + my $patron = Koha::Patrons->find( $review->{borrowernumber} ); # FIXME Should be Koha::Review->reviewer or similar # setting some borrower info into this hash if ( $patron ) { @@ -1078,7 +1089,7 @@ if (C4::Context->preference("BakerTaylorEnabled")) { { $template->param( BakerTaylorContentURL => - sprintf("http://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=%s&Password=%s&ItemKey=%s&Options=Y", + sprintf("https://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=%s&Password=%s&ItemKey=%s&Options=Y", $bt_user,$bt_pass,$isbn) ); }