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

(-)a/C4/Acquisition.pm (-4 / +4 lines)
Lines 1346-1352 sub ModOrder { Link Here
1346
    foreach my $orderinfokey (grep(!/ordernumber/, keys %$orderinfo)){
1346
    foreach my $orderinfokey (grep(!/ordernumber/, keys %$orderinfo)){
1347
        # ... and skip hash entries that are not in the aqorders table
1347
        # ... and skip hash entries that are not in the aqorders table
1348
        # FIXME : probably not the best way to do it (would be better to have a correct hash)
1348
        # FIXME : probably not the best way to do it (would be better to have a correct hash)
1349
        next unless grep(/^$orderinfokey$/, @$colnames);
1349
        next unless grep { $_ eq $orderinfokey } @$colnames;
1350
            $query .= "$orderinfokey=?, ";
1350
            $query .= "$orderinfokey=?, ";
1351
            push(@params, $orderinfo->{$orderinfokey});
1351
            push(@params, $orderinfo->{$orderinfokey});
1352
    }
1352
    }
Lines 2702-2708 sub GetInvoices { Link Here
2702
2702
2703
    if($args{order_by}) {
2703
    if($args{order_by}) {
2704
        my ($column, $direction) = split / /, $args{order_by};
2704
        my ($column, $direction) = split / /, $args{order_by};
2705
        if(grep /^$column$/, @columns) {
2705
        if(grep  { $_ eq $column } @columns) {
2706
            $direction ||= 'ASC';
2706
            $direction ||= 'ASC';
2707
            $query .= " ORDER BY $column $direction";
2707
            $query .= " ORDER BY $column $direction";
2708
        }
2708
        }
Lines 2826-2832 sub AddInvoice { Link Here
2826
    my @set_strs;
2826
    my @set_strs;
2827
    my @set_args;
2827
    my @set_args;
2828
    foreach my $key (keys %invoice) {
2828
    foreach my $key (keys %invoice) {
2829
        if(0 < grep(/^$key$/, @columns)) {
2829
        if(0 < grep { $_ eq $key } @columns) {
2830
            push @set_strs, "$key = ?";
2830
            push @set_strs, "$key = ?";
2831
            push @set_args, ($invoice{$key} || undef);
2831
            push @set_args, ($invoice{$key} || undef);
2832
        }
2832
        }
Lines 2876-2882 sub ModInvoice { Link Here
2876
    my @set_strs;
2876
    my @set_strs;
2877
    my @set_args;
2877
    my @set_args;
2878
    foreach my $key (keys %invoice) {
2878
    foreach my $key (keys %invoice) {
2879
        if(0 < grep(/^$key$/, @columns)) {
2879
        if(0 < grep { $_ eq $key } @columns) {
2880
            push @set_strs, "$key = ?";
2880
            push @set_strs, "$key = ?";
2881
            push @set_args, ($invoice{$key} || undef);
2881
            push @set_args, ($invoice{$key} || undef);
2882
        }
2882
        }
(-)a/C4/ImportBatch.pm (-1 / +1 lines)
Lines 1114-1120 sub GetImportRecordsRange { Link Here
1114
    my $dbh = C4::Context->dbh;
1114
    my $dbh = C4::Context->dbh;
1115
1115
1116
    my $order_by = $parameters->{order_by} || 'import_record_id';
1116
    my $order_by = $parameters->{order_by} || 'import_record_id';
1117
    ( $order_by ) = grep( /^$order_by$/, qw( import_record_id title status overlay_status ) ) ? $order_by : 'import_record_id';
1117
    ( $order_by ) = grep( { $_ eq $order_by } qw( import_record_id title status overlay_status ) ) ? $order_by : 'import_record_id';
1118
1118
1119
    my $order_by_direction =
1119
    my $order_by_direction =
1120
      uc( $parameters->{order_by_direction} // 'ASC' ) eq 'DESC' ? 'DESC' : 'ASC';
1120
      uc( $parameters->{order_by_direction} // 'ASC' ) eq 'DESC' ? 'DESC' : 'ASC';
(-)a/C4/Items.pm (-4 / +4 lines)
Lines 2107-2117 sub _SearchItems_build_where_fragment { Link Here
2107
        push @columns, Koha::Database->new()->schema()->resultset('Biblioitem')->result_source->columns;
2107
        push @columns, Koha::Database->new()->schema()->resultset('Biblioitem')->result_source->columns;
2108
        my @operators = qw(= != > < >= <= like);
2108
        my @operators = qw(= != > < >= <= like);
2109
        my $field = $filter->{field} // q{};
2109
        my $field = $filter->{field} // q{};
2110
        if ( (0 < grep /^$field$/, @columns) or (substr($field, 0, 5) eq 'marc:') ) {
2110
        if ( (0 < grep { $_ eq $field } @columns) or (substr($field, 0, 5) eq 'marc:') ) {
2111
            my $op = $filter->{operator};
2111
            my $op = $filter->{operator};
2112
            my $query = $filter->{query};
2112
            my $query = $filter->{query};
2113
2113
2114
            if (!$op or (0 == grep /^$op$/, @operators)) {
2114
            if (!$op or (0 == grep { $_ eq $op } @operators)) {
2115
                $op = '='; # default operator
2115
                $op = '='; # default operator
2116
            }
2116
            }
2117
2117
Lines 2612-2619 sub ToggleNewStatus { Link Here
2612
        |;
2612
        |;
2613
        for my $condition ( @$conditions ) {
2613
        for my $condition ( @$conditions ) {
2614
            if (
2614
            if (
2615
                 grep {/^$condition->{field}$/} @item_columns
2615
                 grep { $_ eq $condition->{field} } @item_columns
2616
              or grep {/^$condition->{field}$/} @biblioitem_columns
2616
              or grep { $_ eq $condition->{field} } @biblioitem_columns
2617
            ) {
2617
            ) {
2618
                if ( $condition->{value} =~ /\|/ ) {
2618
                if ( $condition->{value} =~ /\|/ ) {
2619
                    my @values = split /\|/, $condition->{value};
2619
                    my @values = split /\|/, $condition->{value};
(-)a/C4/Members/Statistics.pm (-1 / +1 lines)
Lines 59-65 sub get_fields { Link Here
59
        my @columns = $schema->source('Item')->columns;
59
        my @columns = $schema->source('Item')->columns;
60
60
61
        foreach my $fn ( @spfields ) {
61
        foreach my $fn ( @spfields ) {
62
            push ( @ret, $fn ) if ( grep(/^$fn$/, @columns) );
62
            push ( @ret, $fn ) if ( grep { $_ eq $fn } @columns );
63
        }
63
        }
64
        $ret = join( '|', @ret);
64
        $ret = join( '|', @ret);
65
    }
65
    }
(-)a/C4/OAI/Sets.pm (-2 / +2 lines)
Lines 554-565 sub _evalRule { Link Here
554
    }
554
    }
555
555
556
    if ($operator eq 'notequal') {
556
    if ($operator eq 'notequal') {
557
        if(0 == grep /^$value$/, @all_subfield_values) {
557
        if(0 == grep { $_ eq $value } @all_subfield_values) {
558
            return 1;
558
            return 1;
559
        }
559
        }
560
    }
560
    }
561
    else {
561
    else {
562
        if(0 < grep /^$value$/, @all_subfield_values) {
562
        if(0 < grep { $_ eq $value } @all_subfield_values) {
563
            return 1;
563
            return 1;
564
        }
564
        }
565
    }
565
    }
(-)a/C4/Overdues.pm (-1 / +1 lines)
Lines 792-798 sub GetOverdueMessageTransportTypes { Link Here
792
    # Put 'print' in first if exists
792
    # Put 'print' in first if exists
793
    # It avoid to sent a print notice with an email or sms template is no email or sms is defined
793
    # It avoid to sent a print notice with an email or sms template is no email or sms is defined
794
    @mtts = uniq( 'print', @mtts )
794
    @mtts = uniq( 'print', @mtts )
795
        if grep {/^print$/} @mtts;
795
        if grep { $_ eq 'print' } @mtts;
796
796
797
    return \@mtts;
797
    return \@mtts;
798
}
798
}
(-)a/C4/Search.pm (-3 / +3 lines)
Lines 712-718 sub _get_facets_data_from_record { Link Here
712
712
713
                my $data = $field->as_string( $subfield_letters, $facet->{ sep } );
713
                my $data = $field->as_string( $subfield_letters, $facet->{ sep } );
714
714
715
                unless ( grep { /^\Q$data\E$/ } @used_datas ) {
715
                unless ( grep { $_ eq $data } @used_datas ) {
716
                    push @used_datas, $data;
716
                    push @used_datas, $data;
717
                    $facets_counter->{ $facet->{ idx } }->{ $data }++;
717
                    $facets_counter->{ $facet->{ idx } }->{ $data }++;
718
                }
718
                }
Lines 1470-1481 sub buildQuery { Link Here
1470
        # this happens when selecting a subject on the opac-detail page
1470
        # this happens when selecting a subject on the opac-detail page
1471
        @limits = grep {!/^$/} @limits;
1471
        @limits = grep {!/^$/} @limits;
1472
        my $original_q = $q; # without available part
1472
        my $original_q = $q; # without available part
1473
        unless ( grep { /^available$/ } @limits ) {
1473
        unless ( grep { $_ eq 'available' } @limits ) {
1474
            $q =~ s| and \( \(allrecords,AlwaysMatches=''\) and \(not-onloan-count,st-numeric >= 1\) and \(lost,st-numeric=0\) \)||;
1474
            $q =~ s| and \( \(allrecords,AlwaysMatches=''\) and \(not-onloan-count,st-numeric >= 1\) and \(lost,st-numeric=0\) \)||;
1475
            $original_q = $q;
1475
            $original_q = $q;
1476
        }
1476
        }
1477
        if ( @limits ) {
1477
        if ( @limits ) {
1478
            if ( grep { /^available$/ } @limits ) {
1478
            if ( grep { $_ eq 'available' } @limits ) {
1479
                $q .= q| and ( (allrecords,AlwaysMatches='') and (not-onloan-count,st-numeric >= 1) and (lost,st-numeric=0) )|;
1479
                $q .= q| and ( (allrecords,AlwaysMatches='') and (not-onloan-count,st-numeric >= 1) and (lost,st-numeric=0) )|;
1480
                delete $limits['available'];
1480
                delete $limits['available'];
1481
            }
1481
            }
(-)a/C4/Serials.pm (-1 / +1 lines)
Lines 1605-1611 sub NewIssue { Link Here
1605
        ### Would use substr and index But be careful to previous presence of ()
1605
        ### Would use substr and index But be careful to previous presence of ()
1606
        $recievedlist .= "; $serialseq" unless ( index( $recievedlist, $serialseq ) > 0 );
1606
        $recievedlist .= "; $serialseq" unless ( index( $recievedlist, $serialseq ) > 0 );
1607
    }
1607
    }
1608
    if ( grep { /^$status$/ } (MISSING_STATUSES) ) {
1608
    if ( grep { $_ eq $status } (MISSING_STATUSES) ) {
1609
        $missinglist .= "; $serialseq" unless ( index( $missinglist, $serialseq ) > 0 );
1609
        $missinglist .= "; $serialseq" unless ( index( $missinglist, $serialseq ) > 0 );
1610
    }
1610
    }
1611
1611
(-)a/C4/Stats.pm (-1 / +1 lines)
Lines 108-114 sub UpdateStats { Link Here
108
    }
108
    }
109
    my @invalid_params = ();
109
    my @invalid_params = ();
110
    for my $myparam (keys %$params ) {
110
    for my $myparam (keys %$params ) {
111
        push @invalid_params, $myparam unless grep (/^$myparam$/, @allowed_keys);
111
        push @invalid_params, $myparam unless grep { $_ eq $myparam } @allowed_keys;
112
    }
112
    }
113
    if (scalar @invalid_params > 0 ) {
113
    if (scalar @invalid_params > 0 ) {
114
        croak ("UpdateStats received invalid param(s): ".join (", ",@invalid_params ));
114
        croak ("UpdateStats received invalid param(s): ".join (", ",@invalid_params ));
(-)a/C4/Tags.pm (-3 / +3 lines)
Lines 192-198 sub get_tag_rows { Link Here
192
			carp "Empty argument key to get_tag_rows: ignoring!";
192
			carp "Empty argument key to get_tag_rows: ignoring!";
193
			next;
193
			next;
194
		}
194
		}
195
		unless (1 == scalar grep {/^ $key $/x} @ok_fields) {
195
		unless (1 == scalar grep { $_ eq $key } @ok_fields) {
196
			carp "get_tag_rows received unreconized argument key '$key'.";
196
			carp "get_tag_rows received unreconized argument key '$key'.";
197
			next;
197
			next;
198
		}
198
		}
Lines 233-239 sub get_tags { # i.e., from tags_index Link Here
233
			carp "Empty argument key to get_tags: ignoring!";
233
			carp "Empty argument key to get_tags: ignoring!";
234
			next;
234
			next;
235
		}
235
		}
236
		unless (1 == scalar grep {/^ $key $/x} @ok_fields) {
236
		unless (1 == scalar grep { $_ eq $key } @ok_fields) {
237
			carp "get_tags received unreconized argument key '$key'.";
237
			carp "get_tags received unreconized argument key '$key'.";
238
			next;
238
			next;
239
		}
239
		}
Lines 302-308 sub get_approval_rows { # i.e., from tags_approval Link Here
302
			carp "Empty argument key to get_approval_rows: ignoring!";
302
			carp "Empty argument key to get_approval_rows: ignoring!";
303
			next;
303
			next;
304
		}
304
		}
305
		unless (1 == scalar grep {/^ $key $/x} @ok_fields) {
305
		unless (1 == scalar grep { $_ eq $key } @ok_fields) {
306
			carp "get_approval_rows received unreconized argument key '$key'.";
306
			carp "get_approval_rows received unreconized argument key '$key'.";
307
			next;
307
			next;
308
		}
308
		}
(-)a/C4/Utils/DataTables/Members.pm (-1 / +1 lines)
Lines 38-44 sub search { Link Here
38
    # Do that after iTotalQuery!
38
    # Do that after iTotalQuery!
39
    if ( defined $branchcode and $branchcode ) {
39
    if ( defined $branchcode and $branchcode ) {
40
        @restricted_branchcodes = @restricted_branchcodes
40
        @restricted_branchcodes = @restricted_branchcodes
41
            ? grep { /^$branchcode$/ } @restricted_branchcodes
41
            ? grep { $_ eq $branchcode } @restricted_branchcodes
42
                ? ($branchcode)
42
                ? ($branchcode)
43
                : (undef) # Do not return any results
43
                : (undef) # Do not return any results
44
            : ($branchcode);
44
            : ($branchcode);
(-)a/Koha/Object.pm (-3 / +3 lines)
Lines 253-259 sub set { Link Here
253
    my @columns = @{$self->_columns()};
253
    my @columns = @{$self->_columns()};
254
254
255
    foreach my $p ( keys %$properties ) {
255
    foreach my $p ( keys %$properties ) {
256
        unless ( grep {/^$p$/} @columns ) {
256
        unless ( grep { $_ eq $p } @columns ) {
257
            Koha::Exceptions::Object::PropertyNotFound->throw( "No property $p for " . ref($self) );
257
            Koha::Exceptions::Object::PropertyNotFound->throw( "No property $p for " . ref($self) );
258
        }
258
        }
259
    }
259
    }
Lines 661-667 sub AUTOLOAD { Link Here
661
661
662
    my @columns = @{$self->_columns()};
662
    my @columns = @{$self->_columns()};
663
    # Using direct setter/getter like $item->barcode() or $item->barcode($barcode);
663
    # Using direct setter/getter like $item->barcode() or $item->barcode($barcode);
664
    if ( grep {/^$method$/} @columns ) {
664
    if ( grep { $_ eq $method } @columns ) {
665
        if ( @_ ) {
665
        if ( @_ ) {
666
            $self->_result()->set_column( $method, @_ );
666
            $self->_result()->set_column( $method, @_ );
667
            return $self;
667
            return $self;
Lines 676-682 sub AUTOLOAD { Link Here
676
    Koha::Exceptions::Object::MethodNotCoveredByTests->throw(
676
    Koha::Exceptions::Object::MethodNotCoveredByTests->throw(
677
        error      => sprintf("The method %s->%s is not covered by tests!", ref($self), $method),
677
        error      => sprintf("The method %s->%s is not covered by tests!", ref($self), $method),
678
        show_trace => 1
678
        show_trace => 1
679
    ) unless grep { /^$method$/ } @known_methods;
679
    ) unless grep { $_ eq $method } @known_methods;
680
680
681
681
682
    my $r = eval { $self->_result->$method(@_) };
682
    my $r = eval { $self->_result->$method(@_) };
(-)a/Koha/Objects.pm (-1 / +1 lines)
Lines 427-433 sub AUTOLOAD { Link Here
427
    $method =~ s/.*:://;
427
    $method =~ s/.*:://;
428
428
429
429
430
    unless ( grep { /^$method$/ } @known_methods ) {
430
    unless ( grep { $_ eq $method } @known_methods ) {
431
        my $class = ref($self) ? ref($self) : $self;
431
        my $class = ref($self) ? ref($self) : $self;
432
        Koha::Exceptions::Object::MethodNotCoveredByTests->throw(
432
        Koha::Exceptions::Object::MethodNotCoveredByTests->throw(
433
            error      => sprintf("The method %s->%s is not covered by tests!", $class, $method),
433
            error      => sprintf("The method %s->%s is not covered by tests!", $class, $method),
(-)a/acqui/duplicate_orders.pl (-2 / +2 lines)
Lines 86-92 my @ordernumbers = split ',', scalar $input->param('ordernumbers') || ''; Link Here
86
if ( $op eq 'select' ) {
86
if ( $op eq 'select' ) {
87
    @result_order_loop = map {
87
    @result_order_loop = map {
88
        my $order = $_;
88
        my $order = $_;
89
        ( grep { /^$order->{ordernumber}$/ } @ordernumbers ) ? () : $order
89
        ( grep {$_ eq $order->{ordernumber}} @ordernumbers ) ? () : $order
90
    } @{ C4::Acquisition::GetHistory(%$filters) };
90
    } @{ C4::Acquisition::GetHistory(%$filters) };
91
91
92
    @selected_order_loop =
92
    @selected_order_loop =
Lines 132-138 elsif ( $op eq 'do_duplicate' ) { Link Here
132
    for my $field (
132
    for my $field (
133
        qw(currency budget_id order_internalnote order_vendornote sort1 sort2 ))
133
        qw(currency budget_id order_internalnote order_vendornote sort1 sort2 ))
134
    {
134
    {
135
        next if grep { /^$field$/ } @fields_to_copy;
135
        next if grep { $_ eq $field } @fields_to_copy;
136
        $default_values->{$field} = $input->param("all_$field");
136
        $default_values->{$field} = $input->param("all_$field");
137
    }
137
    }
138
138
(-)a/admin/preferences.pl (-1 / +1 lines)
Lines 117-123 sub _get_chunk { Link Here
117
                {
117
                {
118
                    text     => $options{multiple}->{$option_value},
118
                    text     => $options{multiple}->{$option_value},
119
                    value    => $option_value,
119
                    value    => $option_value,
120
                    selected => (grep /^$option_value$/, @values) ? 1 : 0,
120
                    selected => (grep { $_ eq $option_value } @values) ? 1 : 0,
121
                }
121
                }
122
              }
122
              }
123
              keys %{ $options{multiple} }
123
              keys %{ $options{multiple} }
(-)a/admin/searchengine/elasticsearch/mappings.pl (-2 / +2 lines)
Lines 135-141 if ( $op eq 'edit' ) { Link Here
135
            my $search_field_name   = $search_field_name[$i];
135
            my $search_field_name   = $search_field_name[$i];
136
            my $mapping_marc_field  = $mapping_marc_field[$i];
136
            my $mapping_marc_field  = $mapping_marc_field[$i];
137
            my $mapping_facet       = $mapping_facet[$i];
137
            my $mapping_facet       = $mapping_facet[$i];
138
            $mapping_facet = ( grep {/^$search_field_name$/} @facetable_field_names ) ? $mapping_facet : 0;
138
            $mapping_facet = ( grep { $_ eq $search_field_name } @facetable_field_names ) ? $mapping_facet : 0;
139
            my $mapping_suggestible = $mapping_suggestible[$i];
139
            my $mapping_suggestible = $mapping_suggestible[$i];
140
            my $mapping_sort        = $mapping_sort[$i] eq 'undef' ? undef : $mapping_sort[$i];
140
            my $mapping_sort        = $mapping_sort[$i] eq 'undef' ? undef : $mapping_sort[$i];
141
            my $mapping_search      = $mapping_search[$i];
141
            my $mapping_search      = $mapping_search[$i];
Lines 238-244 for my $index_name (@index_names) { Link Here
238
            suggestible        => $s->get_column('suggestible'),
238
            suggestible        => $s->get_column('suggestible'),
239
            search             => $s->get_column('search'),
239
            search             => $s->get_column('search'),
240
            facet              => $s->get_column('facet'),
240
            facet              => $s->get_column('facet'),
241
            is_facetable       => ( grep {/^$name$/} @facetable_field_names ) ? 1 : 0,
241
            is_facetable       => ( grep { $_ eq $name } @facetable_field_names ) ? 1 : 0,
242
        };
242
        };
243
    }
243
    }
244
244
(-)a/catalogue/ISBDdetail.pl (-2 / +2 lines)
Lines 161-173 foreach my $myorder (@allorders_using_biblio) { Link Here
161
    my $basket = $myorder->{'basketno'};
161
    my $basket = $myorder->{'basketno'};
162
    if ((defined $myorder->{'datecancellationprinted'}) and  ($myorder->{'datecancellationprinted'} ne '0000-00-00') ){
162
    if ((defined $myorder->{'datecancellationprinted'}) and  ($myorder->{'datecancellationprinted'} ne '0000-00-00') ){
163
        push @deletedorders_using_biblio, $myorder;
163
        push @deletedorders_using_biblio, $myorder;
164
        unless (grep(/^$basket$/, @baskets_deletedorders)){
164
        unless (grep{ $_ eq $basket } @baskets_deletedorders){
165
            push @baskets_deletedorders,$myorder->{'basketno'};
165
            push @baskets_deletedorders,$myorder->{'basketno'};
166
        }
166
        }
167
    }
167
    }
168
    else {
168
    else {
169
        push @orders_using_biblio, $myorder;
169
        push @orders_using_biblio, $myorder;
170
        unless (grep(/^$basket$/, @baskets_orders)){
170
        unless (grep{ $_ eq $basket } @baskets_orders){
171
            push @baskets_orders,$myorder->{'basketno'};
171
            push @baskets_orders,$myorder->{'basketno'};
172
            }
172
            }
173
    }
173
    }
(-)a/catalogue/MARCdetail.pl (-2 / +2 lines)
Lines 337-349 foreach my $myorder (@allorders_using_biblio) { Link Here
337
    my $basket = $myorder->{'basketno'};
337
    my $basket = $myorder->{'basketno'};
338
    if ((defined $myorder->{'datecancellationprinted'}) and  ($myorder->{'datecancellationprinted'} ne '0000-00-00') ){
338
    if ((defined $myorder->{'datecancellationprinted'}) and  ($myorder->{'datecancellationprinted'} ne '0000-00-00') ){
339
        push @deletedorders_using_biblio, $myorder;
339
        push @deletedorders_using_biblio, $myorder;
340
        unless (grep(/^$basket$/, @baskets_deletedorders)){
340
        unless (grep{ $_ eq $basket } @baskets_deletedorders){
341
            push @baskets_deletedorders,$myorder->{'basketno'};
341
            push @baskets_deletedorders,$myorder->{'basketno'};
342
        }
342
        }
343
    }
343
    }
344
    else {
344
    else {
345
        push @orders_using_biblio, $myorder;
345
        push @orders_using_biblio, $myorder;
346
        unless (grep(/^$basket$/, @baskets_orders)){
346
        unless (grep { $_ eq $basket } @baskets_orders){
347
            push @baskets_orders,$myorder->{'basketno'};
347
            push @baskets_orders,$myorder->{'basketno'};
348
            }
348
            }
349
    }
349
    }
(-)a/catalogue/detail.pl (-2 / +2 lines)
Lines 555-567 foreach my $myorder (@allorders_using_biblio) { Link Here
555
    my $basket = $myorder->{'basketno'};
555
    my $basket = $myorder->{'basketno'};
556
    if ((defined $myorder->{'datecancellationprinted'}) and  ($myorder->{'datecancellationprinted'} ne '0000-00-00') ){
556
    if ((defined $myorder->{'datecancellationprinted'}) and  ($myorder->{'datecancellationprinted'} ne '0000-00-00') ){
557
        push @deletedorders_using_biblio, $myorder;
557
        push @deletedorders_using_biblio, $myorder;
558
        unless (grep(/^$basket$/, @baskets_deletedorders)){
558
        unless (grep{ $_ eq $basket } @baskets_deletedorders){
559
            push @baskets_deletedorders,$myorder->{'basketno'};
559
            push @baskets_deletedorders,$myorder->{'basketno'};
560
        }
560
        }
561
    }
561
    }
562
    else {
562
    else {
563
        push @orders_using_biblio, $myorder;
563
        push @orders_using_biblio, $myorder;
564
        unless (grep(/^$basket$/, @baskets_orders)){
564
        unless (grep{ $_ eq $basket } @baskets_orders){
565
            push @baskets_orders,$myorder->{'basketno'};
565
            push @baskets_orders,$myorder->{'basketno'};
566
            }
566
            }
567
    }
567
    }
(-)a/catalogue/imageviewer.pl (-2 / +2 lines)
Lines 97-109 foreach my $myorder (@allorders_using_biblio) { Link Here
97
    my $basket = $myorder->{'basketno'};
97
    my $basket = $myorder->{'basketno'};
98
    if ((defined $myorder->{'datecancellationprinted'}) and  ($myorder->{'datecancellationprinted'} ne '0000-00-00') ){
98
    if ((defined $myorder->{'datecancellationprinted'}) and  ($myorder->{'datecancellationprinted'} ne '0000-00-00') ){
99
        push @deletedorders_using_biblio, $myorder;
99
        push @deletedorders_using_biblio, $myorder;
100
        unless (grep(/^$basket$/, @baskets_deletedorders)){
100
        unless (grep{ $_ eq $basket } @baskets_deletedorders){
101
            push @baskets_deletedorders,$myorder->{'basketno'};
101
            push @baskets_deletedorders,$myorder->{'basketno'};
102
        }
102
        }
103
    }
103
    }
104
    else {
104
    else {
105
        push @orders_using_biblio, $myorder;
105
        push @orders_using_biblio, $myorder;
106
        unless (grep(/^$basket$/, @baskets_orders)){
106
        unless (grep{ $_ eq $basket } @baskets_orders){
107
            push @baskets_orders,$myorder->{'basketno'};
107
            push @baskets_orders,$myorder->{'basketno'};
108
            }
108
            }
109
    }
109
    }
(-)a/catalogue/itemsearch.pl (-1 / +1 lines)
Lines 63-69 if (defined $format and $format eq 'json') { Link Here
63
                push @f, $columns[$i];
63
                push @f, $columns[$i];
64
                push @c, 'and';
64
                push @c, 'and';
65
65
66
                if ( grep /^$columns[$i]$/, qw( ccode homebranch holdingbranch location itype notforloan itemlost ) ) {
66
                if ( grep { $_ eq $columns[$i] } qw( ccode homebranch holdingbranch location itype notforloan itemlost ) ) {
67
                    push @q, "$word";
67
                    push @q, "$word";
68
                    push @op, '=';
68
                    push @op, '=';
69
                } else {
69
                } else {
(-)a/catalogue/labeledMARCdetail.pl (-2 / +2 lines)
Lines 143-155 foreach my $myorder (@allorders_using_biblio) { Link Here
143
    my $basket = $myorder->{'basketno'};
143
    my $basket = $myorder->{'basketno'};
144
    if ((defined $myorder->{'datecancellationprinted'}) and  ($myorder->{'datecancellationprinted'} ne '0000-00-00') ){
144
    if ((defined $myorder->{'datecancellationprinted'}) and  ($myorder->{'datecancellationprinted'} ne '0000-00-00') ){
145
        push @deletedorders_using_biblio, $myorder;
145
        push @deletedorders_using_biblio, $myorder;
146
        unless (grep(/^$basket$/, @baskets_deletedorders)){
146
        unless (grep { $_ eq $basket } @baskets_deletedorders){
147
            push @baskets_deletedorders,$myorder->{'basketno'};
147
            push @baskets_deletedorders,$myorder->{'basketno'};
148
        }
148
        }
149
    }
149
    }
150
    else {
150
    else {
151
        push @orders_using_biblio, $myorder;
151
        push @orders_using_biblio, $myorder;
152
        unless (grep(/^$basket$/, @baskets_orders)){
152
        unless (grep{ $_ eq $basket } @baskets_orders){
153
            push @baskets_orders,$myorder->{'basketno'};
153
            push @baskets_orders,$myorder->{'basketno'};
154
            }
154
            }
155
    }
155
    }
(-)a/catalogue/moredetail.pl (-2 / +2 lines)
Lines 281-293 foreach my $myorder (@allorders_using_biblio) { Link Here
281
    my $basket = $myorder->{'basketno'};
281
    my $basket = $myorder->{'basketno'};
282
    if ((defined $myorder->{'datecancellationprinted'}) and  ($myorder->{'datecancellationprinted'} ne '0000-00-00') ){
282
    if ((defined $myorder->{'datecancellationprinted'}) and  ($myorder->{'datecancellationprinted'} ne '0000-00-00') ){
283
        push @deletedorders_using_biblio, $myorder;
283
        push @deletedorders_using_biblio, $myorder;
284
        unless (grep(/^$basket$/, @baskets_deletedorders)){
284
        unless (grep{ $_ eq $basket } @baskets_deletedorders){
285
            push @baskets_deletedorders,$myorder->{'basketno'};
285
            push @baskets_deletedorders,$myorder->{'basketno'};
286
        }
286
        }
287
    }
287
    }
288
    else {
288
    else {
289
        push @orders_using_biblio, $myorder;
289
        push @orders_using_biblio, $myorder;
290
        unless (grep(/^$basket$/, @baskets_orders)){
290
        unless (grep { $_ eq $basket } @baskets_orders){
291
            push @baskets_orders,$myorder->{'basketno'};
291
            push @baskets_orders,$myorder->{'basketno'};
292
            }
292
            }
293
    }
293
    }
(-)a/circ/circulation.pl (-1 / +1 lines)
Lines 126-132 if ( $batch && C4::Context->preference('BatchCheckouts') ) { Link Here
126
    $template_name = q|circ/circulation_batch_checkouts.tt|;
126
    $template_name = q|circ/circulation_batch_checkouts.tt|;
127
    my @batch_category_codes = split '\|', C4::Context->preference('BatchCheckoutsValidCategories');
127
    my @batch_category_codes = split '\|', C4::Context->preference('BatchCheckoutsValidCategories');
128
    my $categorycode = $patron->categorycode;
128
    my $categorycode = $patron->categorycode;
129
    if ( $categorycode && grep {/^$categorycode$/} @batch_category_codes ) {
129
    if ( $categorycode && grep { $_ eq $categorycode } @batch_category_codes ) {
130
        $batch_allowed = 1;
130
        $batch_allowed = 1;
131
    } else {
131
    } else {
132
        $barcodes = [];
132
        $barcodes = [];
(-)a/clubs/templates-add-modify.pl (-2 / +2 lines)
Lines 92-98 if ( $cgi->param('name') ) { # Update or create club Link Here
92
          ? Koha::Club::Template::Fields->find($field_id)
92
          ? Koha::Club::Template::Fields->find($field_id)
93
          : Koha::Club::Template::Field->new();
93
          : Koha::Club::Template::Field->new();
94
94
95
        if ( grep( /^$field_id$/, @field_delete ) ) {
95
        if ( grep { $_ eq $field_id } @field_delete ) {
96
            $field->delete();
96
            $field->delete();
97
        }
97
        }
98
        else {
98
        else {
Lines 126-132 if ( $cgi->param('name') ) { # Update or create club Link Here
126
          ? Koha::Club::Template::EnrollmentFields->find($field_id)
126
          ? Koha::Club::Template::EnrollmentFields->find($field_id)
127
          : Koha::Club::Template::EnrollmentField->new();
127
          : Koha::Club::Template::EnrollmentField->new();
128
128
129
        if ( grep( /^$field_id$/, @field_delete ) ) {
129
        if ( grep { $_ eq $field_id } @field_delete ) {
130
            $field->delete();
130
            $field->delete();
131
        }
131
        }
132
        else {
132
        else {
(-)a/misc/cronjobs/gather_print_notices.pl (-1 / +1 lines)
Lines 91-97 my @all_messages = @{ GetPrintMessages() }; Link Here
91
@all_messages = map {
91
@all_messages = map {
92
    my $letter_code = $_->{letter_code};
92
    my $letter_code = $_->{letter_code};
93
    (
93
    (
94
        grep { /^$letter_code$/ } @letter_codes
94
        grep { $_ eq $letter_code } @letter_codes
95
    ) ? $_ : ()
95
    ) ? $_ : ()
96
} @all_messages if @letter_codes;
96
} @all_messages if @letter_codes;
97
exit unless @all_messages;
97
exit unless @all_messages;
(-)a/misc/cronjobs/longoverdue.pl (-4 / +4 lines)
Lines 301-307 $borrower_category = [ map { uc $_ } @$borrower_category ]; Link Here
301
$skip_borrower_category = [ map { uc $_} @$skip_borrower_category ];
301
$skip_borrower_category = [ map { uc $_} @$skip_borrower_category ];
302
my %category_to_process;
302
my %category_to_process;
303
for my $cat ( @$borrower_category ) {
303
for my $cat ( @$borrower_category ) {
304
    unless ( grep { /^$cat$/ } @available_categories ) {
304
    unless ( grep { $_ eq $cat } @available_categories ) {
305
        pod2usage(
305
        pod2usage(
306
            '-exitval' => 1,
306
            '-exitval' => 1,
307
            '-message' => "The category $cat does not exist in the database",
307
            '-message' => "The category $cat does not exist in the database",
Lines 311-317 for my $cat ( @$borrower_category ) { Link Here
311
}
311
}
312
if ( @$skip_borrower_category ) {
312
if ( @$skip_borrower_category ) {
313
    for my $cat ( @$skip_borrower_category ) {
313
    for my $cat ( @$skip_borrower_category ) {
314
        unless ( grep { /^$cat$/ } @available_categories ) {
314
        unless ( grep { $_ eq $cat } @available_categories ) {
315
            pod2usage(
315
            pod2usage(
316
                '-exitval' => 1,
316
                '-exitval' => 1,
317
                '-message' => "The category $cat does not exist in the database",
317
                '-message' => "The category $cat does not exist in the database",
Lines 329-335 $itemtype = [ map { uc $_ } @$itemtype ]; Link Here
329
$skip_itemtype = [ map { uc $_} @$skip_itemtype ];
329
$skip_itemtype = [ map { uc $_} @$skip_itemtype ];
330
my %itemtype_to_process;
330
my %itemtype_to_process;
331
for my $it ( @$itemtype ) {
331
for my $it ( @$itemtype ) {
332
    unless ( grep { /^$it$/ } @available_itemtypes ) {
332
    unless ( grep { $_ eq $it } @available_itemtypes ) {
333
        pod2usage(
333
        pod2usage(
334
            '-exitval' => 1,
334
            '-exitval' => 1,
335
            '-message' => "The itemtype $it does not exist in the database",
335
            '-message' => "The itemtype $it does not exist in the database",
Lines 339-345 for my $it ( @$itemtype ) { Link Here
339
}
339
}
340
if ( @$skip_itemtype ) {
340
if ( @$skip_itemtype ) {
341
    for my $it ( @$skip_itemtype ) {
341
    for my $it ( @$skip_itemtype ) {
342
        unless ( grep { /^$it$/ } @available_itemtypes ) {
342
        unless ( grep { $_ eq $it } @available_itemtypes ) {
343
            pod2usage(
343
            pod2usage(
344
                '-exitval' => 1,
344
                '-exitval' => 1,
345
                '-message' => "The itemtype $it does not exist in the database",
345
                '-message' => "The itemtype $it does not exist in the database",
(-)a/misc/migration_tools/rebuild_zebra.pl (-2 / +2 lines)
Lines 146-152 if (not $biblios and not $authorities) { Link Here
146
}
146
}
147
147
148
our @tables_allowed_for_select = ( 'biblioitems', 'items', 'biblio', 'biblio_metadata' );
148
our @tables_allowed_for_select = ( 'biblioitems', 'items', 'biblio', 'biblio_metadata' );
149
unless ( grep { /^$table$/ } @tables_allowed_for_select ) {
149
unless ( grep { $_ eq $table } @tables_allowed_for_select ) {
150
    die "Cannot specify -t|--table with value '$table'. Only "
150
    die "Cannot specify -t|--table with value '$table'. Only "
151
      . ( join ', ', @tables_allowed_for_select )
151
      . ( join ', ', @tables_allowed_for_select )
152
      . " are allowed.";
152
      . " are allowed.";
Lines 476-482 sub select_all_authorities { Link Here
476
476
477
sub select_all_biblios {
477
sub select_all_biblios {
478
    $table = 'biblioitems'
478
    $table = 'biblioitems'
479
      unless grep { /^$table$/ } @tables_allowed_for_select;
479
      unless grep { $_ eq $table } @tables_allowed_for_select;
480
    my $strsth = qq{ SELECT DISTINCT biblionumber FROM $table };
480
    my $strsth = qq{ SELECT DISTINCT biblionumber FROM $table };
481
    $strsth.=qq{ WHERE $where } if ($where);
481
    $strsth.=qq{ WHERE $where } if ($where);
482
    $strsth.=qq{ LIMIT $length } if ($length && !$offset);
482
    $strsth.=qq{ LIMIT $length } if ($length && !$offset);
(-)a/misc/translator/LangInstaller.pm (-1 / +1 lines)
Lines 644-650 sub extract_messages { Link Here
644
            next if $entry =~ /^\./;
644
            next if $entry =~ /^\./;
645
            my $relentry = File::Spec->catfile($dir, $entry);
645
            my $relentry = File::Spec->catfile($dir, $entry);
646
            my $abspath = File::Spec->catfile($basedir, $relentry);
646
            my $abspath = File::Spec->catfile($basedir, $relentry);
647
            if (-d $abspath and not grep /^$relentry$/, @blacklist) {
647
            if (-d $abspath and not grep { $_ eq $relentry } @blacklist) {
648
                push @directories_to_scan, $relentry;
648
                push @directories_to_scan, $relentry;
649
            } elsif (-f $abspath and $relentry =~ /\.(pl|pm)$/) {
649
            } elsif (-f $abspath and $relentry =~ /\.(pl|pm)$/) {
650
                push @files_to_scan, $relentry;
650
                push @files_to_scan, $relentry;
(-)a/misc/translator/translate (-1 / +1 lines)
Lines 54-60 my ($cmd, $lang) = @ARGV; Link Here
54
$cmd = lc $cmd;
54
$cmd = lc $cmd;
55
if ( $cmd =~ /create|install|update/ ) {
55
if ( $cmd =~ /create|install|update/ ) {
56
    my $installer = LangInstaller->new( $lang, $pref, $verbose );
56
    my $installer = LangInstaller->new( $lang, $pref, $verbose );
57
    if ( $cmd ne 'create' and $lang and not grep( /^$lang$/, @{ $installer->{langs} } ) ) {
57
    if ( $cmd ne 'create' and $lang and not grep( {$_ eq $lang} @{ $installer->{langs} } ) ) {
58
        print "Unsupported language: $lang\n";
58
        print "Unsupported language: $lang\n";
59
        exit;
59
        exit;
60
    }
60
    }
(-)a/opac/opac-detail.pl (-1 / +1 lines)
Lines 721-727 if ( not $viewallitems and @items > $max_items_to_display ) { Link Here
721
    
721
    
722
    if ( C4::Context->preference('OPACAcquisitionDetails') ) {
722
    if ( C4::Context->preference('OPACAcquisitionDetails') ) {
723
        $itm->{on_order} = 1
723
        $itm->{on_order} = 1
724
          if grep /^$itm->{itemnumber}$/, @itemnumbers_on_order;
724
          if grep { $_ eq $itm->{itemnumber} } @itemnumbers_on_order;
725
    }
725
    }
726
726
727
    my $itembranch = $itm->{$separatebranch};
727
    my $itembranch = $itm->{$separatebranch};
(-)a/opac/opac-memberentry.pl (-1 / +1 lines)
Lines 77-83 my $mandatory = GetMandatoryFields($action); Link Here
77
77
78
my @libraries = Koha::Libraries->search;
78
my @libraries = Koha::Libraries->search;
79
if ( my @libraries_to_display = split '\|', C4::Context->preference('PatronSelfRegistrationLibraryList') ) {
79
if ( my @libraries_to_display = split '\|', C4::Context->preference('PatronSelfRegistrationLibraryList') ) {
80
    @libraries = map { my $b = $_; my $branchcode = $_->branchcode; grep( /^$branchcode$/, @libraries_to_display ) ? $b : () } @libraries;
80
    @libraries = map { my $b = $_; my $branchcode = $_->branchcode; grep { $_ eq $branchcode } @libraries_to_display ? $b : () } @libraries;
81
}
81
}
82
my ( $min, $max ) = C4::Members::get_cardnumber_length();
82
my ( $min, $max ) = C4::Members::get_cardnumber_length();
83
if ( defined $min ) {
83
if ( defined $min ) {
(-)a/opac/opac-reserve.pl (-1 / +1 lines)
Lines 78-84 unless ( $can_place_hold_if_available_at_pickup ) { Link Here
78
    my @patron_categories = split '\|', C4::Context->preference('OPACHoldsIfAvailableAtPickupExceptions');
78
    my @patron_categories = split '\|', C4::Context->preference('OPACHoldsIfAvailableAtPickupExceptions');
79
    if ( @patron_categories ) {
79
    if ( @patron_categories ) {
80
        my $categorycode = $patron->categorycode;
80
        my $categorycode = $patron->categorycode;
81
        $can_place_hold_if_available_at_pickup = grep /^$categorycode$/, @patron_categories;
81
        $can_place_hold_if_available_at_pickup = grep { $_ eq $categorycode } @patron_categories;
82
    }
82
    }
83
}
83
}
84
84
(-)a/opac/opac-search-history.pl (-1 / +1 lines)
Lines 70-76 unless ( $loggedinuser ) { Link Here
70
                @searches = map { $_->{type} ne $type ? $_ : () } @searches;
70
                @searches = map { $_->{type} ne $type ? $_ : () } @searches;
71
            }
71
            }
72
            if ( @id ) {
72
            if ( @id ) {
73
                @searches = map { my $search = $_; ( grep {/^$search->{id}$/} @id ) ? () : $_ } @searches;
73
                @searches = map { my $search = $_; ( grep { $_ eq $search->{id} } @id ) ? () : $_ } @searches;
74
            }
74
            }
75
        }
75
        }
76
        C4::Search::History::set_to_session({ cgi => $cgi, search_history => \@searches });
76
        C4::Search::History::set_to_session({ cgi => $cgi, search_history => \@searches });
(-)a/opac/opac-search.pl (-1 / +1 lines)
Lines 435-441 my @allowed_sortby = qw /acqdate_asc acqdate_dsc author_az author_za call_number Link Here
435
@sort_by = $cgi->multi_param('sort_by');
435
@sort_by = $cgi->multi_param('sort_by');
436
$sort_by[0] = $default_sort_by if !$sort_by[0] && defined($default_sort_by);
436
$sort_by[0] = $default_sort_by if !$sort_by[0] && defined($default_sort_by);
437
foreach my $sort (@sort_by) {
437
foreach my $sort (@sort_by) {
438
    if ( grep { /^$sort$/ } @allowed_sortby ) {
438
    if ( grep { $_ eq $sort } @allowed_sortby ) {
439
        $template->param($sort => 1);
439
        $template->param($sort => 1);
440
    }
440
    }
441
}
441
}
(-)a/opac/opac-shelves.pl (-1 / +1 lines)
Lines 114-120 if ( $op eq 'add_form' ) { Link Here
114
    if ( $shelf ) {
114
    if ( $shelf ) {
115
        $op = $referer;
115
        $op = $referer;
116
        my $sortfield = $query->param('sortfield');
116
        my $sortfield = $query->param('sortfield');
117
        $sortfield = 'title' unless grep {/^$sortfield$/}qw( title author copyrightdate itemcallnumber dateadded );
117
        $sortfield = 'title' unless grep { $_ eq $sortfield } qw( title author copyrightdate itemcallnumber dateadded );
118
        if ( $shelf->can_be_managed( $loggedinuser ) ) {
118
        if ( $shelf->can_be_managed( $loggedinuser ) ) {
119
            $shelf->shelfname( scalar $query->param('shelfname') );
119
            $shelf->shelfname( scalar $query->param('shelfname') );
120
            $shelf->sortfield( $sortfield );
120
            $shelf->sortfield( $sortfield );
(-)a/reports/borrowers_stats.pl (-4 / +4 lines)
Lines 162-178 sub calculate { Link Here
162
        my $attribute_type = $1;
162
        my $attribute_type = $1;
163
        return unless (grep {$attribute_type eq $_->{code}} @attribute_types);
163
        return unless (grep {$attribute_type eq $_->{code}} @attribute_types);
164
    } else {
164
    } else {
165
        return unless (grep /^$line$/, @valid_names);
165
        return unless (grep { $_ eq $line } @valid_names);
166
    }
166
    }
167
    if ($column =~ /^patron_attr\.(.*)/) {
167
    if ($column =~ /^patron_attr\.(.*)/) {
168
        my $attribute_type = $1;
168
        my $attribute_type = $1;
169
        return unless (grep {$attribute_type eq $_->{code}} @attribute_types);
169
        return unless (grep {$attribute_type eq $_->{code}} @attribute_types);
170
    } else {
170
    } else {
171
        return unless (grep /^$column$/, @valid_names);
171
        return unless (grep { $_ eq $column } @valid_names);
172
    }
172
    }
173
    return if ($digits and $digits !~ /^\d+$/);
173
    return if ($digits and $digits !~ /^\d+$/);
174
    return if ($status and (grep /^$status$/, qw(debarred gonenoaddress lost)) == 0);
174
    return if ($status and (grep { $_ eq $status } qw(debarred gonenoaddress lost)) == 0);
175
    return if ($activity and (grep /^$activity$/, qw(active nonactive)) == 0);
175
    return if ($activity and (grep { $_ eq $activity } qw(active nonactive)) == 0);
176
176
177
    # Filters
177
    # Filters
178
    my $linefilter;
178
    my $linefilter;
(-)a/tools/export.pl (-1 / +1 lines)
Lines 75-81 if ( $op eq 'export' ) { Link Here
75
    if ( $filename ) {
75
    if ( $filename ) {
76
        my $mimetype = $query->uploadInfo($filename)->{'Content-Type'};
76
        my $mimetype = $query->uploadInfo($filename)->{'Content-Type'};
77
        my @valid_mimetypes = qw( application/octet-stream text/csv text/plain application/vnd.ms-excel );
77
        my @valid_mimetypes = qw( application/octet-stream text/csv text/plain application/vnd.ms-excel );
78
        unless ( grep { /^$mimetype$/ } @valid_mimetypes ) {
78
        unless ( grep { $_ eq $mimetype } @valid_mimetypes ) {
79
            push @messages, { type => 'alert', code => 'invalid_mimetype' };
79
            push @messages, { type => 'alert', code => 'invalid_mimetype' };
80
            $op = '';
80
            $op = '';
81
        }
81
        }
(-)a/tools/letter.pl (-1 / +1 lines)
Lines 266-272 sub add_form { Link Here
266
    my $preview_is_available = 0;
266
    my $preview_is_available = 0;
267
267
268
    if ($code) {
268
    if ($code) {
269
        $preview_is_available = grep {/^$code$/} qw( CHECKIN CHECKOUT HOLD_SLIP );
269
        $preview_is_available = grep {$_ eq $code } qw( CHECKIN CHECKOUT HOLD_SLIP );
270
    }
270
    }
271
271
272
    $template->param(
272
    $template->param(
(-)a/tools/modborrowers.pl (-2 / +2 lines)
Lines 327-333 if ( $op eq 'do' ) { Link Here
327
        for my $field ( qw/surname firstname branchcode categorycode streetnumber address address2 city state zipcode country email phone mobile sort1 sort2 dateenrolled dateexpiry borrowernotes opacnote/ ) {
327
        for my $field ( qw/surname firstname branchcode categorycode streetnumber address address2 city state zipcode country email phone mobile sort1 sort2 dateenrolled dateexpiry borrowernotes opacnote/ ) {
328
        my $value = $input->param($field);
328
        my $value = $input->param($field);
329
        $infos->{$field} = $value if $value;
329
        $infos->{$field} = $value if $value;
330
        $infos->{$field} = "" if grep { /^$field$/ } @disabled;
330
        $infos->{$field} = "" if grep { $_ eq $field } @disabled;
331
    }
331
    }
332
332
333
    for my $field ( qw( dateenrolled dateexpiry debarred ) ) {
333
    for my $field ( qw( dateenrolled dateexpiry debarred ) ) {
Lines 384-390 if ( $op eq 'do' ) { Link Here
384
            # If this borrower is not in the category of this attribute, we don't want to modify this attribute
384
            # If this borrower is not in the category of this attribute, we don't want to modify this attribute
385
            ++$i and next if $attr_type->{category_code} and $attr_type->{category_code} ne $borrower_categorycode;
385
            ++$i and next if $attr_type->{category_code} and $attr_type->{category_code} ne $borrower_categorycode;
386
            my $valuename = "attr" . $i . "_value";
386
            my $valuename = "attr" . $i . "_value";
387
            if ( grep { /^$valuename$/ } @disabled ) {
387
            if ( grep { $_ eq $valuename } @disabled ) {
388
                # The attribute is disabled, we remove it for this borrower !
388
                # The attribute is disabled, we remove it for this borrower !
389
                eval {
389
                eval {
390
                    C4::Members::Attributes::DeleteBorrowerAttribute( $borrowernumber, $attribute );
390
                    C4::Members::Attributes::DeleteBorrowerAttribute( $borrowernumber, $attribute );
(-)a/virtualshelves/shelves.pl (-3 / +2 lines)
Lines 102-108 if ( $op eq 'add_form' ) { Link Here
102
    if ( $shelf ) {
102
    if ( $shelf ) {
103
        $op = $referer;
103
        $op = $referer;
104
        my $sortfield = $query->param('sortfield');
104
        my $sortfield = $query->param('sortfield');
105
        $sortfield = 'title' unless grep {/^$sortfield$/}qw( title author copyrightdate itemcallnumber dateadded );
105
        $sortfield = 'title' unless grep { $_ eq $sortfield } qw( title author copyrightdate itemcallnumber dateadded );
106
        if ( $shelf->can_be_managed( $loggedinuser ) ) {
106
        if ( $shelf->can_be_managed( $loggedinuser ) ) {
107
            $shelf->shelfname( scalar $query->param('shelfname') );
107
            $shelf->shelfname( scalar $query->param('shelfname') );
108
            $shelf->sortfield( $sortfield );
108
            $shelf->sortfield( $sortfield );
Lines 234-240 if ( $op eq 'view' ) { Link Here
234
    if ( $shelf ) {
234
    if ( $shelf ) {
235
        if ( $shelf->can_be_viewed( $loggedinuser ) ) {
235
        if ( $shelf->can_be_viewed( $loggedinuser ) ) {
236
            my $sortfield = $query->param('sortfield') || $shelf->sortfield || 'title';    # Passed in sorting overrides default sorting
236
            my $sortfield = $query->param('sortfield') || $shelf->sortfield || 'title';    # Passed in sorting overrides default sorting
237
            $sortfield = 'title' unless grep $_ eq $sortfield, qw( title author copyrightdate itemcallnumber dateadded );
237
            $sortfield = 'title' unless grep { $_ eq $sortfield } qw( title author copyrightdate itemcallnumber dateadded );
238
            my $direction = $query->param('direction') || 'asc';
238
            my $direction = $query->param('direction') || 'asc';
239
            $direction = 'asc' if $direction ne 'asc' and $direction ne 'desc';
239
            $direction = 'asc' if $direction ne 'asc' and $direction ne 'desc';
240
            my ( $rows, $page );
240
            my ( $rows, $page );
241
- 

Return to bug 23084