KMIG-53 : KCLSUPGRAD-28 : Patron search by record number missing
authorBill Erickson <berickxx@gmail.com>
Wed, 29 Oct 2014 21:05:33 +0000 (17:05 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
    Cross-port: 518726b

Conflicts:
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/actor.pm

Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/actor.pm
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_horiz_overlay.xul
Open-ILS/xul/staff_client/server/patron/search_form_overlay.xul
Open-ILS/xul/staff_client/server/patron/search_result.js

index 0c1f0a5..efea242 100644 (file)
@@ -757,6 +757,7 @@ sub patron_search {
     my $iv = _clean_regex_chars($$search{ident}{value});
     my $nv = _clean_regex_chars($$search{name}{value});
     my $cv = _clean_regex_chars($$search{card}{value});
+    my $egv = _clean_regex_chars($$search{egid}{value});
 
     my $card = '';
     if ($cv) {
@@ -764,6 +765,15 @@ sub patron_search {
         unshift(@usrv, $cv);
     }
 
+    # for Evergreen usr id search
+    my $egid = '';
+    $_ = $egv;
+    if (m/\D/) {
+        $egid = ' AND FALSE';
+    } elsif ($egv) {
+        $egid = ' AND users.id = ' . $egv;
+    }
+
     my $phone = '';
     my @ps;
     my @phonev;
@@ -894,6 +904,7 @@ sub patron_search {
           WHERE users.deleted = FALSE
             $inactive
             $opt_in_where
+            $egid
           GROUP BY $group_list
           ORDER BY $order_by
           LIMIT $limit
index ef72fec..42240bc 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.egid.accesskey 'E'>
+<!ENTITY staff.patron_search_form.egid.label 'Evergreen User ID:'>
 <!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 000e700..48b3b16 100644 (file)
@@ -127,6 +127,19 @@ patron.search_form.prototype = {
                             };
                         }
                     ],
+                    'egid' : [
+                        ['render'],
+                        function(e) {
+                            return function() {
+                                if (params.query&&params.query.egid) {
+                                    e.setAttribute('value',params.query.egid);
+                                    e.value = params.query.egid;
+                                } else {
+                                    e.value = '';
+                                }
+                            };
+                        }
+                    ],
                     'email' : [
                         ['render'],
                         function(e) {
@@ -372,7 +385,7 @@ patron.search_form.prototype = {
                     if (id == 'search_depth') {
                         query[id] = node.firstChild.getAttribute('value'); 
                     } else {
-                         var value = node.value.replace(/^\s+/,'').replace(/[\\\s]+$/,'');
+                        var value = node.value.replace(/^\s+/,'').replace(/[\\\s]+$/,'');
                         //value = value.replace(/\d/g,'');
                         switch(id) {
                             case 'family_name' :
index 318eff9..55f6c6c 100644 (file)
                 value="&staff.patron_search_form.post_code.label;" 
                 accesskey="&staff.patron_search_form.post_code.accesskey;"/>
             <textbox id="post_code" group="1" context="clipboard" tabindex="8"/>
+            <spacer flex="1"/>
+            <spacer flex="1"/>
+            <label id="psl6d" control="egid"
+                value="&staff.patron_search_form.egid.label;"
+                accesskey="&staff.patron_search_form.egid.accesskey;"/>
+            <textbox id="egid" group="0" context="clipboard" tabindex="16"/>
         </row>
     </rows>
 </grid>
index 660b75a..56e617b 100644 (file)
                 accesskey="&staff.patron_search_form.card.accesskey;"/>
             <textbox id="card" group="0" context="clipboard"/>
         </row>
+        <row id="psr6d">
+            <label id="psl6d" control="egid"
+                value="&staff.patron_search_form.egid.label;"
+                accesskey="&staff.patron_search_form.egid.accesskey;"/>
+            <textbox id="egid" group="0" context="clipboard"/>
+        </row>
         <row id="psr6a">
             <label id="psl6a" value=" "/>
         </row>
index 4e95573..7539804 100644 (file)
@@ -210,6 +210,13 @@ patron.search_result.prototype = {
                     obj.search_term_count++;
                 break;
 
+                case 'egid':
+                    search_hash[ i ] = {};
+                    search_hash[ i ].value = query[i];
+                    search_hash[i].group = 4;
+                    obj.search_term_count++;
+                break;
+
                 case 'phone': case 'ident': 
                 
                     search_hash[ i ] = {};