@@ -, +, @@ detail view request from the detail page --- opac/opac-detail.pl | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) --- a/opac/opac-detail.pl +++ a/opac/opac-detail.pl @@ -785,14 +785,18 @@ if (scalar(@itemloop) == 0 || scalar(@otheritemloop) == 0) { my $marcnotesarray = $biblio->get_marc_notes({ marcflavour => $marcflavour, opac => 1 }); -if( C4::Context->preference('ArticleRequests') ) { - my $patron = $borrowernumber ? Koha::Patrons->find($borrowernumber) : undef; - my $itemtype = Koha::ItemTypes->find($biblio->itemtype); - my $artreqpossible = $patron - ? $biblio->can_article_request( $patron ) - : $itemtype - ? $itemtype->may_article_request - : q{}; +if ( C4::Context->preference('ArticleRequests') ) { + + my $artreqpossible; + + if ( $patron && $patron->can_article_request ) { + $artreqpossible = $biblio->can_article_request($patron); + } + else { + my $item_type = Koha::ItemTypes->find( $biblio->itemtype ); + $artreqpossible = defined $item_type && $item_type->may_article_request; + } + $template->param( artreqpossible => $artreqpossible ); } --