From c40c4e47cf96ebc3f27619704aa6cce76f708097 Mon Sep 17 00:00:00 2001
From: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Date: Tue, 17 Oct 2017 10:54:33 -0300
Subject: [PATCH] Bug 12363: Add new pref MarkLostItemsAsReturned
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
---
 installer/data/mysql/atomicupdate/bug_12363.sql                     | 2 ++
 installer/data/mysql/sysprefs.sql                                   | 1 +
 .../prog/en/modules/admin/preferences/circulation.pref              | 6 ++++++
 3 files changed, 9 insertions(+)
 create mode 100644 installer/data/mysql/atomicupdate/bug_12363.sql

diff --git a/installer/data/mysql/atomicupdate/bug_12363.sql b/installer/data/mysql/atomicupdate/bug_12363.sql
new file mode 100644
index 0000000..65abfc4
--- /dev/null
+++ b/installer/data/mysql/atomicupdate/bug_12363.sql
@@ -0,0 +1,2 @@
+INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
+('MarkLostItemsAsReturned','1','','Mark items as returned when flagged as lost','YesNo');
diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql
index 4647789..91c125e 100644
--- a/installer/data/mysql/sysprefs.sql
+++ b/installer/data/mysql/sysprefs.sql
@@ -255,6 +255,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
 ('MARCAuthorityControlField008','|| aca||aabn           | a|a     d',NULL,'Define the contents of MARC21 authority control field 008 position 06-39','Textarea'),
 ('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','1','','Mark items as returned when flagged as lost','YesNo'),
 ('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'),
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 b09fa34..b77b373 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
@@ -406,6 +406,12 @@ Circulation:
                   nothing : "do nothing"
             - .
         -
+            - pref: MarkLostItemsAsReturned
+              choices:
+                  yes: "Mark"
+                  no: "Do not mark"
+            - "items as returned when flagged as lost"
+        -
             - pref: AllowMultipleIssuesOnABiblio
               choices:
                   yes: Allow
-- 
2.10.2