From b47e0360d897c30cab80d0ccdf97c12a6ee62a87 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marc=20V=C3=A9ron?= Date: Sat, 13 Sep 2014 12:52:08 +0200 Subject: [PATCH] Bug 12914 - Wrong message 'Patron(..) is blocked for 2014-09-30 day(s). The message in circulation.tt assumed to get days but date is given. Updated comments and message depending on expiration date or no expiration of restriction. The message shows up on top of Bug 643 Allow override of 'debarred' status if a patron has a restriction. Replaced date_format with date template (see comment #6) Signed-off-by: Nick Clemens Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- C4/Circulation.pm | 9 +++++++-- C4/Members.pm | 3 ++- .../prog/en/modules/circ/circulation.tt | 14 +++++++++----- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 8c0b2083cd..76b6652f56 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -823,8 +823,13 @@ sub CanBookBeIssued { $needsconfirmation{USERBLOCKEDOVERDUE} = $count; } } elsif($blocktype == 1) { - # patron has accrued fine days - $issuingimpossible{USERBLOCKEDREMAINING} = $count; + # patron has accrued fine days or has a restriction. $count is a date + if ($count eq '9999-12-31') { + $issuingimpossible{USERBLOCKEDNOENDDATE} = $count; + } + else { + $issuingimpossible{USERBLOCKEDWITHENDDATE} = $count; + } } # diff --git a/C4/Members.pm b/C4/Members.pm index e3a5538613..3cb0b1e4f3 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -650,7 +650,8 @@ that would block circulation privileges. C<$block_status> can have the following values: -1 if the patron has outstanding fine days, in which case C<$count> is the number of them +1 if the patron has outstanding fine days or a manual debarment, in which case +C<$count> is the expiration date (9999-12-31 for indefinite) -1 if the patron has overdue items, in which case C<$count> is the number of them diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index 91eac715ac..3708e0e4cd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -407,12 +407,16 @@ $(document).ready(function() {
  • This item belongs to [% Branches.GetName( itemhomebranch ) %] and cannot be checked out from this location.
  • [% END %] - [% IF ( USERBLOCKEDREMAINING ) %] -
  • Patron has had overdue items and is blocked for [% USERBLOCKEDREMAINING %] day(s).
  • + [% IF ( USERBLOCKEDWITHENDDATE ) %] +
  • Patron has a restriction until [% USERBLOCKEDWITHENDDATE | $KohaDates %].
  • [% END %] - - [% IF ( USERBLOCKEDOVERDUE ) %] -
  • Checkouts are BLOCKED because patron has overdue items
  • + + [% IF ( USERBLOCKEDNOENDDATE ) %] +
  • Patron has a restriction (no expiry date).
  • + [% END %] + + [% IF ( USERBLOCKEDOVERDUE ) %] +
  • Checkouts are BLOCKED because patron has overdue items.
  • [% END %] -- 2.39.2