[Koha-patches] [PATCH] Bug 8236: prevent renewing if overdue or restriction

Adrien Saurat adrien.saurat at biblibre.com
Mon Jun 11 17:36:39 CEST 2012


From: Lyon3 Team <koha at univ-lyon3.fr>

---
 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 <span class="ex">[% message %]</span>
                 [% 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 ) %]
                 </span>
             [% END %]
@@ -837,6 +843,12 @@ No patron matched <span class="ex">[% message %]</span>
                 [% 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 ) %]
                 </span>
             [% END %]
-- 
1.7.4.1



More information about the Koha-patches mailing list