diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref index 024496363b..245b407a16 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -299,7 +299,7 @@ OPAC: - Only allow patrons to renew their own books on the OPAC if they have less than - pref: OPACFineNoRenewals class: currency - - '[% local_currency %] in fines (leave blank to disable).' + - '[% local_currency %] in fines (set a large value to always allow renewal).' - - pref: OPACViewOthersSuggestions choices: 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 92bd44d241..be67c8a420 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt @@ -73,8 +73,8 @@ $.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 ( BORROWER_INF.renewal_blocked_fines ) %] -
  • Please note: Since you have more than [% BORROWER_INF.renewal_blocked_fines %] in fines, you cannot renew your books online. Please pay your fines if you wish to renew your books.
  • + [% 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 %] @@ -168,7 +168,7 @@ $.tablesorter.addParser({ [% IF ( show_barcode ) %]Barcode[% END %] Call No. [% IF ( OpacRenewalAllowed ) %] - [% UNLESS ( patron_flagged ) %]Renew[% END %] + [% UNLESS patron_flagged %]Renew[% END %] [% END %] [% IF ( OPACFinesTab ) %] Fines @@ -216,7 +216,7 @@ $.tablesorter.addParser({ [% IF ( show_barcode ) %][% ISSUE.barcode %][% END %] [% ISSUE.itemcallnumber %] [% IF ( OpacRenewalAllowed ) %] - [% UNLESS ( ISSUE.patron_flagged ) %] + [% UNLESS patron_flagged %] [% IF ( ISSUE.status ) %]Renew ([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining) [% ELSE %] Not renewable[% IF ( ISSUE.too_many ) %] ([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining)[% ELSE %][% IF ( ISSUE.on_reserve ) %] (On hold)[% END %][% END %] @@ -232,10 +232,12 @@ $.tablesorter.addParser({ [% END %] - - [% IF ( OpacRenewalAllowed ) %] - - [% END %] + + [% IF OpacRenewalAllowed %] + [% UNLESS patron_flagged %] + + [% END %] + [% END %] [% IF ( OpacRenewalAllowed ) %] @@ -245,7 +247,7 @@ $.tablesorter.addParser({ [% FOREACH ISSUE IN ISSUES %] [% END %] - [% UNLESS ( patron_flagged ) %][% END %] + [% UNLESS patron_flagged %][% END %] [% END %] [% ELSE %] @@ -267,7 +269,7 @@ $.tablesorter.addParser({ Call No. Due [% IF ( OpacRenewalAllowed ) %] - [% UNLESS ( patron_flagged ) %]Renew[% END %][% END %] + [% UNLESS patron_flagged %]Renew[% END %][% END %] [% IF ( OPACFinesTab ) %] Fines [% END %] @@ -299,7 +301,7 @@ $.tablesorter.addParser({ [% OVERDUE.itemcallnumber %] [% OVERDUE.date_due %] [% IF ( OpacRenewalAllowed ) %] - [% UNLESS ( OVERDUE.patron_flagged ) %] + [% UNLESS patron_flagged %] [% IF ( OVERDUE.debarred ) %]Account Frozen [% ELSIF ( OVERDUE.status ) %] diff --git a/opac/opac-user.pl b/opac/opac-user.pl index a2f7d9b121..27bd2a4dd9 100755 --- a/opac/opac-user.pl +++ b/opac/opac-user.pl @@ -79,11 +79,13 @@ if ( $borr->{'amountoutstanding'} > 5 ) { if ( 5 >= $borr->{'amountoutstanding'} && $borr->{'amountoutstanding'} > 0 ) { $borr->{'amountoverzero'} = 1; } +my $no_renewal_amt = C4::Context->preference( 'OPACFineNoRenewals' ); +$no_renewal_amt ||= 0; -if ( $borr->{'amountoutstanding'} > C4::Context->preference( 'OPACFineNoRenewals' ) ) { +if ( $borr->{amountoutstanding} > $no_renewal_amt ) { $borr->{'flagged'} = 1; $template->param( - renewal_blocked_fines => sprintf( "%.02f", C4::Context->preference( 'OPACFineNoRenewals' ) ), + renewal_blocked_fines => sprintf( '%.02f', $no_renewal_amt ), ); }