From: Michael Peters Date: Mon, 26 Sep 2011 19:13:07 +0000 (-0400) Subject: Add a rudimentary 'Date of Birth' search box in Patron Search interface. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuser%2Fmrpeters-isl%2Fpatron_dob_search;p=working%2FEvergreen.git Add a rudimentary 'Date of Birth' search box in Patron Search interface. This is a rudimentary way of adding the ability to filter patrons based on their DOB. The tricky part, however, is that just simply tries to match the dob timestamp passed from the database. Therefore, all searches must be in YYYY-MM-DD format. Partial searches will only work when they begin with a year (for example, YYYY-MM) in the string. Signed-off-by: Michael Peters --- diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index 69dba21fc1..a2e6daffcd 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -1617,6 +1617,8 @@ + + diff --git a/Open-ILS/xul/staff_client/server/patron/search_form.js b/Open-ILS/xul/staff_client/server/patron/search_form.js index 7f589522c6..887ee65296 100644 --- a/Open-ILS/xul/staff_client/server/patron/search_form.js +++ b/Open-ILS/xul/staff_client/server/patron/search_form.js @@ -122,6 +122,19 @@ patron.search_form.prototype = { }; } ], + 'dob' : [ + ['render'], + function(e) { + return function() { + if (params.query&¶ms.query.dob) { + e.setAttribute('value',params.query.dob); + e.value = params.query.dob; + } else { + e.value = ''; + } + }; + } + ], 'email' : [ ['render'], function(e) { diff --git a/Open-ILS/xul/staff_client/server/patron/search_form_overlay.xul b/Open-ILS/xul/staff_client/server/patron/search_form_overlay.xul index 660b75ad01..b237a82382 100644 --- a/Open-ILS/xul/staff_client/server/patron/search_form_overlay.xul +++ b/Open-ILS/xul/staff_client/server/patron/search_form_overlay.xul @@ -92,6 +92,12 @@ accesskey="&staff.patron_search_form.card.accesskey;"/> + + diff --git a/Open-ILS/xul/staff_client/server/patron/search_result.js b/Open-ILS/xul/staff_client/server/patron/search_result.js index 6d71bd50b2..a284f89761 100644 --- a/Open-ILS/xul/staff_client/server/patron/search_result.js +++ b/Open-ILS/xul/staff_client/server/patron/search_result.js @@ -198,7 +198,7 @@ patron.search_result.prototype = { obj.search_term_count++; break; - case 'family_name': case 'first_given_name': case 'second_given_name': case 'email': case 'alias': case 'usrname': case 'profile': + case 'family_name': case 'first_given_name': case 'second_given_name': case 'email': case 'alias': case 'usrname': case 'profile': case 'dob': search_hash[ i ] = {}; search_hash[ i ].value = query[i];