@@ -, +, @@
fund
---
C4/Suggestions.pm | 15 +++---
.../prog/en/modules/suggestion/suggestion.tt | 9 +++-
t/db_dependent/Suggestions.t | 56 ++++++++++++++++++++--
3 files changed, 68 insertions(+), 12 deletions(-)
--- a/C4/Suggestions.pm
+++ a/C4/Suggestions.pm
@@ -159,15 +159,18 @@ sub SearchSuggestion {
)
{
if ( exists $suggestion->{$field} ) {
- if ( defined $suggestion->{$field} and $suggestion->{$field} ne '' )
+ if ( not defined $suggestion->{$field}
+ or $suggestion->{$field} eq '__ANY__'
+ or $suggestion->{$field} eq q|| )
{
- push @sql_params, $suggestion->{$field};
- push @query, qq{ AND suggestions.$field=? };
+ # No filter on this field
+ next;
+ } elsif ( $suggestion->{$field} eq '__NONE__' ) {
+ push @query, qq{ AND (suggestions.$field = '' OR suggestions.$field IS NULL) };
}
else {
- push @query, qq{
- AND (suggestions.$field='' OR suggestions.$field IS NULL)
- };
+ push @sql_params, $suggestion->{$field};
+ push @query, qq{ AND suggestions.$field = ? };
}
}
}
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt
@@ -743,7 +743,14 @@ h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o