From d6af04a9ceb72595aeefc81fc281bc9afb4e4041 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 1 Sep 2021 08:24:04 -0400 Subject: [PATCH] Bug 22866: Add syspref --- installer/data/mysql/atomicupdate/bug_22866.pl | 15 +++++++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 1 + .../en/modules/admin/preferences/circulation.pref | 6 ++++++ svc/renew | 2 +- 4 files changed, 23 insertions(+), 1 deletion(-) create mode 100755 installer/data/mysql/atomicupdate/bug_22866.pl diff --git a/installer/data/mysql/atomicupdate/bug_22866.pl b/installer/data/mysql/atomicupdate/bug_22866.pl new file mode 100755 index 0000000000..e93cc8d545 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_22866.pl @@ -0,0 +1,15 @@ +use Modern::Perl; + +return { + bug_number => "22866", + description => "Add new syspref AllowRenewalItemsDeniedOverride", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + + $dbh->do(q{ + INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES + ('AllowRenewalItemsDeniedOverride','0','','If ON, allow items on hold to be renewed by staff even if disallowed by ItemsDeniedRenewal','YesNo'); + }); + }, +} diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index 59db857ca6..78144b38d2 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -44,6 +44,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('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'), +('AllowRenewalItemsDeniedOverride','0',NULL,'If ON, allow items on hold to be renewed by staff even if disallowed by ItemsDeniedRenewal','YesNo'), ('AllowReturnToBranch','anywhere','anywhere|homebranch|holdingbranch|homeorholdingbranch','Where an item may be returned','Choice'), ('AllowStaffToSetCheckoutsVisibilityForGuarantor','0',NULL,'If enabled, library staff can set a patron''s checkouts to be visible to linked patrons from the opac.', 'YesNo'), ('AllowStaffToSetFinesVisibilityForGuarantor','0',NULL,'If enabled, library staff can set a patron''s fines to be visible to linked patrons from the opac.', '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 fc07ec1ed6..9037221d4b 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 @@ -212,6 +212,12 @@ Circulation: 1: Allow 0: "Don't allow" - staff to renew items that are on hold by manually specifying a due date. + - + - pref: AllowRenewalItemsDeniedOverride + choices: + 1: Allow + 0: "Don't allow" + - staff to renew items that should not be renewable because they have a match in ItemsDeniedRenewal. - - pref: AllowItemsOnHoldCheckoutSIP choices: diff --git a/svc/renew b/svc/renew index 39f3d3d5be..ff02cc6935 100755 --- a/svc/renew +++ b/svc/renew @@ -69,7 +69,7 @@ my $override = $override ||= $data->{error} && $data->{error} eq 'item_denied_renewal' - && C4::Context->preference('AllowRenewalLimitOverride'); + && C4::Context->preference('AllowRenewalItemsDeniedOverride'); # If we're allowing reserved items to be renewed... if ( $override ) { -- 2.30.1 (Apple Git-130)