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

(-)a/Koha/AdditionalField.pm (-1 / +1 lines)
Lines 230-236 sub get_matching_record_ids { Link Here
230
        ) AS values$i |;
230
        ) AS values$i |;
231
        $subquery .= ' USING (record_id)' if $i > 1;
231
        $subquery .= ' USING (record_id)' if $i > 1;
232
        push @subqueries, $subquery;
232
        push @subqueries, $subquery;
233
        push @args, $field->{name}, $tablename, ( $exact_match ? $field->{value} : "%$field->{value}%" );
233
        push @args, $field->{name}, $tablename, ( ( $exact_match or $field->{authorised_value_category} ) ? $field->{value} : "%$field->{value}%" );
234
    }
234
    }
235
    $query .= join( ' LEFT JOIN ', @subqueries ) . ' WHERE 1';
235
    $query .= join( ' LEFT JOIN ', @subqueries ) . ' WHERE 1';
236
    for my $j ( 1 .. $i ) {
236
    for my $j ( 1 .. $i ) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt (-2 / +2 lines)
Lines 435-441 Link Here
435
                      <select id="additional_field_[% field.id %]" name="additional_field_[% field.id %]_filter">
435
                      <select id="additional_field_[% field.id %]" name="additional_field_[% field.id %]_filter">
436
                        <option value="">All</option>
436
                        <option value="">All</option>
437
                        [% FOREACH av IN field.authorised_value_choices %]
437
                        [% FOREACH av IN field.authorised_value_choices %]
438
                          [% IF av.authorised_value == additional_field_filters.${field.name} %]
438
                          [% IF av.authorised_value == additional_field_filters.${field.name}.value %]
439
                            <option value="[% av.authorised_value %]" selected="selected">[% av.lib %]</option>
439
                            <option value="[% av.authorised_value %]" selected="selected">[% av.lib %]</option>
440
                          [% ELSE %]
440
                          [% ELSE %]
441
                            <option value="[% av.authorised_value %]">[% av.lib %]</option>
441
                            <option value="[% av.authorised_value %]">[% av.lib %]</option>
Lines 443-449 Link Here
443
                        [% END %]
443
                        [% END %]
444
                      </select>
444
                      </select>
445
                    [% ELSE %]
445
                    [% ELSE %]
446
                      <input id="additional_field_[% field.id %]" type="text" value="[% additional_field_filters.${field.name} %]" name="additional_field_[% field.id %]_filter" />
446
                      <input id="additional_field_[% field.id %]" type="text" value="[% additional_field_filters.${field.name}.value %]" name="additional_field_[% field.id %]_filter" />
447
                    [% END %]
447
                    [% END %]
448
                  </li>
448
                  </li>
449
                [% END %]
449
                [% END %]
(-)a/serials/serials-search.pl (-4 / +6 lines)
Lines 82-89 my $additional_fields = Koha::AdditionalField->all( { tablename => 'subscription Link Here
82
my $additional_field_filters;
82
my $additional_field_filters;
83
for my $field ( @$additional_fields ) {
83
for my $field ( @$additional_fields ) {
84
    my $filter_value = $query->param('additional_field_' . $field->{id} . '_filter');
84
    my $filter_value = $query->param('additional_field_' . $field->{id} . '_filter');
85
    if ( defined ( $filter_value ) ) {
85
    if ( defined $filter_value and $filter_value ne q|| ) {
86
        $additional_field_filters->{ $field->{name} } = $filter_value;
86
        $additional_field_filters->{ $field->{name} } = {
87
            value => $filter_value,
88
            authorised_value_category => $field->{authorised_value_category},
89
        };
87
    }
90
    }
88
    if ( $field->{authorised_value_category} ) {
91
    if ( $field->{authorised_value_category} ) {
89
        $field->{authorised_value_choices} = GetAuthorisedValues( $field->{authorised_value_category} );
92
        $field->{authorised_value_choices} = GetAuthorisedValues( $field->{authorised_value_category} );
Lines 103-109 if ($searched){ Link Here
103
            publisher    => $publisher,
106
            publisher    => $publisher,
104
            bookseller   => $bookseller,
107
            bookseller   => $bookseller,
105
            branch       => $branch,
108
            branch       => $branch,
106
            additional_fields => [ map{ { name => $_, value => $additional_field_filters->{$_}} } keys %$additional_field_filters ],
109
            additional_fields => [ map{ { name => $_, value => $additional_field_filters->{$_}{value}, authorised_value_category => $additional_field_filters->{$_}{authorised_value_category} } } keys %$additional_field_filters ],
107
            location     => $location,
110
            location     => $location,
108
            expiration_date => $expiration_date_dt,
111
            expiration_date => $expiration_date_dt,
109
        }
112
        }
110
- 

Return to bug 10855