@@ -, +, @@ --- .../prog/en/modules/admin/preferences/opac.pref | 2 +- koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt | 24 ++++++++++--------- opac/opac-user.pl | 6 +++- 3 files changed, 18 insertions(+), 14 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -320,7 +320,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: --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt +++ a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt @@ -110,8 +110,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 %] @@ -205,7 +205,7 @@ $.tablesorter.addParser({ Call No. Due [% IF ( OpacRenewalAllowed ) %] - [% UNLESS ( patron_flagged ) %]Renew[% END %] + [% UNLESS patron_flagged %]Renew[% END %] [% END %] [% IF ( OPACFinesTab ) %] Fines @@ -253,7 +253,7 @@ $.tablesorter.addParser({ [% ISSUE.date_due %] [% END %] [% 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 %] @@ -269,10 +269,12 @@ $.tablesorter.addParser({ [% END %] - - [% IF ( OpacRenewalAllowed ) %] - - [% END %] + + [% IF OpacRenewalAllowed %] + [% UNLESS patron_flagged %] + + [% END %] + [% END %] [% IF ( OpacRenewalAllowed ) %] @@ -282,7 +284,7 @@ $.tablesorter.addParser({ [% FOREACH ISSUE IN ISSUES %] [% END %] - [% UNLESS ( patron_flagged ) %][% END %] + [% UNLESS patron_flagged %][% END %] [% END %] [% ELSE %] @@ -304,7 +306,7 @@ $.tablesorter.addParser({ Call No. Due [% IF ( OpacRenewalAllowed ) %] - [% UNLESS ( patron_flagged ) %]Renew[% END %][% END %] + [% UNLESS patron_flagged %]Renew[% END %][% END %] [% IF ( OPACFinesTab ) %] Fines [% END %] @@ -336,7 +338,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 ) %] --- a/opac/opac-user.pl +++ a/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 ), ); } --