Bugzilla – Attachment 127441 Details for
Bug 29168
Only show "Request article" if allowed on the detail view
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29168: Only show 'Request article' if allowed on the detail view
Bug-29168-Only-show-Request-article-if-allowed-on-.patch (text/plain), 1.94 KB, created by
Tomás Cohen Arazi (tcohen)
on 2021-11-08 12:00:50 UTC
(
hide
)
Description:
Bug 29168: Only show 'Request article' if allowed on the detail view
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-11-08 12:00:50 UTC
Size:
1.94 KB
patch
obsolete
>From 8f60cd05d2f795faee95917e0e1587ad9bf66423 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 7 Oct 2021 11:38:14 -0300 >Subject: [PATCH] Bug 29168: Only show 'Request article' if allowed on the > detail view > >This patch adds a check for the patron being able to place the request, >in the case of logged in patron. The anonymous patron will still be >displayed the link, and redirected to the login page as required. > >To test: >1. Set the article request limit to 1 >2. Place a request on behalf of a known patron >3. With the patron session, in the OPAC, try to place a new article > request from the detail page >=> SUCCESS: There's no link >4. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > opac/opac-detail.pl | 20 ++++++++++++-------- > 1 file changed, 12 insertions(+), 8 deletions(-) > >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index 3b47a19628..56220cc759 100755 >--- a/opac/opac-detail.pl >+++ b/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 ); > } > >-- >2.32.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29168
:
125890
|
125920
|
125921
|
127175
| 127441 |
128251