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 <mrpeters@library.in.gov>
<!ENTITY staff.patron_search_form.usrname.label 'OPAC Login:'>
<!ENTITY staff.patron_search_form.card.accesskey 'B'>
<!ENTITY staff.patron_search_form.card.label 'Barcode:'>
+<!ENTITY staff.patron_search_form.card.accesskey 'D'>
+<!ENTITY staff.patron_search_form.card.label 'Date of Birth (YYYY-MM-DD):'>
<!ENTITY staff.patron_search_form.phone.accesskey 'P'>
<!ENTITY staff.patron_search_form.phone.label 'Phone:'>
<!ENTITY staff.patron_search_form.post_code.accesskey ''>
};
}
],
+ '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) {
accesskey="&staff.patron_search_form.card.accesskey;"/>
<textbox id="card" group="0" context="clipboard"/>
</row>
+ <row id="psr6d">
+ <label id="psl6d" control="dob"
+ value="&staff.patron_search_form.dob.label;"
+ accesskey="&staff.patron_search_form.dob.accesskey;"/>
+ <textbox id="dob" group="0" context="clipboard"/>
+ </row>
<row id="psr6a">
<label id="psl6a" value=" "/>
</row>
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];