View | Details | Raw Unified | Return to bug 26032
Collapse All | Expand All

(-)a/C4/Items.pm (+9 lines)
Lines 1337-1342 sub _SearchItems_build_where_fragment { Link Here
1337
        if ( (0 < grep { $_ eq $field } @columns) or (substr($field, 0, 5) eq 'marc:') ) {
1337
        if ( (0 < grep { $_ eq $field } @columns) or (substr($field, 0, 5) eq 'marc:') ) {
1338
            my $op = $filter->{operator};
1338
            my $op = $filter->{operator};
1339
            my $query = $filter->{query};
1339
            my $query = $filter->{query};
1340
            my $ifnull = $filter->{ifnull};
1340
1341
1341
            if (!$op or (0 == grep { $_ eq $op } @operators)) {
1342
            if (!$op or (0 == grep { $_ eq $op } @operators)) {
1342
                $op = '='; # default operator
1343
                $op = '='; # default operator
Lines 1377-1382 sub _SearchItems_build_where_fragment { Link Here
1377
                $column = $field;
1378
                $column = $field;
1378
            }
1379
            }
1379
1380
1381
            if ( defined $ifnull ) {
1382
                $column = "IFNULL($column, ?)";
1383
            }
1384
1380
            if (ref $query eq 'ARRAY') {
1385
            if (ref $query eq 'ARRAY') {
1381
                if ($op eq '=') {
1386
                if ($op eq '=') {
1382
                    $op = 'IN';
1387
                    $op = 'IN';
Lines 1393-1398 sub _SearchItems_build_where_fragment { Link Here
1393
                    args => [ $query ],
1398
                    args => [ $query ],
1394
                };
1399
                };
1395
            }
1400
            }
1401
1402
            if ( defined $ifnull ) {
1403
                unshift @{ $where_fragment->{args} }, $ifnull;
1404
            }
1396
        }
1405
        }
1397
    }
1406
    }
1398
1407
(-)a/catalogue/itemsearch.pl (-1 / +4 lines)
Lines 164-175 if (scalar keys %params > 0) { Link Here
164
    push @{ $filter->{filters} }, $f;
164
    push @{ $filter->{filters} }, $f;
165
165
166
    # Yes/No parameters
166
    # Yes/No parameters
167
    foreach my $p (qw( damaged )) {
167
    foreach my $p (qw( damaged new_status )) {
168
        my $v = $cgi->param($p) // '';
168
        my $v = $cgi->param($p) // '';
169
        my $f = {
169
        my $f = {
170
            field => $p,
170
            field => $p,
171
            query => 0,
171
            query => 0,
172
        };
172
        };
173
        if ( $p eq 'new_status' ) {
174
            $f->{ifnull} = 0;
175
        }
173
        if ($v eq 'yes') {
176
        if ($v eq 'yes') {
174
            $f->{operator} = '!=';
177
            $f->{operator} = '!=';
175
            push @{ $filter->{filters} }, $f;
178
            push @{ $filter->{filters} }, $f;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt (-1 / +2 lines)
Lines 29-34 Link Here
29
    [%- CASE 'damaged' %]<span>Damaged</span>
29
    [%- CASE 'damaged' %]<span>Damaged</span>
30
    [%- CASE 'itemlost' %]<span>Lost</span>
30
    [%- CASE 'itemlost' %]<span>Lost</span>
31
    [%- CASE 'withdrawn' %]<span>Withdrawn</span>
31
    [%- CASE 'withdrawn' %]<span>Withdrawn</span>
32
    [%- CASE 'new_status' %]<span>Is new</span>
32
  [%- END -%]
33
  [%- END -%]
33
[%- END -%]
34
[%- END -%]
34
35
Lines 194-199 Link Here
194
              <span class="hint">(inclusive)</span>
195
              <span class="hint">(inclusive)</span>
195
            </div>
196
            </div>
196
            [% INCLUDE form_field_radio_yes_no name="damaged" %]
197
            [% INCLUDE form_field_radio_yes_no name="damaged" %]
198
            [% INCLUDE form_field_radio_yes_no name="new_status" %]
197
            <div class="form-field">
199
            <div class="form-field">
198
              <label class="form-field-label" for="issues_op">Checkout count:</label>
200
              <label class="form-field-label" for="issues_op">Checkout count:</label>
199
              <select id="issues_op" name="issues_op">
201
              <select id="issues_op" name="issues_op">
200
- 

Return to bug 26032