From 8c740e6e74c27510b0887c126a001145242a1909 Mon Sep 17 00:00:00 2001 From: Lyon3 Team Date: Mon, 11 Jun 2012 14:45:24 +0100 Subject: [PATCH] Bug 8231: reminder when checking in for a restricted patron If a patron is restricted, a warning will appear on the return page when checking in. --- C4/Circulation.pm | 6 +++++- circ/returns.pl | 4 ++++ .../intranet-tmpl/prog/en/modules/circ/returns.tt | 3 +++ 3 files changed, 12 insertions(+), 1 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 9b523e3..74398d6 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1677,7 +1677,11 @@ sub AddReturn { # fix fine days my $debardate = _FixFineDaysOnReturn( $borrower, $item, $issue->{date_due} ); - $messages->{'Debarred'} = $debardate if ($debardate); + if ($debardate) { + $messages->{'Debarred'} = $debardate; + } elsif ($borrower->{'debarred'}) { + $messages->{'PrevDebarred'} = $borrower->{'debarred'}; + } } # find reserves..... diff --git a/circ/returns.pl b/circ/returns.pl index bd60d42..17b43b2 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -46,6 +46,7 @@ use C4::Koha; # FIXME : is it still useful ? use C4::RotatingCollections; use Koha::DateUtils; use Koha::Calendar; +use C4::Dates qw/format_date/; my $query = new CGI; @@ -470,6 +471,9 @@ foreach my $code ( keys %$messages ) { $err{debarborrowernumber} = $borrower->{borrowernumber}; $err{debarname} = "$borrower->{firstname} $borrower->{surname}"; } + elsif ( $code eq 'PrevDebarred' ) { + $err{prevdebarred} = format_date( $messages->{'PrevDebarred'} ); + } else { die "Unknown error code $code"; # note we need all the (empty) elsif's above, or we die. # This forces the issue of staying in sync w/ Circulation.pm diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt index 835724f..fded74c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -338,6 +338,9 @@ $(document).ready(function () { [% IF ( errmsgloo.debarred ) %]

[% errmsgloo.debarname %]([% errmsgloo.debarcardnumber %]) is now debarred until [% errmsgloo.debarred | $KohaDates %]

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

REMINDER: Patron is restricted until [% errmsgloo.prevdebarred %]

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