fix for #988
authorPaul Poulain <paul.poulain@biblibre.com>
Sat, 18 Apr 2009 20:51:41 +0000 (22:51 +0200)
committerGalen Charlton <galen.charlton@liblime.com>
Mon, 11 May 2009 19:24:47 +0000 (14:24 -0500)
When a borrower can't issue any book (issuingrules=0), the message should be
"this user can't issue book" and not "too many books already issued"wrong message

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
C4/Circulation.pm
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl

index c43fbf6..200bdd2 100644 (file)
@@ -738,7 +738,12 @@ sub CanBookBeIssued {
     # JB34 CHECKS IF BORROWERS DONT HAVE ISSUE TOO MANY BOOKS
     #
        my $toomany = TooMany( $borrower, $item->{biblionumber}, $item );
-    $needsconfirmation{TOO_MANY} = $toomany if $toomany;
+    # if TooMany return / 0, then the user has no permission to check out this book
+    if ($toomany =~ /\/ 0/) {
+        $needsconfirmation{PATRON_CANT} = 1;
+    } else {
+        $needsconfirmation{TOO_MANY} = $toomany if $toomany;
+    }
 
     #
     # ITEM CHECKING
index 2dc8459..03438c3 100644 (file)
@@ -111,6 +111,7 @@ $.tablesorter.addParser({
     <li>Too many checked out (already checked out / max : <!-- TMPL_VAR name="TOO_MANY" -->)</li>
 <!-- /TMPL_IF -->
 
+<!-- TMPL_IF NAME="PATRON_CANT" --><li>This patron can't issue this item (issuing rules)</li><!-- /TMPL_IF -->
 <!-- TMPL_IF NAME="NOT_FOR_LOAN_FORCING" -->
     <li>Item is normally not for loan.  Check out anyway?</li>
 <!-- /TMPL_IF -->