From 2b1472744997e5c9567479d38357baf8adc0a2d0 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 1 Apr 2009 13:17:54 -0500 Subject: [PATCH] Corrected: Hiding renew link in the OPAC for items which cannot be renewed. Fixes bug 3083. Signed-off-by: Galen Charlton --- koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tmpl | 2 +- opac/opac-user.pl | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tmpl index 8cfef7d907..06f3c69d61 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tmpl @@ -224,7 +224,7 @@ $.tablesorter.addParser({ &borrowernumber=">Renew ( of renewals remaining) - Not renewable + Not renewable ( of renewals remaining) (On hold) diff --git a/opac/opac-user.pl b/opac/opac-user.pl index 777c659747..708ba7f1d4 100755 --- a/opac/opac-user.pl +++ b/opac/opac-user.pl @@ -127,8 +127,9 @@ foreach my $issue ( @issue_list ) { # check if item is renewable my ($status,$renewerror) = CanBookBeRenewed( $borrowernumber, $issue->{'itemnumber'} ); ($issue->{'renewcount'},$issue->{'renewsallowed'},$issue->{'renewsleft'}) = GetRenewCount($borrowernumber, $issue->{'itemnumber'}); - - $issue->{'status'} = $status || C4::Context->preference("OpacRenewalAllowed"); + $issue->{'status'} = $status && C4::Context->preference("OpacRenewalAllowed"); + $issue->{'too_many'} = 1 if $renewerror and $renewerror eq 'too_many'; + $issue->{'on_reserve'} = 1 if $renewerror and $renewerror eq 'on_reserve'; if ( $issue->{'overdue'} ) { push @overdues, $issue; -- 2.39.5