[open-ils-commits] r11810 - trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Jan 12 20:10:47 EST 2009
Author: miker
Date: 2009-01-12 20:10:46 -0500 (Mon, 12 Jan 2009)
New Revision: 11810
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/actor.pm
Log:
add left-anchored actor.card.barcode restriction to user "crazy" search
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/actor.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/actor.pm 2009-01-13 01:03:57 UTC (rev 11809)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/actor.pm 2009-01-13 01:10:46 UTC (rev 11810)
@@ -482,6 +482,7 @@
# group 0 = user
# group 1 = address
# group 2 = phone, ident
+ # group 3 = barcode
my $usr = join ' AND ', map { "LOWER($_) ~ ?" } grep { ''.$$search{$_}{group} eq '0' } keys %$search;
my @usrv = map { "^$$search{$_}{value}" } grep { ''.$$search{$_}{group} eq '0' } keys %$search;
@@ -492,7 +493,14 @@
my $pv = $$search{phone}{value};
my $iv = $$search{ident}{value};
my $nv = $$search{name}{value};
+ my $cv = $$search{card}{value};
+ my $card = '';
+ if ($cv) {
+ $card = 'JOIN (SELECT DISTINCT usr FROM actor.card WHERE barcode LIKE ?||\'%\') AS card ON (card.usr = users.id)';
+ unshift(@usrv, $cv);
+ }
+
my $phone = '';
my @ps;
my @phonev;
@@ -579,7 +587,7 @@
$select = <<" SQL";
SELECT DISTINCT $distinct_list
- FROM $u_table AS users
+ FROM $u_table AS users $card
JOIN ($select) AS search ON (search.id = users.id)
JOIN $descendants d ON (d.id = users.home_ou)
$opt_in_join
More information about the open-ils-commits
mailing list