From 06b71abd621de773b40700aa1a7b9de761a041cb Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Thu, 16 May 2024 15:56:44 +0000 Subject: [PATCH] Bug 36868: Add system preference AutoDeleteFromCartWhenHoldPlaced Signed-off-by: Sam Lau Signed-off-by: Sarah Fletcher --- ...utoDeleteFromCartWhenHoldPlaced_syspref.pl | 21 +++++++++++++++++++ installer/data/mysql/atomicupdate/skeleton.pl | 2 +- installer/data/mysql/mandatory/sysprefs.sql | 1 + .../admin/preferences/circulation.pref | 6 ++++++ 4 files changed, 29 insertions(+), 1 deletion(-) create mode 100755 installer/data/mysql/atomicupdate/bug_36868_add_AutoDeleteFromCartWhenHoldPlaced_syspref.pl diff --git a/installer/data/mysql/atomicupdate/bug_36868_add_AutoDeleteFromCartWhenHoldPlaced_syspref.pl b/installer/data/mysql/atomicupdate/bug_36868_add_AutoDeleteFromCartWhenHoldPlaced_syspref.pl new file mode 100755 index 00000000000..449ba45d15a --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_36868_add_AutoDeleteFromCartWhenHoldPlaced_syspref.pl @@ -0,0 +1,21 @@ +use Modern::Perl; +use Koha::Installer::Output qw(say_warning say_failure say_success say_info); + +return { + bug_number => "36868", + description => "Add system preference AutoDeleteFromCartWhenHoldPlaced", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + # Do your stuff here + $dbh->do( + q{ + INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES + ('AutoDeleteFromCartWhenHoldPlaced', '','', 'Automatically delete items from cart when a hold is placed','Choice') + } + ); + + say $out "Added new system preference 'AutoDeleteFromCartWhenHoldPlaced'"; + }, +}; diff --git a/installer/data/mysql/atomicupdate/skeleton.pl b/installer/data/mysql/atomicupdate/skeleton.pl index cece7c88196..c52360bb9e0 100755 --- a/installer/data/mysql/atomicupdate/skeleton.pl +++ b/installer/data/mysql/atomicupdate/skeleton.pl @@ -8,7 +8,7 @@ return { my ($args) = @_; my ( $dbh, $out ) = @$args{qw(dbh out)}; - # Do you stuffs here + # Do your stuff here $dbh->do(q{}); # Print useful stuff here diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index 35a5d15dd8f..03fafe88c53 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -93,6 +93,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('autoControlNumber','OFF','biblionumber|OFF','Used to autogenerate a Control Number: biblionumber will be as biblionumber, OFF will leave the field as it is;','Choice'), ('AutoCreateAuthorities','0',NULL,'Automatically create authorities that do not exist when cataloging records.','YesNo'), ('AutoCreditNumber', '', '', 'Automatically generate a number for account credits', 'Choice'), +('AutoDeleteFromCartWhenHoldPlaced', '', '', 'Automatically delete items from cart when a hold is placed', 'Choice'), ('AutoEmailNewUser','0',NULL,'Send an email to newly created patrons.','YesNo'), ('AutoILLBackendPriority','',NULL,'Set the automatic backend selection priority','ill-backends'), ('AutoLinkBiblios','0',NULL,'If enabled, link biblio to authorities on creation and edit','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 82070552d6c..cca2ef4a047 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 @@ -770,6 +770,12 @@ Circulation: - pref: HoldRatioDefault class: integer - . + - + - Automatically delete items from cart when placing on hold on the + - pref: AutoDeleteFromCartWhenHoldPlaced + multiple: + staff: staff interface + opac: OPAC - - In the staff interface, split the holds queue into separate tables by - pref: HoldsSplitQueue -- 2.39.5