Bugzilla – Attachment 19132 Details for
Bug 6254
Set default for privacy by patron category
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 6254 - can't set patron privacy by default
Bug-6254---cant-set-patron-privacy-by-default.patch (text/plain), 4.72 KB, created by
Kyle M Hall (khall)
on 2013-06-18 16:28:34 UTC
(
hide
)
Description:
Bug 6254 - can't set patron privacy by default
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-06-18 16:28:34 UTC
Size:
4.72 KB
patch
obsolete
>From 65bae3aeba9ecc3be82b06fbbd34282ba6621b47 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 18 Jun 2013 11:50:13 -0400 >Subject: [PATCH] Bug 6254 - can't set patron privacy by default > >There is currently no way to set the privacy setting for newly created >patrons. This patch adds the system preference NewPatronPrivacySetting >to define what privacy setting new patrons should have. > >Test Plan: >1) Apply this patch >2) Run updatedatabase.pl >3) Create a new patron >4) Verify the patron's privacy is set to 1 >5) Set NewPatronPrivacySetting to "never" >6) Create a new patron >7) Verify the patron's privacy is set to 2 >8) Set NewPatronPrivacySetting to "forever" >9) Create a new patron >10) Verify the patron's privacy is set to 0 >--- > C4/Members.pm | 6 +++++ > installer/data/mysql/sysprefs.sql | 1 + > installer/data/mysql/updatedatabase.pl | 21 ++++++++++++++++++++ > .../prog/en/modules/admin/preferences/patrons.pref | 7 ++++++ > 4 files changed, 35 insertions(+), 0 deletions(-) > >diff --git a/C4/Members.pm b/C4/Members.pm >index 3221f53..8b8e86b 100644 >--- a/C4/Members.pm >+++ b/C4/Members.pm >@@ -770,6 +770,12 @@ sub AddMember { > $data{'password'} = ($data{'password'})? md5_base64($data{'password'}) : '!'; > $data{'borrowernumber'}=InsertInTable("borrowers",\%data); > >+ my $NewPatronPrivacySetting = C4::Context->preference('NewPatronPrivacySetting'); >+ $data{'privacy'} = >+ $NewPatronPrivacySetting eq 'default' ? 1 >+ : $NewPatronPrivacySetting eq 'never' ? 2 >+ : $NewPatronPrivacySetting eq 'forever' ? 0 >+ : undef; > > # mysql_insertid is probably bad. not necessarily accurate and mysql-specific at best. > logaction("MEMBERS", "CREATE", $data{'borrowernumber'}, "") if C4::Context->preference("BorrowersLog"); >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index fbd0387..0c74919 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -427,3 +427,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' > INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('UseCourseReserves', '0', 'Enable the course reserves feature.', NULL, 'YesNo'); > INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacHoldNotes',0,'Show hold notes on OPAC','','YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('CalculateFinesOnReturn','1','Switch to control if overdue fines are calculated on return or not', '', 'YesNo'); >+INSERT INTO systempreferences ( variable, value, options, explanation, type ) VALUES ( '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' ); >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 5963d24..b3d0854 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -7010,6 +7010,27 @@ CREATE TABLE IF NOT EXISTS borrower_files ( > SetVersion($DBversion); > } > >+$DBversion = "3.13.00.XXX"; >+if ( CheckVersion($DBversion) ) { >+ $dbh->do(q{ >+ INSERT INTO systempreferences ( >+ variable, >+ value, >+ options, >+ explanation, >+ type >+ ) VALUES ( >+ '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' >+ ) >+ }); >+ print "Upgrade to $DBversion done (Bug 6254 - can't set patron privacy by default)\n"; >+ SetVersion($DBversion); >+} >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >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 74d14af..d781a2b 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 >@@ -139,3 +139,10 @@ Patrons: > yes: Do > no: "Don't" > - enable the ability to upload and attach arbitrary files to a borrower record. >+ - >+ - New patrons should have a privacy setting of >+ - pref: NewPatronPrivacySetting >+ choices: >+ default: default >+ never: never >+ forever: forever >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 6254
:
19131
|
19132
|
19133
|
19272
|
19631
|
23309
|
23310
|
23317
|
23516
|
23520
|
23983
|
23985
|
23986
|
23987
|
24606
|
24696
|
24697
|
24698
|
24699
|
28033
|
28034
|
28035
|
28036