From f343315dfb32358e8396807b216b04e928f08e3e 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 --- ...utoDeleteFromCartWhenHoldPlaced_syspref.pl | 21 +++++++++++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 1 + .../admin/preferences/circulation.pref | 6 ++++++ 3 files changed, 28 insertions(+) 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 0000000000..be7cf50c46 --- /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 you stuffs 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/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index dffaaadd49..a5756f4ff4 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -88,6 +88,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'), ('AutoLinkBiblios','0',NULL,'If enabled, link biblio to authorities on creation and edit','YesNo'), ('AutomaticCheckinAutoFill','0',NULL,'Automatically fill the next hold with an automatic check in.','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 e0e0ead489..a5758a2644 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 @@ -738,6 +738,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.2