@@ -, +, @@ --- C4/Reserves.pm | 4 ++-- installer/data/mysql/atomicupdate/bug_6918.perl | 10 ++++++++++ installer/data/mysql/sysprefs.sql | 1 + .../prog/en/modules/admin/preferences/circulation.pref | 6 ++++++ 4 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_6918.perl --- a/C4/Reserves.pm +++ a/C4/Reserves.pm @@ -1290,7 +1290,7 @@ sub IsAvailableForItemLevelRequest { return !$items_any_available; } else { # on_shelf_holds == 0 "If any unavailable" (the description is rather cryptic and could still be improved) - return $item->notforloan < 0 || $item->onloan || IsItemOnHoldAndFound( $item->itemnumber ); + return ( C4::Context->preference('AllowOnOrderOnShelfHolds') ? $item->notforloan < 0 : 0 ) || $item->onloan || IsItemOnHoldAndFound( $item->itemnumber ); } } @@ -1320,7 +1320,7 @@ sub ItemsAnyAvailableForHold { $any_available = 1 unless $i->itemlost - || $i->notforloan != 0 + || C4::Context->preference('AllowOnOrderOnShelfHolds') ? $i->notforloan != 0 : $i->notforloan > 0 || $i->withdrawn || $i->onloan || IsItemOnHoldAndFound( $i->id ) --- a/installer/data/mysql/atomicupdate/bug_6918.perl +++ a/installer/data/mysql/atomicupdate/bug_6918.perl @@ -0,0 +1,10 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + $dbh->do(q{ + INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES + ('AllowOnOrderOnShelfHolds', '0', NULL, 'Allow on order items to be placed on hold even if on shelf holds are not allowed', 'YesNo'); + }); + + # Always end with this (adjust the bug info) + NewVersion( $DBversion, 6918, "Can't place holds on 'on order' items with AllowOnShelfHolds off"); +} --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -34,6 +34,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('AllowMultipleIssuesOnABiblio',1,'Allow/Don\'t allow patrons to check out multiple items from one biblio','','YesNo'), ('AllowNotForLoanOverride','0','','If ON, Koha will allow the librarian to loan a not for loan item.','YesNo'), ('AllowOfflineCirculation','0','','If on, enables HTML5 offline circulation functionality.','YesNo'), +('AllowOnOrderOnShelfHolds', '0', NULL, 'Allow on order items to be placed on hold even if on shelf holds are not allowed', 'YesNo'), ('AllowPatronToControlAutorenewal','0',NULL,'If enabled, patrons will have a field in their account to choose whether their checkouts are auto renewed or not','YesNo'), ('AllowPatronToSetCheckoutsVisibilityForGuarantor', '0', NULL, 'If enabled, the patron can set checkouts to be visible to his or her guarantor', 'YesNo'), ('AllowPatronToSetFinesVisibilityForGuarantor', '0', NULL, 'If enabled, the patron can set fines to be visible to his or her guarantor', 'YesNo'), --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -635,6 +635,12 @@ Circulation: yes: Allow no: "Don't allow" - hold fulfillment to be limited by itemtype. + - + - pref: AllowOnOrderOnShelfHolds + choices: + yes: Allow + no: "Don't allow" + - on order items ( not for loan < 0 ) to be holdable when on-shelf holds are otherwise not allowed. - - pref: AllowRenewalIfOtherItemsAvailable choices: --