@@ -, +, @@
renewable items
Some not renewable because set for auto renewal
Some not renewable because of holds
Some renewable
2 - Confirm 'Renew selected' and 'Renew all' show on the opac
3 - Click 'Renew all'
4 - You get errors about the non-renewable items?
5 - Check in all renewable items
6 - Confirm you still see renew buttons
7 - Apply patch
8 - Refresh and you shoudl not see renew buttons
9 - Check out a renewable item
---
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt | 4 +++-
opac/opac-user.pl | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt
+++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt
@@ -414,7 +414,9 @@
[% FOREACH ISSUE IN ISSUES %]
-
+ [% IF ISSUE.status %]
+
+ [% END %]
[% END %]
--- a/opac/opac-user.pl
+++ a/opac/opac-user.pl
@@ -190,6 +190,7 @@ my @overdues;
my @issuedat;
my $itemtypes = { map { $_->{itemtype} => $_ } @{ Koha::ItemTypes->search_with_localization->unblessed } };
my $pending_checkouts = $patron->pending_checkouts->search({}, { order_by => [ { -desc => 'date_due' }, { -asc => 'issue_id' } ] });
+my $are_renewable_items = 0;
if ( $pending_checkouts->count ) { # Useless test
while ( my $c = $pending_checkouts->next ) {
my $issue = $c->unblessed_all_relateds;
@@ -226,6 +227,7 @@ if ( $pending_checkouts->count ) { # Useless test
( $issue->{'renewalfee'}, $issue->{'renewalitemtype'} ) = GetIssuingCharges( $issue->{'itemnumber'}, $borrowernumber );
$issue->{itemtype_object} = Koha::ItemTypes->find( Koha::Items->find( $issue->{itemnumber} )->effective_itemtype );
if($status && C4::Context->preference("OpacRenewalAllowed")){
+ $are_renewable_items = 1;
$issue->{'status'} = $status;
}
@@ -299,7 +301,7 @@ 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 ne 'allow' and $overdues_count == $count) || !$are_renewable_items;
$template->param( ISSUES => \@issuedat );
$template->param( issues_count => $count );
--