From 9cfb2c7f63a1f214dafa40a8a53a4b37e77865cf 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 --- ...utoDeleteFromCartWhenHoldPlaced_syspref.pl | 21 +++++++++++++++++++ installer/data/mysql/atomicupdate/skeleton.pl | 2 +- installer/data/mysql/mandatory/sysprefs.sql | 3 ++- .../admin/preferences/circulation.pref | 6 ++++++ 4 files changed, 30 insertions(+), 2 deletions(-) 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 c3fa93d5041..ff7f5bff876 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'), @@ -892,4 +893,4 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'), ('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo'), ('z3950Status','','','This syspref allows to define custom YAML based rules for marking items unavailable in z3950 results.','Textarea') -; +; \ No newline at end of file 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