From 7c9a7fe7ff4ffb0fbc6e421c0d68d11e0e4fb58e Mon Sep 17 00:00:00 2001 From: Matthias Le Gac Date: Thu, 22 Feb 2024 14:46:22 -0500 Subject: [PATCH] Bug 35169: Make long overdue borrower category options configurable in interface Signed-off-by: Kyle M Hall Signed-off-by: Katrin Fischer --- .../modules/admin/preferences/circulation.pref | 17 +++++++++++++++++ misc/cronjobs/longoverdue.pl | 11 +++++++++++ 2 files changed, 28 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref index b755959944..dbc2306bd2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -451,6 +451,23 @@ Circulation: - "." -
Leave this field empty if you don't want to skip any LOST statuses. -
Set to a list of comma separated values, e.g. 5,6,7. + - + - pref: DefaultLongOverdueBorrowerCategories + choices: patron-categories + class: multiple + - the borrower categories that will be listed. Exclude all others. + -
WARNING — This preference will be active only if DefaultLongOverdueSkipBorrowerCategories is empty. + - "
NOTE: This system preference requires the misc/cronjobs/longoverdue.pl cronjob. Ask your system administrator to schedule it." + + + - + - pref: DefaultLongOverdueSkipBorrowerCategories + choices: patron-categories + class: multiple + - the borrower categories that will not be listed. Include all others. + -
WARNING - This preference overrides the DefaultLongOverdueBorrowerCategories preference, so the DefaultLongOverdueBorrowerCategories filter will not take effect. + - "
NOTE: This system preference requires the misc/cronjobs/longoverdue.pl cronjob. Ask your system administrator to schedule it." + - - "When issuing an item that has been marked as lost, " - pref: IssueLostItem diff --git a/misc/cronjobs/longoverdue.pl b/misc/cronjobs/longoverdue.pl index 2d313b77b2..06cd6b2830 100755 --- a/misc/cronjobs/longoverdue.pl +++ b/misc/cronjobs/longoverdue.pl @@ -275,6 +275,17 @@ if ( ! defined($charge) ) { $charge = $charge_value; } } + +if ( C4::Context->preference('DefaultLongOverdueBorrowerCategories') ) { + my $categories = C4::Context->preference('DefaultLongOverdueBorrowerCategories'); + $borrower_category = [ split( ',', $categories ) ]; +} + +if ( C4::Context->preference('DefaultLongOverdueSkipBorrowerCategories') ) { + my $categories = C4::Context->preference('DefaultLongOverdueSkipBorrowerCategories'); + $skip_borrower_category = [ split( ',', $categories ) ]; +} + unless ($confirm) { $verbose = 1; # If you're not running it for real, then the whole point is the print output. print "### TEST MODE -- NO ACTIONS TAKEN ###\n"; -- 2.39.5