Bug 24474: Add `onpayment` option to `MarkLostItemsReturned`
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 5 Feb 2020 10:14:05 +0000 (10:14 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Fri, 3 Apr 2020 13:26:32 +0000 (14:26 +0100)
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

installer/data/mysql/atomicupdate/bug_24474.perl [new file with mode: 0644]
installer/data/mysql/sysprefs.sql

diff --git a/installer/data/mysql/atomicupdate/bug_24474.perl b/installer/data/mysql/atomicupdate/bug_24474.perl
new file mode 100644 (file)
index 0000000..c964d0c
--- /dev/null
@@ -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";
+}
index 01ec32d..dfa58b1 100644 (file)
@@ -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'),