|
Lines 63-71
sub search {
Link Here
|
| 63 |
push @args, "%$shelfname%"; |
63 |
push @args, "%$shelfname%"; |
| 64 |
} |
64 |
} |
| 65 |
if ( defined $owner and $owner ne '' ) { |
65 |
if ( defined $owner and $owner ne '' ) { |
| 66 |
push @where_strs, '( bo.firstname LIKE ? OR bo.surname LIKE ? )'; |
66 |
my @name_parts = split ' ', $owner; |
| 67 |
push @args, "%$owner%", "%$owner%"; |
67 |
|
|
|
68 |
if ( @name_parts == 2 ) { |
| 69 |
push @where_strs, '( bo.firstname LIKE ? AND bo.surname LIKE ? )'; |
| 70 |
push @args, "%$name_parts[0]%", "%$name_parts[1]%"; |
| 71 |
|
| 72 |
} else { |
| 73 |
|
| 74 |
push @where_strs, '(bo.firstname LIKE ? OR bo.surname LIKE ?)'; |
| 75 |
push @args, "%$owner%", "%$owner%"; |
| 76 |
} |
| 68 |
} |
77 |
} |
|
|
78 |
|
| 69 |
if ( defined $sortby and $sortby ne '' ) { |
79 |
if ( defined $sortby and $sortby ne '' ) { |
| 70 |
push @where_strs, 'sortfield = ?'; |
80 |
push @where_strs, 'sortfield = ?'; |
| 71 |
push @args, $sortby; |
81 |
push @args, $sortby; |
| 72 |
- |
|
|