From a4a9d012817f3f009763984c1217152b08cee44b Mon Sep 17 00:00:00 2001
From: Kyle M Hall <kyle@bywatersolutions.com>
Date: Wed, 4 Dec 2013 13:12:15 -0500
Subject: [PATCH] Bug 6254 - can't set patron privacy by default - QA Followup

---
 C4/Members.pm                                      |    8 ++++----
 installer/data/mysql/sysprefs.sql                  |    2 +-
 installer/data/mysql/updatedatabase.pl             |    2 +-
 .../prog/en/modules/admin/preferences/patrons.pref |    2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/C4/Members.pm b/C4/Members.pm
index ed68e67..c44eac9 100644
--- a/C4/Members.pm
+++ b/C4/Members.pm
@@ -807,11 +807,11 @@ sub AddMember {
         $data{'dateenrolled'} = C4::Dates->new()->output("iso");
     }
 
-    my $NewPatronPrivacySetting = C4::Context->preference('NewPatronPrivacySetting');
+    my $DefaultPatronPrivacySetting = C4::Context->preference('DefaultPatronPrivacySetting');
     $data{'privacy'} =
-        $NewPatronPrivacySetting eq 'default' ? 1
-      : $NewPatronPrivacySetting eq 'never'   ? 2
-      : $NewPatronPrivacySetting eq 'forever' ? 0
+        $DefaultPatronPrivacySetting eq 'default' ? 1
+      : $DefaultPatronPrivacySetting eq 'never'   ? 2
+      : $DefaultPatronPrivacySetting eq 'forever' ? 0
       :                                         undef;
 
     # create a disabled account if no password provided
diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql
index 6ffb297..a7df253 100644
--- a/installer/data/mysql/sysprefs.sql
+++ b/installer/data/mysql/sysprefs.sql
@@ -183,7 +183,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
 ('memberofinstitution','0',NULL,'If ON, patrons can be linked to institutions','YesNo'),
 ('minPasswordLength','3',NULL,'Specify the minimum length of a patron/staff password','free'),
 ('NewItemsDefaultLocation','','','If set, all new items will have a location of the given Location Code ( Authorized Value type LOC )',''),
-( 'NewPatronPrivacySetting', 'default', 'default|never|forever', "Define the default borrower.privacy setting for new patrons, i.e. how long do we keep a patron's issue history. 1 = default, 2 = never, 0 = forever.", 'Choice' ),
+( 'DefaultPatronPrivacySetting', 'default', 'default|never|forever', "Define the default borrower.privacy setting for new patrons, i.e. how long do we keep a patron's issue history. 1 = default, 2 = never, 0 = forever.", 'Choice' ),
 ('noissuescharge','5','','Define maximum amount withstanding before check outs are blocked','Integer'),
 ('noItemTypeImages','0',NULL,'If ON, disables item-type images','YesNo'),
 ('NotesBlacklist','',NULL,'List of notes fields that should not appear in the title notes/description separator of details','free'),
diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl
index e3fdbdf..d8e2e1c 100755
--- a/installer/data/mysql/updatedatabase.pl
+++ b/installer/data/mysql/updatedatabase.pl
@@ -7788,7 +7788,7 @@ if ( CheckVersion($DBversion) ) {
             explanation,
             type
         ) VALUES (
-            'NewPatronPrivacySetting',
+            'DefaultPatronPrivacySetting',
             'default',
             'default|never|forever',
             "Define the default borrower.privacy setting for new patrons, i.e. how long do we keep a patron's issue history. 1 = default, 2 = never, 0 = forever.",
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref
index e356490..bf38ee0 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref
@@ -141,7 +141,7 @@ Patrons:
          - enable the ability to upload and attach arbitrary files to a borrower record.
      -
          - New patrons should have a privacy setting of
-         - pref: NewPatronPrivacySetting
+         - pref: DefaultPatronPrivacySetting
            choices:
                default: default
                never: never
-- 
1.7.2.5