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