Bugzilla – Attachment 72915 Details for
Bug 17530
Don't show 'article request' link when no article requests are permitted
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17530: Use can_article_request to control sidebar link
Bug-17530-Use-canarticlerequest-to-control-sidebar.patch (text/plain), 4.19 KB, created by
Brendan Gallagher
on 2018-03-15 09:40:12 UTC
(
hide
)
Description:
Bug 17530: Use can_article_request to control sidebar link
Filename:
MIME Type:
Creator:
Brendan Gallagher
Created:
2018-03-15 09:40:12 UTC
Size:
4.19 KB
patch
obsolete
>From e24e6cdce206cddd3d511c42242154bdc9db2a38 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 1 Mar 2018 15:38:48 +0100 >Subject: [PATCH] Bug 17530: Use can_article_request to control sidebar link > >Before this patch, the 'Request article' link is displayed whenever the >pref is enabled. In many cases this might be useless. Instead of a guess >as in opac-search, we now call can_article_request to know for sure. >Note: at least this is the case when a user has logged in. > >Update sidebar template with template variable artreqpossible. >Add code in opac-detail, MARCdetail and ISBDdetail to fill it. > >Test plan: >[1] Look for two biblios with items: one that should allow article requests > and one that should not (respecting branch, patron, item type). >[2] Verify on detail, ISBD and MARC that the link is displayed for > the first biblio and hidden for the second biblio. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> >--- > koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc | 2 +- > opac/opac-ISBDdetail.pl | 7 +++++++ > opac/opac-MARCdetail.pl | 7 +++++++ > opac/opac-detail.pl | 8 ++++++++ > 4 files changed, 23 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc >index e408d0a..b3d44c1 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc >@@ -13,7 +13,7 @@ > <li><a class="print-large" href="#">Print</a></li> > > [% IF Koha.Preference( 'opacuserlogin' ) == 1 %] >- [% IF Koha.Preference('ArticleRequests') %] >+ [% IF artreqpossible %] > <li><a class="article_request" href="/cgi-bin/koha/opac-request-article.pl?biblionumber=[% biblio.biblionumber %]">Request article</a></li> > [% END %] > [% END %] >diff --git a/opac/opac-ISBDdetail.pl b/opac/opac-ISBDdetail.pl >index 40e9b71..cdbd37b 100755 >--- a/opac/opac-ISBDdetail.pl >+++ b/opac/opac-ISBDdetail.pl >@@ -217,4 +217,11 @@ if (my $search_for_title = C4::Context->preference('OPACSearchForTitleIn')){ > $template->param('OPACSearchForTitleIn' => $search_for_title); > } > >+if( C4::Context->preference('ArticleRequests') ) { >+ my $artreqpossible = $patron >+ ? $biblio->can_article_request( $patron ) >+ : $biblio->may_article_request; >+ $template->param( artreqpossible => $artreqpossible ); >+} >+ > output_html_with_http_headers $query, $cookie, $template->output; >diff --git a/opac/opac-MARCdetail.pl b/opac/opac-MARCdetail.pl >index ebb78a2..926b70b 100755 >--- a/opac/opac-MARCdetail.pl >+++ b/opac/opac-MARCdetail.pl >@@ -349,6 +349,13 @@ if (my $search_for_title = C4::Context->preference('OPACSearchForTitleIn')){ > $template->param('OPACSearchForTitleIn' => $search_for_title); > } > >+if( C4::Context->preference('ArticleRequests') ) { >+ my $artreqpossible = $patron >+ ? $biblio->can_article_request( $patron ) >+ : $biblio->may_article_request; >+ $template->param( artreqpossible => $artreqpossible ); >+} >+ > $template->param( > item_loop => \@item_loop, > item_header_loop => \@item_header_loop, >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index e7653d9..00a05a6 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -756,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 ) >+ : $biblio->may_article_request; >+ $template->param( artreqpossible => $artreqpossible ); >+} >+ > $template->param( > MARCNOTES => $marcnotesarray, > norequests => $norequests, >-- >2.1.4
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 17530
:
72857
|
72858
|
72859
|
72860
|
72909
|
72910
|
72911
|
72912
|
72913
|
72914
|
72915
|
72930
|
72931
|
75697
|
75751
|
76617
|
76618
|
76619
|
76620
|
76621
|
76622
|
77258
|
77259
|
77260
|
77261
|
77262
|
77263
|
78030
|
78031
|
78032
|
78033
|
78034
|
78035
|
78362
|
78363
|
78364
|
78365
|
78366
|
78367
|
78368
|
78499