From 3d8a57081993e17ee6b489ca8b44dd4c5cedd9f7 Mon Sep 17 00:00:00 2001 From: Lyon3 Team Date: Tue, 4 Sep 2012 14:32:52 +0200 Subject: [PATCH] Block renewal if any checked out book is late a patron can't renew whatever of his checked out books if any of them is late or if he's restricted The renewal remains nevertheless possible checking the Override renewal limit case --- 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 85d6b3b..8e1a345 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -2327,6 +2327,14 @@ sub CanBookBeRenewed { } } + my ( $blocktype, $count ) = C4::Members::IsMemberBlocked($borrowernumber); + if ( $blocktype == -1 && ! $override_limit ) { + $renewokay=0; + $error="overdue"; + } elsif ( $blocktype == 1 && ! $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 e79cef1..1bab064 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -757,6 +757,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 %] @@ -832,6 +838,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.2.5