|
Lines 142-148
sub GetBorrowerAttributeValue {
Link Here
|
| 142 |
=cut |
142 |
=cut |
| 143 |
|
143 |
|
| 144 |
sub SearchIdMatchingAttribute{ |
144 |
sub SearchIdMatchingAttribute{ |
| 145 |
my $filter = shift; |
145 |
my ( $filter, $limit ) = @_; |
| 146 |
$filter = [$filter] unless ref $filter; |
146 |
$filter = [$filter] unless ref $filter; |
| 147 |
|
147 |
|
| 148 |
my $dbh = C4::Context->dbh(); |
148 |
my $dbh = C4::Context->dbh(); |
|
Lines 152-157
FROM borrower_attributes
Link Here
|
| 152 |
JOIN borrower_attribute_types USING (code) |
152 |
JOIN borrower_attribute_types USING (code) |
| 153 |
WHERE staff_searchable = 1 |
153 |
WHERE staff_searchable = 1 |
| 154 |
AND (} . join (" OR ", map "attribute like ?", @$filter) .qq{)}; |
154 |
AND (} . join (" OR ", map "attribute like ?", @$filter) .qq{)}; |
|
|
155 |
$query .= q{ LIMIT ?} if $limit; |
| 155 |
my $sth = $dbh->prepare_cached($query); |
156 |
my $sth = $dbh->prepare_cached($query); |
| 156 |
$sth->execute(map "%$_%", @$filter); |
157 |
$sth->execute(map "%$_%", @$filter); |
| 157 |
return [map $_->[0], @{ $sth->fetchall_arrayref }]; |
158 |
return [map $_->[0], @{ $sth->fetchall_arrayref }]; |