From cb821e3d0f8432b2f8de006fd4a363b1d76c3454 Mon Sep 17 00:00:00 2001 From: Lyon3 Team Date: Mon, 11 Jun 2012 16:25:41 +0100 Subject: [PATCH] Bug 8236: prevent renewing if overdue or restriction --- C4/Circulation.pm | 8 ++++++++ .../prog/en/modules/circ/circulation.tt | 12 ++++++++++++ 2 files changed, 20 insertions(+), 0 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index d4329a7..064cc57 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -2322,6 +2322,14 @@ sub CanBookBeRenewed { } } + my ( $blocktype, $count ) = C4::Members::IsMemberBlocked($borrowernumber); + if ( $blocktype == -1 && ! defined($override_limit) ) { + $renewokay=0; + $error="overdue"; + } elsif ( $blocktype == 1 && ! defined($override_limit) ) { + $renewokay=0; + $error="restriction"; + } return ($renewokay,$error); } 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 64ca686..2d1256c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -762,6 +762,12 @@ No patron matched [% message %] [% IF ( todayissue.renew_error_too_many ) %] Not renewable [% END %] + [% IF ( todayissue.renew_error_overdue ) %] + Overdues + [% END %] + [% IF ( todayissue.renew_error_restriction ) %] + Patron is restricted + [% END %] [% IF ( todayissue.can_confirm ) %] [% END %] @@ -837,6 +843,12 @@ No patron matched [% message %] [% IF ( previssue.renew_error_too_many ) %] Not renewable [% END %] + [% IF ( previssue.renew_error_overdue ) %] + Not Renewable (Overdue) + [% END %] + [% IF ( previssue.renew_error_restriction ) %] + Patron is restricted + [% END %] [% IF ( previssue.can_confirm ) %] [% END %] -- 1.7.4.1