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.
git-svn-id: svn://svn.open-ils.org/ILS/trunk@14143
dcc99617-32d9-48b4-a31d-
7c20da2025e4
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,
( '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
--- /dev/null
+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;
+
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');
'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' },
}
);
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');
'family_name' : { 'hidden' : 'false' },
'first_given_name' : { 'hidden' : 'false' },
'second_given_name' : { 'hidden' : 'false' },
- 'dob' : { 'hidden' : 'false' }
+ 'dob' : { 'hidden' : obscure_dob }
},
{
'except_these' : [
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(
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) :
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');