Bug 4405 - Overdues block check out

[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>
This commit is contained in:
Chris Cormack 2010-04-26 10:30:55 +12:00 committed by Galen Charlton
parent 2a0c82652b
commit 86fbe2ec21
7 changed files with 28 additions and 3 deletions

View 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;

View File

@ -179,6 +179,8 @@ $tabsysprefs{ReturnToShelvingCart} = "Circulation";
$tabsysprefs{DisplayClearScreenButton} = "Circulation";
$tabsysprefs{AllowAllMessageDeletion} = "Circulation";
$tabsysprefs{OverdueNoticeBcc} = "Circulation";
$tabsysprefs{OverduesBlockCirc} = "Circulation";
# Staff Client
$tabsysprefs{TemplateEncoding} = "StaffClient";

View 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');

View File

@ -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)

View 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

View 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" -->

View 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