DB seed data for CAPTURE and FULFILL penalty blocks

All occurrences of HOLD in the block list for any existing penalties are
updated to HOLD|CAPTURE|FULFILL for backwards compatibility, minus the
handful of STAFF_* penalties whose codes match their respective
block_lists.

To use these new block types, simply update existing penalties as
desired or add new local pentalty types for staff-managed patron
blocking messages.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
hold CAP/FILL blocks : separate CIRC and FULFILL blocks

This breaks the CIRC standing penalty block out into two separate
blocks.  The existing CIRC block now prevents circulations on checkouts
where the checkout is not fulfilling a hold.  A new FULFILL block type
is added which, when applied to a user, (only) prevents the user from
checking out items that fulfill a hold.

To always prevents checkouts, use both blocks.  Use individual blocks
where one or the other behavior is desired.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Avoid checkin capture for CAPTURE-blocked holds

Teach the nearest_hold sub about CAPTURE-blocking penalties

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Avoid CAPTURE-blocked holds in pull list

Otherwise, staff will be pulling items for holds that cannot be
captured.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
hold CAP/FILL blocks : repair event test in patron permit

Repairs in oversight in the patron permit event testing code that caused
the test to miss events when the checkout was not there to fulfill a
hold.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
hold CAP/FILL blocks : more event test collection repairs

Further improving the logic which decides which patron permit events are
valid for a given set of circumstances.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
hold CAP/FILL blocks : pair FULFILL with CIRC in stock penalties

FULFILL is really a block on circulation, not holds, so pair the FULFILL
block with CIRC blocks for the stock data.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Avoid CAPTURE-blocked holds in pull list (IDL view)

Update the new IDL holds pull list view to avoid returning holds for
users that have CAPTURE penalties.

Note that items are blocked from the pull list only if the hold pickup
lib is within the CAPTURE penalty org unit range.  This means that users
could be blocked at one branch, but use a pickup lib at another to avoid
the block.  To prevent this type of abuse, set the org_depth to 0 on any
penalties that apply the CAPTURE block.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Apply HOLD block on new holds, CAPTURE block on existing

With the addition of the CAPTURE block, the HOLD block should only apply
for newly placed holds in the hold permit test
(action.hold_request_permit_test).

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Stamping upgrade script for Capture/Fulfill penalty blocks

Signed-off-by: Mike Rylander <mrylander@gmail.com>