From 126fe1a2fafbea4a94905f3857724d281ec329f1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Radek=20=C5=A0iman?= <rbit@rbit.cz>
Date: Thu, 3 Nov 2016 02:38:07 +0100
Subject: [PATCH] [SIGNED-OFF] Bug 17509: Improved system preferences for item
 return notification

Test plan:
1) apply patch
2) go to System preferences / Circulation / Holds Policy
3) change NotifyToReturn* variables as you wish
4) verify your changes in database

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
---
 .../bug_17509_add_NotifyToReturnItemWhenHoldIsPlaced_syspref.sql   | 2 +-
 installer/data/mysql/sysprefs.sql                                  | 2 +-
 .../prog/en/modules/admin/preferences/circulation.pref             | 7 ++++---
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/installer/data/mysql/atomicupdate/bug_17509_add_NotifyToReturnItemWhenHoldIsPlaced_syspref.sql b/installer/data/mysql/atomicupdate/bug_17509_add_NotifyToReturnItemWhenHoldIsPlaced_syspref.sql
index f4ff752..2eb7e2f 100644
--- a/installer/data/mysql/atomicupdate/bug_17509_add_NotifyToReturnItemWhenHoldIsPlaced_syspref.sql
+++ b/installer/data/mysql/atomicupdate/bug_17509_add_NotifyToReturnItemWhenHoldIsPlaced_syspref.sql
@@ -1,2 +1,2 @@
 INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('NotifyToReturnItemWhenHoldIsPlaced', '0', 'If ON, notifies the patrons to return an item whenever a hold is placed on it', NULL, 'YesNo');
-INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('NotifyToReturnItemFromLibrary', 'PatronLibrary', 'Restricts which libraries to take into consideration when notifying patrons to return items on hold', 'PatronLibrary|AnyLibrary', 'Choice');
+INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('NotifyToReturnItemFromLibrary', 'ItemHomeLibrary', 'Restricts what library to take into consideration when notifying patrons to return items on hold', 'RequestorLibrary|ItemHomeLibrary|AnyLibrary', 'Choice');
diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql
index d9a74e7..e2b0b97 100644
--- a/installer/data/mysql/sysprefs.sql
+++ b/installer/data/mysql/sysprefs.sql
@@ -278,7 +278,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
 ('NoticeBcc','','','Email address to bcc outgoing notices sent by email','free'),
 ('NoticeCSS','',NULL,'Notices CSS url.','free'),
 ('NotifyBorrowerDeparture','30',NULL,'Define number of days before expiry where circulation is warned about patron account expiry','Integer'),
-('NotifyToReturnItemFromLibrary','PatronLibrary','PatronLibrary|AnyLibrary','Restricts which libraries to take into consideration when notifying patrons to return items on hold','Choice'),
+('NotifyToReturnItemFromLibrary','ItemHomeLibrary','RequestorLibrary|ItemHomeLibrary|AnyLibrary','Restricts what library to take into consideration when notifying patrons to return items on hold','Choice'),
 ('NotifyToReturnItemWhenHoldIsPlaced','0',NULL,'If ON, notifies the borrowers to return an item whenever a hold is placed on it','YesNo'),
 ('NovelistSelectEnabled','0',NULL,'Enable Novelist Select content.  Requires Novelist Profile and Password','YesNo'),
 ('NovelistSelectPassword','',NULL,'Enable Novelist user Profile','free'),
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 179e934..0d067f8 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
@@ -592,11 +592,12 @@ Circulation:
               choices:
                   yes: Enable
                   no:  "Don't enable"
-            - sending an email to the patrons to return an item whenever a hold request is placed on it. If enabled, contact patrons from
+            - sending an email to the patrons to return an item whenever a hold request is placed on it. If enabled, contact patrons
             - pref: NotifyToReturnItemFromLibrary
               choices:
-                  PatronLibrary: "patron's home library"
-                  AnyLibrary:    "any library"
+                  RequestorLibrary: "belonging to requestor's home library"
+                  ItemHomeLibrary:  "having the item borrowed from requestor's home library"
+                  AnyLibrary:       "from any library"
             - .
         -
             - pref: DisplayMultiPlaceHold
-- 
2.1.4