Add a rudimentary 'Date of Birth' search box in Patron Search interface. user/mrpeters-isl/patron_dob_search
authorMichael Peters <mrpeters@library.in.gov>
Mon, 26 Sep 2011 19:13:07 +0000 (15:13 -0400)
committerMichael Peters <mrpeters@library.in.gov>
Mon, 26 Sep 2011 19:13:07 +0000 (15:13 -0400)
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>
Open-ILS/web/opac/locale/en-US/lang.dtd
Open-ILS/xul/staff_client/server/patron/search_form.js
Open-ILS/xul/staff_client/server/patron/search_form_overlay.xul
Open-ILS/xul/staff_client/server/patron/search_result.js

index 69dba21..a2e6daf 100644 (file)
 <!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 ''>
index 7f58952..887ee65 100644 (file)
@@ -122,6 +122,19 @@ patron.search_form.prototype = {
                             };
                         }
                     ],
+                    'dob' : [
+                        ['render'],
+                        function(e) {
+                            return function() {
+                                if (params.query&&params.query.dob) {
+                                    e.setAttribute('value',params.query.dob);
+                                    e.value = params.query.dob;
+                                } else {
+                                    e.value = '';
+                                }
+                            };
+                        }
+                    ],
                     'email' : [
                         ['render'],
                         function(e) {
index 660b75a..b237a82 100644 (file)
                 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>
index 6d71bd5..a284f89 100644 (file)
@@ -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];