re-arranging the horizantal patron display. Making DOB more easily hidable. Some...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 18 Feb 2009 22:03:52 +0000 (22:03 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 18 Feb 2009 22:03:52 +0000 (22:03 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/branches/staff-client-experiment@12224 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/locale/en-US/patron.properties
Open-ILS/xul/staff_client/server/patron/summary.js
Open-ILS/xul/staff_client/server/patron/summary_overlay_horiz.xul

index 385a637..a60b641 100644 (file)
@@ -273,6 +273,10 @@ staff.patron.usr_buckets.merge_records.fancy_prompt_title=Record Merging
 staff.patron.usr_buckets.merge_records.fancy_prompt.alert=Merge Aborted
 staff.patron.usr_buckets.merge_records.success=Records were successfully merged.
 staff.patron.usr_buckets.merge_records.catch.std_unex_error=Records were not likely merged.
+# The < and > highlight that the value is hidden from immediate display; translate Hidden and change the delimiters as needed
+staff.patron.field.hidden=<Hidden>
+# The < and > highlight that the value is not set; translate Unset and change the delimiters as needed
+staff.patron.field.unset=<Unset>
 
 web.staff.patron.ue.session_no_defined=User session is not defined
 web.staff.patron.ue.uedit_show_search.search_would_be=Search would be:\n%1$s
index 5d212d2..98a31b8 100644 (file)
@@ -365,7 +365,7 @@ patron.summary.prototype = {
                                                                        patronStrings.getString('staff.patron.summary.expires_on') + ' ' + (
                                                                                obj.patron.expire_date() ?
                                                                                obj.patron.expire_date().substr(0,10) :
-                                                                               '<Unset>'
+                                                                           patronStrings.getString('staff.patron.field.unset') 
                                                                        )
                                                                );
                                                        };
@@ -375,11 +375,30 @@ patron.summary.prototype = {
                                                ['render'],
                                                function(e) {
                                                        return function() { 
-                                                               e.setAttribute('value',
+                                var hide_value = e.getAttribute('hide_value');
+                                                               e.setAttribute( hide_value == 'true' ? 'hidden_value' : 'value',
                                                                        obj.patron.dob() ?
                                                                        obj.patron.dob().substr(0,10) :
-                                                                       '<Unset>'
-                                                               );
+                                    patronStrings.getString('staff.patron.field.unset') 
+                                                               );
+                                e.setAttribute( hide_value == 'false' ? 'hidden_value' : '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 (click_to_hide_dob == 'true') {
+                                        x.onclick = function() {
+                                            hide_value = e.getAttribute('hide_value');
+                                            e.setAttribute('hide_value', hide_value == 'true' ? 'false' : 'true'); 
+                                            var value = e.getAttribute('value');
+                                            var hidden_value = e.getAttribute('hidden_value');
+                                            e.setAttribute('value',hidden_value);
+                                            e.setAttribute('hidden_value',value);
+                                            alert('foo');
+                                        }
+                                    }
+                                }
                                                        };
                                                }
                                        ],
index cde81ff..2cfcf3f 100644 (file)
 <hbox id="patron_info_sidebar">
        <image id="patron_photo_url" />
        <vbox id="pisbvb2a" persist="width" flex="1">
-               <label id="patron_name" hidden="true" class="patronNameLarge"/>
+               <label id="patron_name" />
+               <hbox>
+                       <label id="PatronSummaryContact_date_of_birth_label" click_to_hide_dob="true" class="text_left dob label click_link" value="&staff.patron_display.date_of_birth.label;"/>
+                       <label id="patron_date_of_birth" class="dob value" hide_value="true" persist="hide_value"/><!-- FIXME: persist doesn't work for this -->
+               </hbox>
                <grid flex="1" style="border: solid thin">
                        <columns>
                                <column/>
                                <label id="patron_ident_value_2" class="ident ident_value ident2 value"/>
                        </vbox>
                </row>
-               <row id="pdsgr3">
-                       <label id="PatronSummaryContact_date_of_birth_label" class="text_left dob label"
-                               value="&staff.patron_display.date_of_birth.label;"/>
-                       <label id="patron_date_of_birth" class="dob value"/>
-               </row>
                <row id="pdsgr4"><label id="pdsgr4l" value=" "/></row>
        </rows>
 </grid>