@@ -, +, @@ holds --- C4/Reserves.pm | 8 +++++--- .../bug_20955_add_TriggerForbiddenwqHolds_syspref.perl | 8 ++++++++ installer/data/mysql/sysprefs.sql | 1 + .../prog/en/modules/admin/preferences/circulation.pref | 6 ++++++ 4 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_20955_add_TriggerForbiddenwqHolds_syspref.perl --- a/C4/Reserves.pm +++ a/C4/Reserves.pm @@ -739,9 +739,11 @@ sub CheckReserves { $patron ||= Koha::Patrons->find( $res->{borrowernumber} ); my $branch = GetReservesControlBranch( $iteminfo, $patron->unblessed ); my $branchitemrule = C4::Circulation::GetBranchItemRule($branch,$iteminfo->{'itype'}); - next if ($branchitemrule->{'holdallowed'} == 0); - next if (($branchitemrule->{'holdallowed'} == 1) && ($branch ne $patron->branchcode)); - next if ( ($branchitemrule->{hold_fulfillment_policy} ne 'any') && ($res->{branchcode} ne $iteminfo->{ $branchitemrule->{hold_fulfillment_policy} }) ); + if( !C4::Context->preference('TriggerForbiddenHolds') ) { + next if ($branchitemrule->{'holdallowed'} == 0); + next if (($branchitemrule->{'holdallowed'} == 1) && ($branch ne $patron->branchcode)); + next if ( ($branchitemrule->{hold_fulfillment_policy} ne 'any') && ($res->{branchcode} ne $iteminfo->{ $branchitemrule->{hold_fulfillment_policy} }) ); + } $priority = $res->{'priority'}; $highest = $res; last if $local_hold_match; --- a/installer/data/mysql/atomicupdate/bug_20955_add_TriggerForbiddenwqHolds_syspref.perl +++ a/installer/data/mysql/atomicupdate/bug_20955_add_TriggerForbiddenwqHolds_syspref.perl @@ -0,0 +1,8 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + $dbh->do("INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('TriggerForbiddenHolds','0', 'Consider holds that defy circulation/holds policies when checking items in', NULL, 'YesNo');"); + + # Always end with this (adjust the bug info) + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 20955 - Add TriggerForbiddenHolds system preference)\n"; +} --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -569,6 +569,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('TransfersMaxDaysWarning','3',NULL,'Define the days before a transfer is suspected of having a problem','Integer'), ('TransferWhenCancelAllWaitingHolds','0',NULL,'Transfer items when cancelling all waiting holds','YesNo'), ('TranslateNotices','0',NULL, 'Allow notices to be translated','YesNo'), +('TriggerForbiddenHolds','0',NULL, 'Consider holds that defy circulation/holds policies when checking items in', 'YesNo'), ('UNIMARCAuthorityField100','afrey50 ba0',NULL,'Define the contents of UNIMARC authority control field 100 position 08-35','Textarea'), ('UNIMARCAuthorsFacetsSeparator',', ',NULL,'UNIMARC authors facets separator','short'), ('UNIMARCField100Language','fre',NULL,'UNIMARC field 100 default language','short'), --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -726,6 +726,12 @@ Circulation: - 'Example: "itemlost: 1" to set items.itemlost to 1 when the item is marked as lost' - pref: UpdateItemWhenLostFromHoldList type: textarea + - + - pref: TriggerForbiddenHolds + choices: + yes: Do + no: "Don't" + - trigger holds that defy the circulation/holds policies. Interlibrary Loans: - - pref: ILLModule --