From 43a9cbc4e5d03a64ff29be408492e551d460ed72 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. Signed-off-by: Chris Cormack --- C4/Circulation.pm | 6 +++++- circ/returns.pl | 4 ++++ koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt | 3 +++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index ca2e94d..0a05e21 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1680,7 +1680,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 38e9887..7face0f 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; @@ -469,6 +470,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 1ed01f0..4cbe9eb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -340,6 +340,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.10