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

(-)a/admin/authorised_values.pl (-1 / +1 lines)
Lines 27-33 use C4::Koha; Link Here
27
use C4::Output;
27
use C4::Output;
28
28
29
29
30
sub AuthorizedValuesForCategory ($) {
30
sub AuthorizedValuesForCategory {
31
    my ($searchstring) = shift or return;
31
    my ($searchstring) = shift or return;
32
    my $dbh = C4::Context->dbh;
32
    my $dbh = C4::Context->dbh;
33
    $searchstring=~ s/\'/\\\'/g;
33
    $searchstring=~ s/\'/\\\'/g;
(-)a/admin/preferences.pl (-10 / +9 lines)
Lines 194-205 sub SearchPrefs { Link Here
194
    my %tab_files = _get_pref_files( $input );
194
    my %tab_files = _get_pref_files( $input );
195
    our @terms = split( /\s+/, $searchfield );
195
    our @terms = split( /\s+/, $searchfield );
196
196
197
    sub matches {
198
        my ( $text ) = @_;
199
200
        return !grep( { $text !~ /$_/i } @terms );
201
    }
202
203
    foreach my $tab_name ( keys %tab_files ) {
197
    foreach my $tab_name ( keys %tab_files ) {
204
        my $data = GetTab( $input, $tab_name );
198
        my $data = GetTab( $input, $tab_name );
205
        my $title = ( keys( %$data ) )[0];
199
        my $title = ( keys( %$data ) )[0];
Lines 209-215 sub SearchPrefs { Link Here
209
        my $matched_groups;
203
        my $matched_groups;
210
204
211
        while ( my ( $group_title, $contents ) = each %$tab ) {
205
        while ( my ( $group_title, $contents ) = each %$tab ) {
212
            if ( matches( $group_title ) ) {
206
            if ( matches( $group_title, \@terms ) ) {
213
                $matched_groups->{$group_title} = $contents;
207
                $matched_groups->{$group_title} = $contents;
214
                next;
208
                next;
215
            }
209
            }
Lines 225-236 sub SearchPrefs { Link Here
225
                            my ( undef, $LINES ) = TransformPrefsToHTML( $data, $searchfield );
219
                            my ( undef, $LINES ) = TransformPrefsToHTML( $data, $searchfield );
226
220
227
                            return { search_jumped => 1, tab => $tab_name, tab_title => $title, LINES => $LINES };
221
                            return { search_jumped => 1, tab => $tab_name, tab_title => $title, LINES => $LINES };
228
                        } elsif ( matches( $piece->{'pref'} ) ) {
222
                        } elsif ( matches( $piece->{'pref'}, \@terms) ) {
229
                            $matched = 1;
223
                            $matched = 1;
230
                        } elsif ( ref( $piece->{'choices'} ) eq 'HASH' && grep( { $_ && matches( $_ ) } values( %{ $piece->{'choices'} } ) ) ) {
224
                        } elsif ( ref( $piece->{'choices'} ) eq 'HASH' && grep( { $_ && matches( $_, \@terms ) } values( %{ $piece->{'choices'} } ) ) ) {
231
                            $matched = 1;
225
                            $matched = 1;
232
                        }
226
                        }
233
                    } elsif ( matches( $piece ) ) {
227
                    } elsif ( matches( $piece, \@terms ) ) {
234
                        $matched = 1;
228
                        $matched = 1;
235
                    }
229
                    }
236
                    last if ( $matched );
230
                    last if ( $matched );
Lines 252-257 sub SearchPrefs { Link Here
252
    return @tabs;
246
    return @tabs;
253
}
247
}
254
248
249
sub matches {
250
    my ( $text, $terms ) = @_;
251
    return !grep( { $text !~ /$_/i } @$terms );
252
}
253
255
my $dbh = C4::Context->dbh;
254
my $dbh = C4::Context->dbh;
256
our $input = new CGI;
255
our $input = new CGI;
257
256
(-)a/t/00-testcritic.t (-2 / +1 lines)
Lines 16-22 my @all_koha_dirs = qw( acqui admin authorities basket C4 catalogue cataloguing Link Here
16
labels members misc offline_circ opac patroncards reports reserve reviews rotating_collections
16
labels members misc offline_circ opac patroncards reports reserve reviews rotating_collections
17
serials sms suggestion t tags test tools virtualshelves);
17
serials sms suggestion t tags test tools virtualshelves);
18
18
19
my @dirs = qw( acqui basket circ debian errors offline_circ reserve reviews rotating_collections
19
my @dirs = qw( acqui admin basket circ debian errors offline_circ reserve reviews rotating_collections
20
serials sms virtualshelves );
20
serials sms virtualshelves );
21
21
22
if ( not $ENV{TEST_QA} ) {
22
if ( not $ENV{TEST_QA} ) {
23
- 

Return to bug 6679