[Koha-patches] [PATCH] Hiding renew link in the OPAC for items which cannot be renewed. Fixes bug 3083.
Owen Leonard
oleonard at myacpl.org
Wed Apr 1 19:04:57 CEST 2009
---
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 8cfef7d..06f3c69 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({
<!-- TMPL_UNLESS name="patron_flagged" -->
<td><!-- TMPL_IF NAME="status" --><a href="/cgi-bin/koha/opac-renew.pl?from=opac_user&item=<!-- TMPL_VAR NAME="itemnumber" -->&borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->">Renew</a> <span class="renewals">(<!-- TMPL_VAR NAME="renewsleft" --> of <!-- TMPL_VAR NAME="renewsallowed" --> renewals remaining)</span>
<!-- TMPL_ELSE -->
- Not renewable
+ Not renewable<!-- TMPL_IF NAME="too_many" --> <span class="renewals">(<!-- TMPL_VAR NAME="renewsleft" --> of <!-- TMPL_VAR NAME="renewsallowed" --> renewals remaining)</span><!-- TMPL_ELSE --><!-- TMPL_IF NAME="on_reserve" --> <span class="renewals">(On hold)</span><!-- /TMPL_IF --><!-- /TMPL_IF -->
<!-- /TMPL_IF --></td>
<!-- /TMPL_UNLESS -->
<!-- /TMPL_IF -->
diff --git a/opac/opac-user.pl b/opac/opac-user.pl
index 777c659..b353486 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");
+ if($renewerror eq "too_many"){ $issue->{'too_many'} = 1 };
+ if($renewerror eq "on_reserve"){ $issue->{'on_reserve'} = 1 };
if ( $issue->{'overdue'} ) {
push @overdues, $issue;
--
1.5.6.5
More information about the Koha-patches
mailing list