[Koha-patches] [PATCH] fix for #988

Paul Poulain paul.poulain at biblibre.com
Sat Apr 18 22:51:41 CEST 2009


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
---
 C4/Circulation.pm                                  |    7 ++++++-
 .../prog/en/modules/circ/circulation.tmpl          |    1 +
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/C4/Circulation.pm b/C4/Circulation.pm
index 2d852bd..8051a63 100644
--- a/C4/Circulation.pm
+++ b/C4/Circulation.pm
@@ -714,7 +714,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
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl
index 79fb642..7783c30 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl
@@ -91,6 +91,7 @@ $.tablesorter.addParser({
 <!-- TMPL_IF NAME="RESERVED" --><li>Item is on reserve for <!-- TMPL_VAR NAME="RESERVED" --></li><!-- /TMPL_IF -->
 <!-- TMPL_IF NAME="ISSUED_TO_ANOTHER" --><li>Item ( <!-- TMPL_VAR NAME="getTitleMessageIteminfo" --> ) checked out to <!-- TMPL_VAR NAME="ISSUED_TO_ANOTHER" -->. Check in and check out?</li><!-- /TMPL_IF -->
 <!-- TMPL_IF NAME="TOO_MANY" --><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="OVERDUES" --><li><!--TMPL_VAR Name="OVERDUES"--> Overdues</li><!-- /TMPL_IF -->
 <!-- TMPL_IF NAME="NOT_FOR_LOAN_CAN_FORCE" --><li>Item not for loan, are you sure you want to check it out ?</p><!-- /TMPL_IF -->
 </ul>
-- 
1.5.6.3




More information about the Koha-patches mailing list