Remove display of patron birthdate, internet access level, etc rel_2_12_mergery_clean
authorDan Scott <dan@coffeecode.net>
Mon, 30 May 2011 17:14:29 +0000 (13:14 -0400)
committerDan Scott <dscott@laurentian.ca>
Fri, 20 Apr 2018 16:41:57 +0000 (12:41 -0400)
These fields in the staff client are either not applicable or
potentially privacy-invasive or both. If the data somehow does
get into the system, we don't want it to show up on the staff
client anyway - and we don't want annoying warnings about unset
dates of birth, etc.

This is the hardcore way of doing things, we really should make
it yet another configuration setting. Oh well.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Open-ILS/xul/staff_client/server/patron/summary.js
Open-ILS/xul/staff_client/server/patron/summary_overlay.xul
Open-ILS/xul/staff_client/server/patron/util.js

index cb23327..40bd108 100644 (file)
@@ -246,14 +246,7 @@ patron.summary.prototype = {
                     'patron_net_access' : [
                         ['render'],
                         function(e) {
-                            return function() { 
-                                util.widgets.set_text(e,
-                                    patronStrings.getString('staff.patron.summary.patron_net_access') + 
-                                    ' ' + obj.OpenILS.data.hash.cnal[
-                                        obj.patron.net_access_level()
-                                    ].name()
-                                );
-                            };
+                            // not applicable to Conifer
                         }
                     ],
                     'patron_credit' : [
@@ -634,46 +627,7 @@ patron.summary.prototype = {
                     'patron_date_of_birth' : [
                         ['render'],
                         function(e) {
-                            return function() { 
-                                var hide_value = e.getAttribute('hide_value');
-                                if ( obscure_dob && hide_value == 'true' ) {
-                                    e.setAttribute( 'hidden_value',
-                                        obj.patron.dob() ?
-                                        util.date.formatted_date( obj.patron.dob(), '%{localized_date}' ) :
-                                        patronStrings.getString('staff.patron.field.unset') 
-                                    );
-                                    util.widgets.set_text(e,
-                                        patronStrings.getString('staff.patron.field.hidden') 
-                                    );
-                                } else {
-                                    util.widgets.set_text(e,
-                                        obj.patron.dob() ?
-                                        util.date.formatted_date( obj.patron.dob(), '%{localized_date}' ) :
-                                        patronStrings.getString('staff.patron.field.unset') 
-                                    );
-                                    e.setAttribute( 'hidden_value',
-                                        patronStrings.getString('staff.patron.field.hidden') 
-                                    );
-                                }
-                                var x = document.getElementById('PatronSummaryContact_date_of_birth_label');
-                                if (x) {
-                                    var click_to_hide_dob = x.getAttribute('click_to_hide_dob');
-                                    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'); 
-                                            var value = util.widgets.get_text(e);
-                                            var hidden_value = e.getAttribute('hidden_value');
-                                            util.widgets.set_text(e,hidden_value);
-                                            e.setAttribute('hidden_value',value);
-                                        }
-                                    }
-                                }
-                            };
+                            // not applicable to Conifer
                         }
                     ],
                     'patron_day_phone' : [
index 4496594..adffa1e 100644 (file)
@@ -41,9 +41,6 @@
         <row id="pdsgr5">
             <description id="patron_library" class="copyable homelib value"/>
         </row>
-        <row id="pdsgr5a">
-            <description id="patron_net_access" class="copyable net_access value"/>
-        </row>
         <row id="pdsgr5aab">
             <description id="patron_account_create_date" class="copyable create_date value"/>
         </row>
             <label id="PatronSummaryContact_hold_alias_label" class="copyable text_left" value="&staff.patron_display.hold_alias.label;"/>
             <description id="patron_hold_alias" class="copyable hold_alias value" />
         </row>
-        <row id="pdsgr3">
-            <label id="PatronSummaryContact_date_of_birth_label" click_to_hide_dob="true" class="copyable text_left dob label click_link" value="&staff.patron_display.date_of_birth.label;"/>
-            <description id="patron_date_of_birth" class="copyable dob value" hide_value="true" oils_persist="hide_value"/>
-        </row>
         <row id="pdsgr4"><label id="pdsgr4l" value=" "/></row>
     </rows>
 </grid>
index d77b3de..d29af87 100644 (file)
@@ -799,8 +799,6 @@ patron.util.set_penalty_css = function(patron) {
             addCSSClass(document.documentElement,'PATRON_INACTIVE');
         }
 
-        try { addCSSClass(document.documentElement,'PATRON_NET_ACCESS_' + patron.net_access_level()); } catch(E) {}
-
         var now = new Date();
         now = now.getTime()/1000;
 
@@ -813,40 +811,6 @@ patron.util.set_penalty_css = function(patron) {
 
         if (expire < now) addCSSClass(document.documentElement,'PATRON_EXPIRED');
 
-        if (patron.dob()) {
-            var age_parts = patron.dob().substr(0,10).split('-');
-            age_parts[1] = age_parts[1] - 1;
-
-            var born = new Date();
-            born.setFullYear(age_parts[0], age_parts[1], age_parts[2]);
-            born = born.getTime()/1000
-
-            var patron_age = now - born;
-            var years_old = Number(patron_age / TIME.year);
-
-            addCSSClass(document.documentElement,'PATRON_AGE_IS_' + years_old);
-
-            if ( years_old >= 65 ) addCSSClass(document.documentElement,'PATRON_AGE_GE_65');
-            if ( years_old < 65 )  addCSSClass(document.documentElement,'PATRON_AGE_LT_65');
-        
-            if ( years_old >= 24 ) addCSSClass(document.documentElement,'PATRON_AGE_GE_24');
-            if ( years_old < 24 )  addCSSClass(document.documentElement,'PATRON_AGE_LT_24');
-            
-            if ( years_old >= 21 ) addCSSClass(document.documentElement,'PATRON_AGE_GE_21');
-            if ( years_old < 21 )  addCSSClass(document.documentElement,'PATRON_AGE_LT_21');
-        
-            if ( years_old >= 18 ) addCSSClass(document.documentElement,'PATRON_AGE_GE_18');
-            if ( years_old < 18 )  addCSSClass(document.documentElement,'PATRON_AGE_LT_18');
-        
-            if ( years_old >= 13 ) addCSSClass(document.documentElement,'PATRON_AGE_GE_13');
-            if ( years_old < 13 )  addCSSClass(document.documentElement,'PATRON_AGE_LT_13');
-        } else {
-            addCSSClass(document.documentElement,'PATRON_HAS_INVALID_DOB');
-        }
-
-        if ( get_bool( patron.juvenile() ) ) addCSSClass(document.documentElement,'PATRON_JUVENILE');
-        else removeCSSClass(document.documentElement,'PATRON_JUVENILE');
-
         if (patron.mailing_address() && typeof patron.mailing_address() == 'object') {
             if (!get_bool(patron.mailing_address().valid())) {
                 addCSSClass(document.documentElement,'PATRON_HAS_INVALID_ADDRESS');