Lines 88-99
sub search {
Link Here
|
88 |
foreach my $term (@terms) { |
88 |
foreach my $term (@terms) { |
89 |
next unless $term; |
89 |
next unless $term; |
90 |
|
90 |
|
|
|
91 |
my $termsearchfieldstype; |
92 |
|
91 |
my $term_dt = eval { local $SIG{__WARN__} = {}; output_pref( { str => $term, dateonly => 1, dateformat => 'sql' } ); }; |
93 |
my $term_dt = eval { local $SIG{__WARN__} = {}; output_pref( { str => $term, dateonly => 1, dateformat => 'sql' } ); }; |
92 |
|
94 |
|
93 |
if ($term_dt) { |
95 |
if ($term_dt) { |
94 |
$searchfieldstype = 'dateofbirth'; |
96 |
$termsearchfieldstype = 'dateofbirth'; |
95 |
$term = $term_dt; |
97 |
$term = $term_dt; |
96 |
} else { |
98 |
} else { |
|
|
99 |
$termsearchfieldstype = $searchfieldstype; |
97 |
$term .= '%' # end with anything |
100 |
$term .= '%' # end with anything |
98 |
if $term !~ /%$/; |
101 |
if $term !~ /%$/; |
99 |
$term = "%$term" # begin with anythin unless start_with |
102 |
$term = "%$term" # begin with anythin unless start_with |
Lines 101-107
sub search {
Link Here
|
101 |
} |
104 |
} |
102 |
|
105 |
|
103 |
my @where_strs_or; |
106 |
my @where_strs_or; |
104 |
for my $searchfield ( split /,/, $searchfields->{$searchfieldstype} ) { |
107 |
for my $searchfield ( split /,/, $searchfields->{$termsearchfieldstype} ) { |
105 |
push @where_strs_or, "borrowers." . $dbh->quote_identifier($searchfield) . " LIKE ?"; |
108 |
push @where_strs_or, "borrowers." . $dbh->quote_identifier($searchfield) . " LIKE ?"; |
106 |
push @where_args, $term; |
109 |
push @where_args, $term; |
107 |
} |
110 |
} |