From d8edd2e7249830eecaaacdb790c5586e392bcb5b Mon Sep 17 00:00:00 2001 From: miker Date: Wed, 26 Jul 2006 19:46:29 +0000 Subject: [PATCH] ignoring inactive (by default) and deleted users git-svn-id: svn://svn.open-ils.org/ILS/trunk@5114 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../Application/Storage/Publisher/actor.pm | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/actor.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/actor.pm index 6c3fc24a9f..58ede06bba 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/actor.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/actor.pm @@ -227,6 +227,7 @@ sub patron_search { my $search = shift; my $limit = shift || 1000; my $sort = shift; + my $inactive = shift; $sort = ['family_name','first_given_name'] unless ($$sort[0]); # group 0 = user @@ -300,8 +301,22 @@ sub patron_search { } my $order_by = join ', ', map { 'users.'. $_} @$sort; - - $select = "SELECT users.id FROM $u_table AS users JOIN ($select) AS search USING (id) ORDER BY $order_by LIMIT $limit"; + + if ($inactive) { + $inactive = 'AND user.active = FALSE'; + } else { + $inactive = ''; + } + + $select = <<" SQL"; + SELECT users.id + FROM $u_table AS users + JOIN ($select) AS search + USING (id) + WHERE users.deleted = FALSE $inactive + ORDER BY $order_by + LIMIT $limit + SQL return actor::user->db_Main->selectcol_arrayref($select, {}, map {lc($_)} (@usrv,@phonev,@identv,@namev,@addrv)); } -- 2.43.2