From eb124eb18d4c93f230004c04a2b403902393fc96 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 Signed-off-by: Henri-Damien LAURENT --- koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tmpl | 2 +- opac/opac-user.pl | 7 ++++--- 2 files changed, 5 insertions(+), 4 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 0456d6a87f..36e78e1626 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tmpl @@ -222,7 +222,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 528c2e0acb..5b997c7b64 100755 --- a/opac/opac-user.pl +++ b/opac/opac-user.pl @@ -125,9 +125,10 @@ 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->{'renewcount'},$issue->{'renewsallowed'},$issue->{'renewsleft'}) = GetRenewCount($borrowernumber, $issue->{'itemnumber'}); + $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