Bug 4405 - Overdues block check out
authorChris Cormack <chrisc@catalyst.net.nz>
Sun, 25 Apr 2010 22:30:55 +0000 (10:30 +1200)
committerGalen Charlton <gmcharlt@gmail.com>
Sat, 1 May 2010 14:39:11 +0000 (10:39 -0400)
[Documentation note by RM:

This patch adds a new system preference, OverduesBlockCirc,
that can take one of three values:

  - noblock:      checkouts permitted even if patrons
                  have overdue items (default)
  - confirmation: circ operator asked to confirm checkout
  - block:        checkouts to patrons who have overdue
                  items are forbidden

]

Squashed commit of the following:

commit 6a1f66e0686a14d8a89abfc3fe5978dabd0b7af7
Author: Chris Cormack <chrisc@catalyst.net.nz>
Date:   Mon Apr 26 10:27:39 2010 +1200

    Tidy up ready to send patch

commit 4d1398df18dcce4fd888cf17a0e2955fdf6ee1e4
Author: Chris Cormack <chrisc@catalyst.net.nz>
Date:   Mon Apr 26 10:26:15 2010 +1200

    Bug 4405 - tidy up

commit 3daeb71bc6b690e18dda96aa3c767c2bb0521038
Author: Chris Cormack <chrisc@catalyst.net.nz>
Date:   Mon Apr 26 10:02:04 2010 +1200

    Bug 4405 - Overdues block checkout

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
C4/Circulation.pm
admin/systempreferences.pl
installer/data/mysql/en/mandatory/sysprefs.sql
installer/data/mysql/updatedatabase.pl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl
kohaversion.pl

index d6dbbb3..3201e68 100644 (file)
@@ -733,8 +733,13 @@ sub CanBookBeIssued {
 
     my ($blocktype, $count) = C4::Members::IsMemberBlocked($borrower->{'borrowernumber'});
     if($blocktype == -1){
-        ## remaining overdue documents
-        $issuingimpossible{USERBLOCKEDREMAINING} = $count;
+        ## remaining overdue documentsi
+       if ( C4::Context->preference("OverduesBlockCirc") eq 'block'){
+           $issuingimpossible{USERBLOCKEDREMAINING} = $count;
+       }
+       elsif ( C4::Context->preference("OverudesBlockCirc") eq 'confirmation'){
+           $needsconfirmation{USERBLOCKEDREMAINING} = $count;
+       }
     }elsif($blocktype == 1){
         ## blocked because of overdue return
         $issuingimpossible{USERBLOCKEDOVERDUE} = $count;
index 6739cd9..b39a922 100755 (executable)
@@ -179,6 +179,8 @@ $tabsysprefs{ReturnToShelvingCart}           = "Circulation";
 $tabsysprefs{DisplayClearScreenButton}       = "Circulation";
 $tabsysprefs{AllowAllMessageDeletion}        = "Circulation";
 $tabsysprefs{OverdueNoticeBcc}               = "Circulation";
+$tabsysprefs{OverduesBlockCirc}              = "Circulation";
+
 
 # Staff Client
 $tabsysprefs{TemplateEncoding}        = "StaffClient";
index a9d437b..8601358 100644 (file)
@@ -286,3 +286,4 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'PrintNoticesMaxLines', '0', '', 'If greater than 0, sets the maximum number of lines an overdue notice will print. If the number of items is greater than this number, the notice will end with a warning asking the borrower to check their online account for a full list of overdue items.', 'Integer' );
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ILS-DI','0','Enables ILS-DI services at OPAC.','','YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ILS-DI:Authorized_IPs','','.','Restricts usage of ILS-DI to some IPs','Free');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OverduesBlockCirc','no','When checking out an item should overdues block checkout, generate a confirmation dialogue, or allow checkout','noblock|confirmation|block','Choice');
\ No newline at end of file
index a2ebc5c..e299744 100755 (executable)
@@ -3589,6 +3589,12 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
     SetVersion ($DBversion);
 }
 
+$DBversion = '3.01.00.133';
+if (C4::Context->preference('Version') < TransformToNum($DBversion)){
+    $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OverduesBlockCirc','no','When checking out an item should overdues block checkout, generate a confirmation dialogue, or allow checkout','noblock|confirmation|block','Choice')");
+    print "Upgrade to $DBversion done (bug 4405: Circulation is blocked if a borrower has overdues)\n";
+    SetVersion ($DBversion);
+}
 
 =item DropAllForeignKeys($table)
 
index a17be02..8c7bcc0 100644 (file)
@@ -185,6 +185,13 @@ Circulation:
             - pref: PrintNoticesMaxLines
               class: integer
             - "item lines in a printed overdue notice. If the number of items is greater than this number, the notice will end with a warning asking the borrower to check their online account for a full list of overdue items.  Set to 0 to include all overdue items in the notice, no matter how many there are."
+        -
+            - pref: OverduesBlockCirc
+              choices:
+                  block: Block
+                  noblock: "Don't block"
+                  confirmatio: Ask for confirmation
+            - when checking out to a borrower that has overdues outstanding        
     Holds Policy:
         -
             - pref: AllowHoldPolicyOverride
index 6c6d14b..1fe88fb 100644 (file)
@@ -337,6 +337,10 @@ function refocus(calendar) {
         <!-- TMPL_IF NAME="NOTSAMEBRANCH" -->
             <li>This item belongs to <!-- TMPL_VAR NAME="itemhomebranch" --> and cannot be issued from this location.</li>
         <!-- /TMPL_IF -->
+       
+       <!-- TMPL_IF NAME="USERBLOCKEDREMAINING" --:
+           <li>Check out blocked as borrower has overdues outstanding</li>
+       <!-- /TMPL_IF -->
         </ul>
 
     <!-- TMPL_IF NAME="memberofinstution" -->
index 386a158..ff38ba3 100644 (file)
@@ -10,7 +10,7 @@
 use strict;
 
 sub kohaversion {
-    our $VERSION = '3.01.00.132';
+    our $VERSION = '3.01.00.133';
     # version needs to be set this way
     # so that it can be picked up by Makefile.PL
     # during install