From fc9b8a7d969ede2fa886bc0cca847b37b1d5309a Mon Sep 17 00:00:00 2001 From: phasefx Date: Wed, 18 Feb 2009 22:03:52 +0000 Subject: [PATCH] re-arranging the horizantal patron display. Making DOB more easily hidable. Some I18N. The xul persist mechanism doesn't appear to work with madeup attributes; probably need an org unit setting for that behavior git-svn-id: svn://svn.open-ils.org/ILS/branches/staff-client-experiment@12224 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../server/locale/en-US/patron.properties | 4 ++++ Open-ILS/xul/staff_client/server/patron/summary.js | 27 ++++++++++++++++++---- .../server/patron/summary_overlay_horiz.xul | 11 ++++----- 3 files changed, 32 insertions(+), 10 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties b/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties index 385a63770f..a60b6412eb 100644 --- a/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties +++ b/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties @@ -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= +# The < and > highlight that the value is not set; translate Unset and change the delimiters as needed +staff.patron.field.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 diff --git a/Open-ILS/xul/staff_client/server/patron/summary.js b/Open-ILS/xul/staff_client/server/patron/summary.js index 5d212d275c..98a31b87dc 100644 --- a/Open-ILS/xul/staff_client/server/patron/summary.js +++ b/Open-ILS/xul/staff_client/server/patron/summary.js @@ -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) : - '' + 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) : - '' - ); + 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'); + } + } + } }; } ], diff --git a/Open-ILS/xul/staff_client/server/patron/summary_overlay_horiz.xul b/Open-ILS/xul/staff_client/server/patron/summary_overlay_horiz.xul index cde81ffa3e..2cfcf3fec5 100644 --- a/Open-ILS/xul/staff_client/server/patron/summary_overlay_horiz.xul +++ b/Open-ILS/xul/staff_client/server/patron/summary_overlay_horiz.xul @@ -16,7 +16,11 @@ - - - -- 2.11.0