From 08322a6f639bd2946b9db70fe6906d5ca12f26bd Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 5 Feb 2020 10:14:05 +0000 Subject: [PATCH] Bug 24474: Add `onpayment` option to `MarkLostItemsReturned` Signed-off-by: David Nind Signed-off-by: Kyle M Hall Signed-off-by: Martin Renvoize --- .../data/mysql/atomicupdate/bug_24474.perl | 28 +++++++++++++++++++ installer/data/mysql/sysprefs.sql | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 installer/data/mysql/atomicupdate/bug_24474.perl diff --git a/installer/data/mysql/atomicupdate/bug_24474.perl b/installer/data/mysql/atomicupdate/bug_24474.perl new file mode 100644 index 0000000000..c964d0c829 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_24474.perl @@ -0,0 +1,28 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if ( CheckVersion($DBversion) ) { + $dbh->do(q{ + UPDATE + systempreferences + SET + options = "batchmod|moredetail|cronjob|additem|pendingreserves|onpayment" + WHERE + variable = "MarkLostItemsAsReturned" + }); + + my $lost_item_returned = C4::Context->preference("MarkLostItemsAsReturned"); + my @set = split( ",", $lost_item_returned ); + push @set, 'onpayment'; + $lost_item_returned = join( ",", @set ); + + $dbh->do(qq{ + UPDATE + systempreferences + SET + value = "$lost_item_returned" + WHERE + variable = "MarkLostItemsAsReturned" + }); + + SetVersion($DBversion); + print "Upgrade to $DBversion done (Bug 24474 - Add `onpayment` option to MarkLostItemsAsReturned)\n"; +} diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 01ec32d118..dfa58b1809 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -307,7 +307,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('MarcFieldForModifierName','',NULL,'Where to store the name of the record''s last modifier','Free'), ('MarcFieldsToOrder','',NULL,'Set the mapping values for a new order line created from a MARC record in a staged file. In a YAML format.','textarea'), ('MarcItemFieldsToOrder','',NULL,'Set the mapping values for new item records created from a MARC record in a staged file. In a YAML format.','textarea'), -('MarkLostItemsAsReturned','batchmod,moredetail,cronjob,additem,pendingreserves','batchmod|moredetail|cronjob|additem|pendingreserves','Mark items as returned when flagged as lost','multiple'), +('MarkLostItemsAsReturned','batchmod,moredetail,cronjob,additem,pendingreserves,onpayment','batchmod|moredetail|cronjob|additem|pendingreserves|onpayment','Mark items as returned when flagged as lost','multiple'), ('MARCOrgCode','OSt','','Define MARC Organization Code for MARC21 records - http://www.loc.gov/marc/organizations/orgshome.html','free'), ('MaxFine',NULL,'','Maximum fine a patron can have for all late returns at one moment. Single item caps are specified in the circulation rules matrix.','Integer'), ('MaxItemsToDisplayForBatchDel','1000',NULL,'Display up to a given number of items in a single item deletionbatch.','Integer'), -- 2.39.5