[open-ils-commits] r14143 - in trunk/Open-ILS: src/sql/Pg src/sql/Pg/upgrade xul/staff_client/server/patron (phasefx)

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Sep 24 02:25:19 EDT 2009


Author: phasefx
Date: 2009-09-24 02:25:15 -0400 (Thu, 24 Sep 2009)
New Revision: 14143

Added:
   trunk/Open-ILS/src/sql/Pg/upgrade/0020.org-setting-obscure-dob.sql
Modified:
   trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
   trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql
   trunk/Open-ILS/xul/staff_client/server/patron/info_group.xul
   trunk/Open-ILS/xul/staff_client/server/patron/search_result.js
   trunk/Open-ILS/xul/staff_client/server/patron/summary.js
Log:
Org unit setting for whether to obscure the Date of Birth field.

If true, this will set the column visibility for Date of Birth in patron lists to false by default (though a Saved Columns state can specify otherwise), and it will also obscure the value in the patron summary sidebar, making it 
say <Hidden> unless the field label is clicked.



Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql	2009-09-24 05:59:27 UTC (rev 14142)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql	2009-09-24 06:25:15 UTC (rev 14143)
@@ -51,7 +51,7 @@
     install_date    TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
 );
 
-INSERT INTO config.upgrade_log (version) VALUES ('0019'); -- mck9
+INSERT INTO config.upgrade_log (version) VALUES ('0020'); -- phasefx
 
 CREATE TABLE config.bib_source (
 	id		SERIAL	PRIMARY KEY,

Modified: trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql	2009-09-24 05:59:27 UTC (rev 14142)
+++ trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql	2009-09-24 06:25:15 UTC (rev 14143)
@@ -1825,8 +1825,13 @@
 ( 'circ.max_patron_claim_return_count',
     'Max Patron Claims Returned Count',
     'When this count is exceeded, a staff override is required to mark the item as claims returned',
-    'integer' );
+    'integer' ),
 
+( 'circ.obscure_dob',
+    'Obscure the Date of Birth field',
+    'When true, the Date of Birth column in patron lists will default to Not Visible, and in the Patron Summary sidebar the value will display as <Hidden> unless the field label is clicked.',
+    'bool' );
+
 -- Org_unit_setting_type(s) that need an fm_class:
 INSERT into config.org_unit_setting_type
 ( name, label, description, datatype, fm_class ) VALUES

Added: trunk/Open-ILS/src/sql/Pg/upgrade/0020.org-setting-obscure-dob.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0020.org-setting-obscure-dob.sql	                        (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0020.org-setting-obscure-dob.sql	2009-09-24 06:25:15 UTC (rev 14143)
@@ -0,0 +1,13 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0020');
+
+INSERT INTO config.org_unit_setting_type (name, label, description, datatype) VALUES (
+    'circ.obscure_dob',
+    'Obscure the Date of Birth field',
+    'When true, the Date of Birth column in patron lists will default to Not Visible, and in the Patron Summary sidebar the value will display as <Hidden> unless the field label is clicked.',
+    'bool'
+);
+
+COMMIT;
+

Modified: trunk/Open-ILS/xul/staff_client/server/patron/info_group.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/info_group.xul	2009-09-24 05:59:27 UTC (rev 14142)
+++ trunk/Open-ILS/xul/staff_client/server/patron/info_group.xul	2009-09-24 06:25:15 UTC (rev 14143)
@@ -64,6 +64,7 @@
 		function tree_init() {
 				JSAN.use('OpenILS.data'); g.OpenILS = {}; 
 				g.OpenILS.data = new OpenILS.data(); g.OpenILS.data.init({'via':'stash'});
+                var obscure_dob = String( g.OpenILS.data.hash.aous['circ.obscure_dob'] ) == 'true';
 
 				JSAN.use('util.list'); g.list = new util.list('patron_list');
 
@@ -75,7 +76,7 @@
 						'family_name' : { 'hidden' : 'false' },
 						'first_given_name' : { 'hidden' : 'false' },
 						'second_given_name' : { 'hidden' : 'false' },
-						'dob' : { 'hidden' : 'false' },
+						'dob' : { 'hidden' : obscure_dob },
 						'master_account' : { 'hidden' : 'false' },
 					}
 				);

Modified: trunk/Open-ILS/xul/staff_client/server/patron/search_result.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/search_result.js	2009-09-24 05:59:27 UTC (rev 14142)
+++ trunk/Open-ILS/xul/staff_client/server/patron/search_result.js	2009-09-24 06:25:15 UTC (rev 14143)
@@ -24,6 +24,7 @@
 
 		JSAN.use('OpenILS.data'); this.OpenILS = {}; 
 		obj.OpenILS.data = new OpenILS.data(); obj.OpenILS.data.init({'via':'stash'});
+        var obscure_dob = String( obj.OpenILS.data.hash.aous['circ.obscure_dob'] ) == 'true';
 
 		JSAN.use('util.list'); obj.list = new util.list('patron_list');
 
@@ -35,7 +36,7 @@
 				'family_name' : { 'hidden' : 'false' },
 				'first_given_name' : { 'hidden' : 'false' },
 				'second_given_name' : { 'hidden' : 'false' },
-				'dob' : { 'hidden' : 'false' }
+				'dob' : { 'hidden' : obscure_dob }
 			},
 			{
 				'except_these' : [

Modified: trunk/Open-ILS/xul/staff_client/server/patron/summary.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/summary.js	2009-09-24 05:59:27 UTC (rev 14142)
+++ trunk/Open-ILS/xul/staff_client/server/patron/summary.js	2009-09-24 06:25:15 UTC (rev 14143)
@@ -28,6 +28,7 @@
 
 		JSAN.use('OpenILS.data'); this.OpenILS = {}; 
 		obj.OpenILS.data = new OpenILS.data(); obj.OpenILS.data.init({'via':'stash'});
+        var obscure_dob = String( obj.OpenILS.data.hash.aous['circ.obscure_dob'] ) == 'true';
 
 		JSAN.use('util.controller'); obj.controller = new util.controller();
 		obj.controller.init(
@@ -318,7 +319,7 @@
 						function(e) {
 							return function() { 
                                 var hide_value = e.getAttribute('hide_value');
-                                if ( hide_value == 'true' ) {
+                                if ( obscure_dob && hide_value == 'true' ) {
                                     e.setAttribute( 'hidden_value',
                                         obj.patron.dob() ?
                                         obj.patron.dob().substr(0,10) :
@@ -340,7 +341,11 @@
                                 var x = document.getElementById('PatronSummaryContact_date_of_birth_label');
                                 if (x) {
                                     var click_to_hide_dob = x.getAttribute('click_to_hide_dob');
-                                    if (click_to_hide_dob == 'true') {
+                                    if (!obscure_dob || click_to_hide_dob != 'true') {
+                                        removeCSSClass(x,'click_link');
+                                    } 
+                                    if (obscure_dob && click_to_hide_dob == 'true') {
+                                        addCSSClass(x,'click_link');
                                         x.onclick = function() {
                                             hide_value = e.getAttribute('hide_value');
                                             e.setAttribute('hide_value', hide_value == 'true' ? 'false' : 'true'); 



More information about the open-ils-commits mailing list