From fc5b528bab2b09636c3c631284595d4c7b8763f9 Mon Sep 17 00:00:00 2001 From: Jacob O'Mara Date: Fri, 31 Jan 2025 15:03:46 +0000 Subject: [PATCH] Bug 38924: Add AllowQuotaOverride and UseGuarantorQuota preferences Add a system preferences to allow/dissallow quota overflow at checkout and enable/disable the use of guarantor quotas against guarantees --- .../mysql/atomicupdate/bug_38924-patron_quotas.pl | 11 ++++++++++- installer/data/mysql/mandatory/sysprefs.sql | 2 ++ .../en/modules/admin/preferences/circulation.pref | 12 ++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/installer/data/mysql/atomicupdate/bug_38924-patron_quotas.pl b/installer/data/mysql/atomicupdate/bug_38924-patron_quotas.pl index 4cfcc0b626..fb1091ed1d 100755 --- a/installer/data/mysql/atomicupdate/bug_38924-patron_quotas.pl +++ b/installer/data/mysql/atomicupdate/bug_38924-patron_quotas.pl @@ -3,7 +3,7 @@ use Koha::Installer::Output qw(say_warning say_success say_info); return { bug_number => "38924", - description => "Add patron quota and quota_usage tables and permissions", + description => "Add patron quota and quota_usage tables, permissions and system preferences for quotas", up => sub { my ($args) = @_; my ( $dbh, $out ) = @$args{qw(dbh out)}; @@ -58,5 +58,14 @@ return { } else { say_info( $out, "Patron quota usage table already exists" ); } + + $dbh->do(q{ + INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) + VALUES + ('AllowQuotaOverride', '0', NULL, 'Allow staff to override and check out items to patrons who have exceeded their quota limit', 'YesNo'), + ('UseGuarantorQuota', '0', NULL, 'Use guarantor quota instead of guarantee quota when checking out items', 'YesNo') + }); + + say_success( $out, "Patron quota preferences added successfully" ); }, }; diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index 67cd533daf..3b40698057 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -45,6 +45,8 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('AllowPatronToSetCheckoutsVisibilityForGuarantor', '0', NULL, 'If enabled, the patron can set checkouts to be visible to their guarantor', 'YesNo'), ('AllowPatronToSetFinesVisibilityForGuarantor', '0', NULL, 'If enabled, the patron can set fines to be visible to their guarantor', 'YesNo'), ('AllowPKIAuth','None','None|Common Name|emailAddress','Use the field from a client-side SSL certificate to look a user in the Koha database','Choice'), +('AllowQuotaOverride','0','Allow staff to override and check out items to patrons who have exceeded their quota limit','','YesNo'), +('UseGuarantorQuota','0','Use guarantor quota instead of guarantee quota when checking out items if one exists and has enough quota available','','YesNo'), ('AllowRenewalIfOtherItemsAvailable','0',NULL,'If enabled, allow a patron to renew an item with unfilled holds if other available items can fill that hold.','YesNo'), ('AllowRenewalLimitOverride','0',NULL,'if ON, allows renewal limits to be overridden on the circulation screen','YesNo'), ('AllowRenewalOnHoldOverride','0',NULL,'If ON, allow items on hold to be renewed with a specified due date','YesNo'), 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 ef3c7acc01..e58acbe258 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 @@ -389,6 +389,18 @@ Circulation: 1: Allow 0: "Don't allow" - staff to check out an item with age restriction. + - + - pref: AllowQuotaOverride + choices: + 1: "Allow" + 0: "Don't allow" + - staff to check out items to patrons who have exceeded their quota limit. + - + - pref: UseGuarantorQuota + choices: + 1: "Use" + 0: "Don't use" + - guarantor's quota instead of guarantee's quota when checking out items if guarantor has an active quota and quota has enough availability. - - Prevent patrons from checking out items if they have more than - pref: noissuescharge -- 2.50.1