Bugzilla – Attachment 86853 Details for
Bug 18306
"Renew selected" and "renew all" in OPAC can be confusing for users not allowed to do it
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18306: "Renew selected" and "renew all" in OPAC can be confusing for users not allowed to do it
Bug-18306-Renew-selected-and-renew-all-in-OPAC-can.patch (text/plain), 4.66 KB, created by
Owen Leonard
on 2019-03-21 16:49:56 UTC
(
hide
)
Description:
Bug 18306: "Renew selected" and "renew all" in OPAC can be confusing for users not allowed to do it
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2019-03-21 16:49:56 UTC
Size:
4.66 KB
patch
obsolete
>From a8c94380b23fafb8827cf0b7707644b76aaa6fc2 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 21 Mar 2019 16:05:17 +0000 >Subject: [PATCH] Bug 18306: "Renew selected" and "renew all" in OPAC can be > confusing for users not allowed to do it > >This patch add additional checks to opac-user.pl defining the ability to >renew some or all items. The template can now better check whether it >should show the renewal controls. > >To test, apply the patch and log in to the OPAC as a user with multiple >checkouts. Test the following conditions: > > - All checkouts can be renewed > - "Renew selected" and "Renew all" should appear at the top and > bottom of the table of checkouts. > - No checkouts can be renewed > - No renewal controls should appear. > - Some checkouts can be renewed > - "Renew selected" should appear but not "Renew all" > >Test with various settings of the OverduesBlockRenewing system >preference. >--- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt | 7 +++++-- > opac/opac-user.pl | 7 ++++++- > 2 files changed, 11 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >index 7c55d8d..4d3e666 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >@@ -360,7 +360,7 @@ > [% END %] > </form> > >- [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( logged_in_user.is_expired && logged_in_user.category.effective_BlockExpiredPatronOpacActions ) ) %] >+ [% IF ( canrenew && can_renew_all && !userdebarred && OpacRenewalAllowed && !( logged_in_user.is_expired && logged_in_user.category.effective_BlockExpiredPatronOpacActions ) ) %] > <form id="renewall" action="/cgi-bin/koha/opac-renew.pl" method="post"> > <input type="hidden" name="from" value="opac_user" /> > <input type="hidden" name="borrowernumber" value="[% borrowernumber | html %]" /> >@@ -1024,7 +1024,10 @@ > $("#renewall").submit(); > }); > [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( logged_in_user.is_expired && logged_in_user.category.effective_BlockExpiredPatronOpacActions ) ) %] >- $("#checkoutst caption").append("<div id=\"renewcontrols\"><a id=\"renewselected_link\" href=\"#\">"+_("Renew selected")+"</a> <a id=\"renewall_link\" href=\"#\">"+_("Renew all")+"</a></div>"); >+ $("#checkoutst caption").append("<div id=\"renewcontrols\"><a id=\"renewselected_link\" href=\"#\">"+_("Renew selected")+"</a></div>"); >+ [% IF ( can_renew_all ) %] >+ $("#renewcontrols").append("<a id=\"renewall_link\" href=\"#\">"+_("Renew all")+"</a>"); >+ [% END %] > [% END %] > [% END %] > >diff --git a/opac/opac-user.pl b/opac/opac-user.pl >index 1fde24b..48c032c 100755 >--- a/opac/opac-user.pl >+++ b/opac/opac-user.pl >@@ -84,6 +84,7 @@ for ( C4::Context->preference("OPACShowHoldQueueDetails") ) { > > my $patronupdate = $query->param('patronupdate'); > my $canrenew = 1; >+my $can_renew_all = 1; > > $template->param( shibbolethAuthentication => C4::Context->config('useshibboleth') ); > >@@ -230,6 +231,7 @@ if ( $pending_checkouts->count ) { # Useless test > $issue->{'renewed'} = $renewed{ $issue->{'itemnumber'} }; > > if ($renewerror) { >+ $can_renew_all = 0; > $issue->{'too_many'} = 1 if $renewerror eq 'too_many'; > $issue->{'on_reserve'} = 1 if $renewerror eq 'on_reserve'; > $issue->{'norenew_overdue'} = 1 if $renewerror eq 'overdue'; >@@ -284,11 +286,14 @@ if ( $pending_checkouts->count ) { # Useless test > } > } > my $overduesblockrenewing = C4::Context->preference('OverduesBlockRenewing'); >-$canrenew = 0 if ($overduesblockrenewing ne 'allow' and $overdues_count == $count); >+$canrenew = 0 if ( $overduesblockrenewing eq 'block' and $overdues_count > 0 ); >+$can_renew_all = 0 if ( $overduesblockrenewing eq 'blockitem' and $overdues_count > 0 ); >+$canrenew = 0 if ( $overduesblockrenewing eq 'blockitem' and $overdues_count == $count ); > > $template->param( ISSUES => \@issuedat ); > $template->param( issues_count => $count ); > $template->param( canrenew => $canrenew ); >+$template->param( can_renew_all => $can_renew_all ); > $template->param( OVERDUES => \@overdues ); > $template->param( overdues_count => $overdues_count ); > >-- >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 18306
:
61338
|
61400
| 86853 |
86855