[Koha-patches] [PATCH] Bug 7110 - Renewal messages still display in OPAC if OpacRenewalAllowed is disabled

Liz Rea lrea at nekls.org
Fri Oct 28 18:00:34 CEST 2011


This patch adds a check for OpacRenewalAllowed to the computation of the renewal_blocked_fines. If OpacRenewalAllowed is off, renewal_blocked_fines won't be computed, because that message shouldn't show in the OPAC anyway.
This also removes the necessity to set a very high threshold on OPACFineNoRenewals to prevent the messages from showing with OpacRenewal disabled.

To test:
Set a patron with fines over the stated limit in OPACFineNoRenewals.

With OpacRenewalAllowed set to ALLOW
- log into the OPAC and verify the message that renewals are disallowed is displayed
- verify that renewals are disallowed in the interface.
- remove or pay the fines, verify the message goes away and that OPAC renewals are re-allowed for your patron.

With OPACFineNoRenewals set to Don't Allow
- verify the message is not shown, even with the patron's fines over the threshold in OPACFineNoRenewals.
- remove or pay the fines, verify that renewals are still disallowed
---
 koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt |   13 +++++++------
 opac/opac-user.pl                                |    2 +-
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt
index d9417ec..636d1c0 100644
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt
@@ -92,12 +92,13 @@ $.tablesorter.addParser({
             [% IF ( BORROWER_INF.lost ) %]
                 <li><strong>Please note: </strong> Your library card has been marked as lost or stolen. If this is an error, please contact the library.</li>
             [% END %]
-            [% IF renewal_blocked_fines %]
-                <li><strong>Please note: </strong> Since you have <a href="/cgi-bin/koha/opac-account.pl">more than [% renewal_blocked_fines %]</a> in fines, you cannot renew your books online. Please pay your fines if you wish to renew your books.</li>
-            [% END %]
-        </ul></div>
-        [% END %]
-        
+	    [% IF ( renewal_blocked_fines ) && ( OpacRenewalAllowed ) %]
+       	        <li><strong>Please note: </strong> Since you have <a href="/cgi-bin/koha/opac-account.pl">more than [% renewal_blocked_fines %]</a> in fines, you cannot renew your books online. Please pay your fines if you wish to renew your books.</li>
+	    [% ELSE %]
+                <li><strong>Please note: </strong> You have <a href="/cgi-bin/koha/opac-account.pl">more than [% renewal_blocked_fines %]</a> in fines. </li>
+	    [% END %]		
+	</ul></div>
+      [% END %]
 <div id="opac-user-views" class="toptabs">
         <ul>
             <li><a href="/cgi-bin/koha/opac-user.pl#opac-user-checkouts">Checked Out</a></li>
diff --git a/opac/opac-user.pl b/opac/opac-user.pl
index e99e557..ac3ff1e 100755
--- a/opac/opac-user.pl
+++ b/opac/opac-user.pl
@@ -82,7 +82,7 @@ if ( 5 >= $borr->{'amountoutstanding'} && $borr->{'amountoutstanding'} > 0 ) {
 my $no_renewal_amt = C4::Context->preference( 'OPACFineNoRenewals' );
 $no_renewal_amt ||= 0;
 
-if ( $borr->{amountoutstanding} > $no_renewal_amt ) {
+if ( $borr->{amountoutstanding} > $no_renewal_amt  && C4::Context->preference("OpacRenewalAllowed")) {
     $borr->{'flagged'} = 1;
     $template->param(
         renewal_blocked_fines => sprintf( '%.02f', $no_renewal_amt ),
-- 
1.7.2.5



More information about the Koha-patches mailing list