Koha/misc
Kyle M Hall 80897930b7 Bug 2720 - Overdues which debar automatically should undebar automatically when returned
This patch adds a more extensible and flexible debarments system to Koha. The fields
borrowers.debarred and borrowers.debarredcomment are retained for compatibility and
speed.

This system supports having debarments for multiple reasons. There are currently
three types of debarments:
OVERDUES    - Generated by overdue_notices.pl if the notice should debar a patron
SUSPENSION  - A punative debarment generated on checkin via an issuing rule
MANUAL      - A debarment created manually by a librarian

OVERDUE debarments are cleared automatically when all overdue items have been returned,
if the new system preference AutoRemoveOverduesRestrictions is enabled. It is disabled
by default to retain current default functionality.

Whenever a borrowers debarments are modified, the system updates the borrowers debarment
fields with the highest expiration from all the borrowers debarments, and concatenates
the comments from the debarments together.

Test plan:
 1) Apply patch
 2) Run updatedatabase.pl
 3) Verify the borrower_debarments table has been created and
    populated with the pre-existing debarments
 4) Run t/db_dependent/Borrower_Debarments.t
 5) Manually debar a patron, with an expiration date
 6) Verify the patron cannot be issued to
 7) Add another manual debarment with a different expiration date
 8) Verify the 'restricted' message lists the date farthest into the future
 9) Add another manual debarment with no expiration date
10) Verify the borrower is now debarred indefinitely
11) Delete the indefinite debarment
12) Verify the debarment message lists an expiration date dagain
13) Enable the new system preference AutoRemoveOverduesRestrictions
14) Set an overdue notice to debar after 1 day of being overdue
15) Check out an item to a patron and backdate the due date to yesterday
16) Run overdue_notices.pl
17) Verify the OVERDUES debarment was created
18) Return the item
19) Verify the OVERDUES debarment was removed
20) Disable AutoRemoveOverduesRestrictions
21) Repeat steps 15 though 18, verify the OVERDUES debarment was *not* removed
22) Add issuing rules so that an overdue item causes a temporary debarment
23) Check out an item to a patron and backdate the due date by a year
24) Return the item
25) Verify the SUSPENSION debarment was added to the patron

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-10-31 01:53:22 +00:00
..
admin Bug 6061: clearing up system preference on update 2011-06-14 14:16:48 +12:00
bin Revert "Bug 7167: New version for updatedatabase" 2012-12-27 14:02:56 -05:00
cronjobs Bug 2720 - Overdues which debar automatically should undebar automatically when returned 2013-10-31 01:53:22 +00:00
devel bug 8798: (follow-up) pass DB connection params to DBIC schema updater explicitly 2013-10-14 21:08:03 +00:00
interface_customization Bug 9615 - Combine staff home page images into single sprite 2013-02-20 08:29:22 -05:00
load_testing Bug 10806: make the staff benchmark script check authentication failure. 2013-10-02 15:30:49 +00:00
maintenance Bug 9192: let UNIMARC_sync_date_created_with_marc_biblio.pl create fields if needed 2013-10-23 14:20:14 +00:00
migration_tools Bug 10326: bulkmarcimport.pl doesn't restore value of CataloguingLog syspref 2013-05-31 07:30:25 -07:00
release_notes update 3.14 release notes for second alpha 2013-10-22 21:08:45 +00:00
translator Translation files for 3.14.0-beta 2013-10-29 14:24:34 +00:00
batchCompareMARCvsFrameworks.pl Bug 2505 - Add commented use warnings where missing in the misc/ directory 2010-04-21 20:26:44 +12:00
batchdeletebiblios.pl Bug 8674 follow-up Fix perlcritic error 2012-10-02 17:48:03 +02:00
batchDeleteUnusedSubfields.pl Bug 2505 - Add commented use warnings where missing in the misc/ directory 2010-04-21 20:26:44 +12:00
batchImportMARCWithBiblionumbers.pl Bug 8576: Software error on authority edition when using merge 2012-08-28 17:55:33 +02:00
batchRebuildBiblioTables.pl Bug 6001 : batchRebuildBiblioTables.pl doesn't crash anymore when GetMarcBiblio fails. Unprocessed biblionumbers are displayed at the end of the execution instead. 2011-04-29 08:56:57 +12:00
batchRepairMissingBiblionumbers.pl Repair the old repairmissingbiblionumbers script 2009-04-18 15:39:24 -05:00
batchupdateISBNs.pl Bug 2505 - Add commented use warnings where missing in the misc/ directory 2010-04-21 20:26:44 +12:00
check_sysprefs.pl MT3289 : check_sysprefs.pl case sensitive variable names 2011-03-31 15:23:24 +13:00
commit_file.pl Bug 7131: (follow-up) update the command-line import tools 2013-10-30 04:35:17 +00:00
export_borrowers.pl Bug 9045 - Adding some parameters to export_borrowers.pl 2013-03-21 10:47:42 -04:00
exportauth.pl Bug 6755 Problems with switching languages 2011-09-23 09:47:09 +12:00
koha-install-log Bug 10712: Save missing config variables to install log 2013-08-13 14:14:30 +00:00
kohalib.pl Bug 2505 - Add commented use warnings where missing in the misc/ directory 2010-04-21 20:26:44 +12:00
link_bibs_to_authorities.pl Bug 8818: make sure we load modules before using them 2012-10-01 19:01:50 +02:00
mod_zebraqueue.pl Bug 9286 - Add script to add a bib to the zebra queue from the command line 2013-05-28 08:00:15 -07:00
perlmodule_ls.pl Bug 2505 - add strict and warnings to perlmodule_ls 2010-04-21 20:30:52 +12:00
perlmodule_rm.pl Bug 2505 - remove unnecessary -w and replace with use warnings; 2010-04-07 13:27:07 -04:00
recreateIssueStatistics.pl Bug 6025: Adds a script that re-create missing statistics from issues and old_issues tables 2012-03-20 17:02:33 +01:00
sax_parser_print.pl Bug 2617: Add strict (and warnings), partial fix. 2009-03-11 08:36:55 -05:00
sax_parser_test.pl Bug 6752: Be stricter with utf-8 encoding of output 2012-01-27 12:11:06 +01:00
stage_file.pl Bug 7131: (follow-up) update the command-line import tools 2013-10-30 04:35:17 +00:00