From 86fbe2ec2198422905dedda51b09e98528ba333a Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Mon, 26 Apr 2010 10:30:55 +1200 Subject: [PATCH] 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 Date: Mon Apr 26 10:27:39 2010 +1200 Tidy up ready to send patch commit 4d1398df18dcce4fd888cf17a0e2955fdf6ee1e4 Author: Chris Cormack Date: Mon Apr 26 10:26:15 2010 +1200 Bug 4405 - tidy up commit 3daeb71bc6b690e18dda96aa3c767c2bb0521038 Author: Chris Cormack Date: Mon Apr 26 10:02:04 2010 +1200 Bug 4405 - Overdues block checkout Signed-off-by: Galen Charlton --- C4/Circulation.pm | 9 +++++++-- admin/systempreferences.pl | 2 ++ installer/data/mysql/en/mandatory/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 6 ++++++ .../prog/en/modules/admin/preferences/circulation.pref | 7 +++++++ .../intranet-tmpl/prog/en/modules/circ/circulation.tmpl | 4 ++++ kohaversion.pl | 2 +- 7 files changed, 28 insertions(+), 3 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index d6dbbb31b9..3201e68955 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -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; diff --git a/admin/systempreferences.pl b/admin/systempreferences.pl index 6739cd93de..b39a9225a4 100755 --- a/admin/systempreferences.pl +++ b/admin/systempreferences.pl @@ -179,6 +179,8 @@ $tabsysprefs{ReturnToShelvingCart} = "Circulation"; $tabsysprefs{DisplayClearScreenButton} = "Circulation"; $tabsysprefs{AllowAllMessageDeletion} = "Circulation"; $tabsysprefs{OverdueNoticeBcc} = "Circulation"; +$tabsysprefs{OverduesBlockCirc} = "Circulation"; + # Staff Client $tabsysprefs{TemplateEncoding} = "StaffClient"; diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql index a9d437badd..860135808e 100644 --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ b/installer/data/mysql/en/mandatory/sysprefs.sql @@ -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 diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index a2ebc5c810..e2997446e0 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -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) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref index a17be02df0..8c7bcc0165 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -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 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 6c6d14bfdd..1fe88fbaae 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl @@ -337,6 +337,10 @@ function refocus(calendar) {
  • This item belongs to and cannot be issued from this location.
  • + + diff --git a/kohaversion.pl b/kohaversion.pl index 386a15869f..ff38ba303d 100644 --- a/kohaversion.pl +++ b/kohaversion.pl @@ -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 -- 2.39.5