Browse Source

Bug 20888: (follow-up) 'is not' operator behaves as 'not like'

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
20.11.x
Matthias Meusburger 2 years ago
committed by Jonathan Druart
parent
commit
cb4df3b29a
  1. 3
      C4/Items.pm
  2. 8
      koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt

3
C4/Items.pm

@ -1333,6 +1333,7 @@ sub _SearchItems_build_where_fragment {
push @columns, Koha::Database->new()->schema()->resultset('Biblio')->result_source->columns;
push @columns, Koha::Database->new()->schema()->resultset('Biblioitem')->result_source->columns;
my @operators = qw(= != > < >= <= like);
push @operators, 'not like';
my $field = $filter->{field} // q{};
if ( (0 < grep { $_ eq $field } @columns) or (substr($field, 0, 5) eq 'marc:') ) {
my $op = $filter->{operator};
@ -1424,7 +1425,7 @@ A filter has the following keys:
=item * query: the value to search in this column
=item * operator: comparison operator. Can be one of = != > < >= <= like
=item * operator: comparison operator. Can be one of = != > < >= <= like 'not like'
=back

8
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt

@ -87,16 +87,16 @@
[% IF params.exists('op') %]
<select name="op" class="form-field-not">
<option value="like">is</option>
[% IF params.op == '!=' %]
<option value="!=" selected="selected">is not</option>
[% IF params.op == 'not like' %]
<option value="not like" selected="selected">is not</option>
[% ELSE %]
<option value="!=">is not</option>
<option value="not like">is not</option>
[% END %]
</select>
[% ELSE %]
<select name="op" class="form-field-not">
<option value="like">is</option>
<option value="!=">is not</option>
<option value="not like">is not</option>
</select>
[% END %]
<input type="text" name="q" class="form-field-value" value="" />

Loading…
Cancel
Save