Bug 12354 - Prevent placing holds on items based on item field values
Summary: Prevent placing holds on items based on item field values
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Hold requests (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: paxed
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-03 05:57 UTC by paxed
Modified: 2023-07-15 19:42 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Add a system preference PreventItemHoldsFieldvalues (5.66 KB, patch)
2014-06-03 05:59 UTC, paxed
Details | Diff | Splinter Review
Bug 12354 - Prevent reserving items based on item field values (5.87 KB, patch)
2015-04-04 21:32 UTC, Mark Tompsett
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description paxed 2014-06-03 05:57:28 UTC
Add a system preference PreventItemHoldsFieldvalues, which is a pipe-delimited list of "fieldname=value", where fieldname is one of the fields from items -table in the database. If the field has the exact value, the item cannot be reserved.

For example, "ccode=PILA|location=OHE" would prevent reserving the item if it's collection code is 'PILA' or if it's location is 'OHE'.


To test:
1) Go to the page where you put a hold on an item, and look at the list of items. Note which ones are available for hold and which ones aren't.
2) Apply patch, set the syspref value to eg. homebranch=FOO|biblionumber=12345
3) Check that items with homebranch FOO or items for biblio 12345 cannot be reserved by patrons, and need override permission for staff to reserve.
Comment 1 paxed 2014-06-03 05:59:26 UTC Comment hidden (obsolete)
Comment 2 Marc Véron 2014-07-26 17:38:45 UTC
Good feature!

...but patch doesn't apply:
Applying: Bug 12354 - Prevent reserving items based on item field values
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref
Auto-merging installer/data/mysql/updatedatabase.pl
CONFLICT (content): Merge conflict in installer/data/mysql/updatedatabase.pl
Auto-merging installer/data/mysql/sysprefs.sql
Auto-merging C4/Reserves.pm
Failed to merge in the changes.
Patch failed at 0001 Bug 12354 - Prevent reserving items based on item field values
Comment 3 Mark Tompsett 2015-04-04 21:32:46 UTC
Created attachment 37501 [details] [review]
Bug 12354 - Prevent reserving items based on item field values

Add a system preference PreventItemHoldsFieldvalues, which is
a pipe-delimited list of "fieldname=value", where fieldname is
one of the fields from items -table in the database. If
the field has the exact value, the item cannot be reserved.

For example, "ccode=PILA|location=OHE" would prevent reserving
the item if it's collection code is 'PILA' or if it's location is 'OHE'.

To test:
1) Go to the page where you put a hold on an item, and look
   at the list of items. Note which ones are available for hold
   and which ones aren't.
2) Apply patch, set the syspref value to eg. homebranch=FOO|biblionumber=12345
3) Check that items with homebranch FOO or items for biblio 12345
   cannot be reserved by patrons, and need override permission for staff
   to reserve.

NOTE: This should apply, but is missing tests added to
      t/db_dependent/Reserves.t -- mtompset
Comment 4 Katrin Fischer 2023-07-15 19:42:08 UTC
This still sounds like an interesting feature, but I believe a change should be made to use a YAML style preference following the exmaple of the similar feature ItemsDeniedRenewal.