Branchify Doug Kyle's patch to Launchpad bug 874603. collab/dyrcona/lp874603_2_1
authorDoug Kyle <dkyle@grpl.org>
Fri, 14 Oct 2011 20:57:32 +0000 (16:57 -0400)
committerJason Stephenson <jstephenson@mvlc.org>
Fri, 14 Oct 2011 20:57:32 +0000 (16:57 -0400)
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/actor.pm

index 1cb3dce..d3cb16e 100644 (file)
@@ -671,7 +671,11 @@ sub patron_search {
 
        my $card = '';
        if ($cv) {
-           $card = 'JOIN (SELECT DISTINCT usr FROM actor.card WHERE evergreen.lowercase(barcode) LIKE ?||\'%\') AS card ON (card.usr = users.id)';
+                if ( $cv =~ /[A-Za-z]/) {
+                        $card = 'JOIN (SELECT DISTINCT usr FROM actor.card WHERE evergreen.lowercase(barcode) LIKE ?||\'%\') AS card ON (card.usr = users.id)';
+                } else {
+                        $card = 'JOIN (SELECT DISTINCT usr FROM actor.card WHERE barcode LIKE ?||\'%\') AS card ON (card.usr = users.id)';
+                }
            unshift(@usrv, $cv);
        }