From: Jeff Godin Date: Mon, 21 May 2012 20:26:57 +0000 (-0400) Subject: Handle new-style licenses as patron barcodes X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=19cc64bc91d0779e630a625ba04ceab92e9756bf;p=evergreen%2Ftadl.git Handle new-style licenses as patron barcodes Handle new-style drivers licenses when used as patron barcodes by using the first 13 characters (lowercased) when the "raw" barcode is either 25 or 27 characters long. Previously we only handled 25 character barcodes. Signed-off-by: Jeff Godin --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm b/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm index abf100edd3..ca89650bd5 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm @@ -85,9 +85,10 @@ sub new { if ($patron_id =~ /^[A-Z].*/i) { syslog("LOG_WARNING", "Trying lowercased/transformed value for barcode: $patron_id"); my $bc = lc($patron_id); - if (length($bc) == 25) { + my $bclen = length($bc); + if ($bclen == 25 || $bclen == 27) { $bc = substr($bc, 0, 13); - } elsif (length($bc) == 23) { + } elsif ($bclen == 23) { $bc = substr($bc, 0, 12); } $card = $e->search_actor_card([{barcode => $bc, active => 't'}, $usr_flesh])->[0]; diff --git a/Open-ILS/xul/staff_client/server/patron/barcode_entry.xul b/Open-ILS/xul/staff_client/server/patron/barcode_entry.xul index f693059f3a..474b998eca 100644 --- a/Open-ILS/xul/staff_client/server/patron/barcode_entry.xul +++ b/Open-ILS/xul/staff_client/server/patron/barcode_entry.xul @@ -88,8 +88,10 @@ barcode = String( barcode ).replace( /\s+/g, '' ); if (!barcode) { sound.bad(); add_msg($("patronStrings").getString('staff.patron.barcode_entry.no_barcode')); tb.select(); tb.focus(); return; } - // MIEG: Michigan ID voodo - if (barcode.length == 25) { var bcode = barcode.substring(0,13); barcode = bcode.toLowerCase(); } + + if (barcode.length == 27 || barcode.length == 25) { + var bcode = barcode.substring(0,13); barcode = bcode.toLowerCase(); + } if (barcode.length == 23) { var bcode = barcode.substring(0,11); barcode = bcode.toLowerCase(); } JSAN.use('util.network'); var net = new util.network();