From 347a17c6d3dee84605487e3fece39ee90d719dfb Mon Sep 17 00:00:00 2001 From: Liz Rea Date: Fri, 28 Oct 2011 09:56:43 -0500 Subject: [PATCH] Bug 7110 - Renewal messages still display in OPAC if OpacRenewalAllowed is disabled 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 Signed-off-by: Chris Cormack --- 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 ) %]
  • Please note: Your library card has been marked as lost or stolen. If this is an error, please contact the library.
  • [% END %] - [% IF renewal_blocked_fines %] -
  • Please note: Since you have more than [% renewal_blocked_fines %] in fines, you cannot renew your books online. Please pay your fines if you wish to renew your books.
  • - [% END %] - - [% END %] - + [% IF ( renewal_blocked_fines ) && ( OpacRenewalAllowed ) %] +
  • Please note: Since you have more than [% renewal_blocked_fines %] in fines, you cannot renew your books online. Please pay your fines if you wish to renew your books.
  • + [% ELSE %] +
  • Please note: You have more than [% renewal_blocked_fines %] in fines.
  • + [% END %] + + [% END %]
    • Checked Out
    • 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.5.4