Bug 26498: Set default expiration date for holds
authorEmmi Takkinen <emmi.takkinen@outlook.com>
Thu, 26 Nov 2020 12:59:42 +0000 (14:59 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 7 Apr 2021 11:10:31 +0000 (13:10 +0200)
commit9fe3c489f486e185a30c82bab8ff6008e5a583bf
treef924bca7cf6389dbfde818fcc4a9762f3bc9d04b
parentb258a0684473da3f04c3b0835c821de3a03b1ad3
Bug 26498: Set default expiration date for holds

Koha doesn't automatically set expiration date for holds
so they can live in the system forever. This patch adds
new sysprefs to control setting of default expiration
date for holds. Note that expiration date is only set
if input field for it is left blank.

To test:
1. Apply patch and update database.
2. Enable syspref "DefaultHoldExpirationdate" and set some values
to "DefaultHoldExpirationdatePeriod" and
"DefaultHoldExpirationdateUnitOfTime".
3. Add some holds for patron from staff client or OPAC and leave
expiration date input field blank.
=> Holds expiration date should be set according your settings
4. Disable "DefaultHoldExpirationdate" and repeat step 3.
=> Expiration date shouldn't be set.

Also prove prove t/db_dependent/Hold.t

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Andrew Isherwood <andrew.isherwood@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Koha/Hold.pm
installer/data/mysql/atomicupdate/Bug-26498-Set_default_expiration_date_for_holds.perl [new file with mode: 0644]
installer/data/mysql/mandatory/sysprefs.sql
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref
t/db_dependent/Hold.t