Bug 15524: Set limit on maximum possible holds per patron by category
authorKyle M Hall <kyle@bywatersolutions.com>
Wed, 28 Jun 2017 12:54:03 +0000 (08:54 -0400)
committerNick Clemens <nick@bywatersolutions.com>
Fri, 24 Aug 2018 16:23:27 +0000 (16:23 +0000)
commit7e956e85b1ef13abf48b9c60c763a77564abca45
tree78fbece5babda700bea5e287fd42228e0a485978
parent6bb02671f89d445bb6101fef5ded68ddc83a8876
Bug 15524: Set limit on maximum possible holds per patron by category

It's possible to set a limit on the maximum number of holds for a particular branch/category/itemtype, but not on the total number of holds for a given patron (by branch/category).
This new rule works in conjunction with the existing branch/borrower/item rules in that Koha will use the lower of the two limits. This new rule counts all holds of all types, which prevents bib-level holds from not being counted for the purpose of these limits. This makes the most sense and was also requested by the sponsor.

Test Plan:
1) Apply this patch
2) Run updatedatabase.pl
3) Go to the circ rules editor, note the new max holds rules
   by patron category in the "Checkout limit by patron category".
   ( Should we rename this section? )
4) Create find a patron that is allowed to place a hold, count the
   number of holds that patron has. Lets make that number 'X'.
5) Set the new max holds rule to X for "All libraries"
6) Note the patron can no longer place another hold
7) Set the new max holds rule to X + 1 for the patron's home library
8) Note the patron can again place another hold
9) Set the new max holds rule to X for the patron's home library
10) Note the patron can no longer place another hold

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
C4/Reserves.pm
admin/smart-rules.pl
installer/data/mysql/atomicupdate/bug_15524.perl [new file with mode: 0644]
installer/data/mysql/kohastructure.sql
koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt
t/db_dependent/Holds.t