@@ -, +, @@ with indefinite restricition --- C4/Circulation.pm | 14 +++++++++----- circ/returns.pl | 3 +++ .../intranet-tmpl/prog/en/modules/circ/circulation.tt | 4 ++-- koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt | 4 ++++ 4 files changed, 18 insertions(+), 7 deletions(-) --- a/C4/Circulation.pm +++ a/C4/Circulation.pm @@ -1946,11 +1946,15 @@ sub AddReturn { } # there's no overdue on the item but borrower had been previously debarred } elsif ( $issue->{date_due} and $borrower->{'debarred'} ) { - my $borrower_debar_dt = dt_from_string( $borrower->{debarred} ); - $borrower_debar_dt->truncate(to => 'day'); - my $today_dt = $today->clone()->truncate(to => 'day'); - if ( DateTime->compare( $borrower_debar_dt, $today_dt ) != -1 ) { - $messages->{'PrevDebarred'} = $borrower->{'debarred'}; + if ( $borrower->{debarred} eq "9999-12-31") { + $messages->{'ForeverDebarred'} = $borrower->{'debarred'}; + } else { + my $borrower_debar_dt = dt_from_string( $borrower->{debarred} ); + $borrower_debar_dt->truncate(to => 'day'); + my $today_dt = $today->clone()->truncate(to => 'day'); + if ( DateTime->compare( $borrower_debar_dt, $today_dt ) != -1 ) { + $messages->{'PrevDebarred'} = $borrower->{'debarred'}; + } } } } --- a/circ/returns.pl +++ a/circ/returns.pl @@ -506,6 +506,9 @@ foreach my $code ( keys %$messages ) { elsif ( $code eq 'PrevDebarred' ) { $err{prevdebarred} = $messages->{'PrevDebarred'}; } + elsif ( $code eq 'ForeverDebarred' ) { + $err{foreverdebarred} = $messages->{'ForeverDebarred'}; + } elsif ( $code eq 'NotForLoanStatusUpdated' ) { $err{NotForLoanStatusUpdated} = $messages->{NotForLoanStatusUpdated}; } --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -440,7 +440,7 @@ $(document).ready(function() { [% END %] [% IF ( USERBLOCKEDNOENDDATE ) %] -
  • Patron has a restriction (no expiry date).
  • +
  • Patron has an indefinite restriction.
  • [% END %] [% IF ( USERBLOCKEDOVERDUE ) %] @@ -449,7 +449,7 @@ $(document).ready(function() { [% IF (forceallow) %] -
  • Restriction overridden temporarily
  • +
  • Restriction overridden temporarily.
  • [% END %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -423,6 +423,10 @@ $(document).ready(function () { [% IF ( errmsgloo.prevdebarred ) %]

    Reminder: Patron was earlier restricted until [% errmsgloo.prevdebarred | $KohaDates %]

    [% END %] + [% IF ( errmsgloo.foreverdebarred ) %] +

    Reminder: Patron has an indefinite restriction

    + [% END %] + [% END %] [% IF ( soundon ) %] --