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

(-)a/C4/Acquisition.pm (-4 / +4 lines)
Lines 1347-1353 sub ModOrder { Link Here
1347
    foreach my $orderinfokey (grep(!/ordernumber/, keys %$orderinfo)){
1347
    foreach my $orderinfokey (grep(!/ordernumber/, keys %$orderinfo)){
1348
        # ... and skip hash entries that are not in the aqorders table
1348
        # ... and skip hash entries that are not in the aqorders table
1349
        # FIXME : probably not the best way to do it (would be better to have a correct hash)
1349
        # FIXME : probably not the best way to do it (would be better to have a correct hash)
1350
        next unless grep(/^$orderinfokey$/, @$colnames);
1350
        next unless grep { $_ eq $orderinfokey } @$colnames;
1351
            $query .= "$orderinfokey=?, ";
1351
            $query .= "$orderinfokey=?, ";
1352
            push(@params, $orderinfo->{$orderinfokey});
1352
            push(@params, $orderinfo->{$orderinfokey});
1353
    }
1353
    }
Lines 2682-2688 sub GetInvoices { Link Here
2682
2682
2683
    if($args{order_by}) {
2683
    if($args{order_by}) {
2684
        my ($column, $direction) = split / /, $args{order_by};
2684
        my ($column, $direction) = split / /, $args{order_by};
2685
        if(grep /^$column$/, @columns) {
2685
        if(grep  { $_ eq $column } @columns) {
2686
            $direction ||= 'ASC';
2686
            $direction ||= 'ASC';
2687
            $query .= " ORDER BY $column $direction";
2687
            $query .= " ORDER BY $column $direction";
2688
        }
2688
        }
Lines 2806-2812 sub AddInvoice { Link Here
2806
    my @set_strs;
2806
    my @set_strs;
2807
    my @set_args;
2807
    my @set_args;
2808
    foreach my $key (keys %invoice) {
2808
    foreach my $key (keys %invoice) {
2809
        if(0 < grep(/^$key$/, @columns)) {
2809
        if(0 < grep { $_ eq $key } @columns) {
2810
            push @set_strs, "$key = ?";
2810
            push @set_strs, "$key = ?";
2811
            push @set_args, ($invoice{$key} || undef);
2811
            push @set_args, ($invoice{$key} || undef);
2812
        }
2812
        }
Lines 2856-2862 sub ModInvoice { Link Here
2856
    my @set_strs;
2856
    my @set_strs;
2857
    my @set_args;
2857
    my @set_args;
2858
    foreach my $key (keys %invoice) {
2858
    foreach my $key (keys %invoice) {
2859
        if(0 < grep(/^$key$/, @columns)) {
2859
        if(0 < grep { $_ eq $key } @columns) {
2860
            push @set_strs, "$key = ?";
2860
            push @set_strs, "$key = ?";
2861
            push @set_args, ($invoice{$key} || undef);
2861
            push @set_args, ($invoice{$key} || undef);
2862
        }
2862
        }
(-)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/Installer/PerlModules.pm (-1 / +1 lines)
Lines 76-82 sub version_info { Link Here
76
    no warnings
76
    no warnings
77
      ;  # perl throws warns for invalid $VERSION numbers which some modules use
77
      ;  # perl throws warns for invalid $VERSION numbers which some modules use
78
    my ( $self, $module ) = @_;
78
    my ( $self, $module ) = @_;
79
    return -1 unless grep { /^$module$/ } keys(%$PERL_DEPS);
79
    return -1 unless grep { $_ eq $module } keys(%$PERL_DEPS);
80
80
81
    $Readonly::XS::MAGIC_COOKIE="Do NOT use or require Readonly::XS unless you're me.";
81
    $Readonly::XS::MAGIC_COOKIE="Do NOT use or require Readonly::XS unless you're me.";
82
    eval "require $module";
82
    eval "require $module";
(-)a/C4/Items.pm (-4 / +4 lines)
Lines 2101-2111 sub _SearchItems_build_where_fragment { Link Here
2101
        push @columns, Koha::Database->new()->schema()->resultset('Biblioitem')->result_source->columns;
2101
        push @columns, Koha::Database->new()->schema()->resultset('Biblioitem')->result_source->columns;
2102
        my @operators = qw(= != > < >= <= like);
2102
        my @operators = qw(= != > < >= <= like);
2103
        my $field = $filter->{field};
2103
        my $field = $filter->{field};
2104
        if ( (0 < grep /^$field$/, @columns) or (substr($field, 0, 5) eq 'marc:') ) {
2104
        if ( (0 < grep { $_ eq $field } @columns) or (substr($field, 0, 5) eq 'marc:') ) {
2105
            my $op = $filter->{operator};
2105
            my $op = $filter->{operator};
2106
            my $query = $filter->{query};
2106
            my $query = $filter->{query};
2107
2107
2108
            if (!$op or (0 == grep /^$op$/, @operators)) {
2108
            if (!$op or (0 == grep { $_ eq $op } @operators)) {
2109
                $op = '='; # default operator
2109
                $op = '='; # default operator
2110
            }
2110
            }
2111
2111
Lines 2601-2608 sub ToggleNewStatus { Link Here
2601
        |;
2601
        |;
2602
        for my $condition ( @$conditions ) {
2602
        for my $condition ( @$conditions ) {
2603
            if (
2603
            if (
2604
                 grep {/^$condition->{field}$/} @item_columns
2604
                 grep { $_ eq $condition->{field} } @item_columns
2605
              or grep {/^$condition->{field}$/} @biblioitem_columns
2605
              or grep { $_ eq $condition->{field} } @biblioitem_columns
2606
            ) {
2606
            ) {
2607
                if ( $condition->{value} =~ /\|/ ) {
2607
                if ( $condition->{value} =~ /\|/ ) {
2608
                    my @values = split /\|/, $condition->{value};
2608
                    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 500-512 sub CalcOAISetsBiblio { Link Here
500
            my $value = $mapping->{'marcvalue'};
500
            my $value = $mapping->{'marcvalue'};
501
            my @subfield_values = $record->subfield($field, $subfield);
501
            my @subfield_values = $record->subfield($field, $subfield);
502
            if ($operator eq 'notequal') {
502
            if ($operator eq 'notequal') {
503
                if(0 == grep /^$value$/, @subfield_values) {
503
                if(0 == grep { $_ eq $value } @subfield_values) {
504
                    push @biblio_sets, $set_id;
504
                    push @biblio_sets, $set_id;
505
                    last;
505
                    last;
506
                }
506
                }
507
            }
507
            }
508
            else {
508
            else {
509
                if(0 < grep /^$value$/, @subfield_values) {
509
                if(0 < grep { $_ eq $value } @subfield_values) {
510
                    push @biblio_sets, $set_id;
510
                    push @biblio_sets, $set_id;
511
                    last;
511
                    last;
512
                }
512
                }
(-)a/C4/Overdues.pm (-1 / +1 lines)
Lines 766-772 sub GetOverdueMessageTransportTypes { Link Here
766
    # Put 'print' in first if exists
766
    # Put 'print' in first if exists
767
    # It avoid to sent a print notice with an email or sms template is no email or sms is defined
767
    # It avoid to sent a print notice with an email or sms template is no email or sms is defined
768
    @mtts = uniq( 'print', @mtts )
768
    @mtts = uniq( 'print', @mtts )
769
        if grep {/^print$/} @mtts;
769
        if grep { $_ eq 'print' } @mtts;
770
770
771
    return \@mtts;
771
    return \@mtts;
772
}
772
}
(-)a/C4/Search.pm (-3 / +3 lines)
Lines 731-737 sub _get_facets_data_from_record { Link Here
731
731
732
                my $data = $field->as_string( $subfield_letters, $facet->{ sep } );
732
                my $data = $field->as_string( $subfield_letters, $facet->{ sep } );
733
733
734
                unless ( grep { /^\Q$data\E$/ } @used_datas ) {
734
                unless ( grep { $_ eq $data } @used_datas ) {
735
                    push @used_datas, $data;
735
                    push @used_datas, $data;
736
                    $facets_counter->{ $facet->{ idx } }->{ $data }++;
736
                    $facets_counter->{ $facet->{ idx } }->{ $data }++;
737
                }
737
                }
Lines 1490-1501 sub buildQuery { Link Here
1490
        # this happens when selecting a subject on the opac-detail page
1490
        # this happens when selecting a subject on the opac-detail page
1491
        @limits = grep {!/^$/} @limits;
1491
        @limits = grep {!/^$/} @limits;
1492
        my $original_q = $q; # without available part
1492
        my $original_q = $q; # without available part
1493
        unless ( grep { /^available$/ } @limits ) {
1493
        unless ( grep { $_ eq 'available' } @limits ) {
1494
            $q =~ s| and \( \( allrecords,AlwaysMatches:'' not onloan,AlwaysMatches:''\) and \(lost,st-numeric=0\) \)||;
1494
            $q =~ s| and \( \( allrecords,AlwaysMatches:'' not onloan,AlwaysMatches:''\) and \(lost,st-numeric=0\) \)||;
1495
            $original_q = $q;
1495
            $original_q = $q;
1496
        }
1496
        }
1497
        if ( @limits ) {
1497
        if ( @limits ) {
1498
            if ( grep { /^available$/ } @limits ) {
1498
            if ( grep { $_ eq 'available' } @limits ) {
1499
                $q .= q| and ( ( allrecords,AlwaysMatches:'' not onloan,AlwaysMatches:'') and (lost,st-numeric=0) )|;
1499
                $q .= q| and ( ( allrecords,AlwaysMatches:'' not onloan,AlwaysMatches:'') and (lost,st-numeric=0) )|;
1500
                delete $limits['available'];
1500
                delete $limits['available'];
1501
            }
1501
            }
(-)a/C4/Serials.pm (-1 / +1 lines)
Lines 1579-1585 sub NewIssue { Link Here
1579
        ### Would use substr and index But be careful to previous presence of ()
1579
        ### Would use substr and index But be careful to previous presence of ()
1580
        $recievedlist .= "; $serialseq" unless ( index( $recievedlist, $serialseq ) > 0 );
1580
        $recievedlist .= "; $serialseq" unless ( index( $recievedlist, $serialseq ) > 0 );
1581
    }
1581
    }
1582
    if ( grep { /^$status$/ } (MISSING_STATUSES) ) {
1582
    if ( grep { $_ eq $status } (MISSING_STATUSES) ) {
1583
        $missinglist .= "; $serialseq" unless ( index( $missinglist, $serialseq ) > 0 );
1583
        $missinglist .= "; $serialseq" unless ( index( $missinglist, $serialseq ) > 0 );
1584
    }
1584
    }
1585
1585
(-)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 236-242 sub set { Link Here
236
    my @columns = @{$self->_columns()};
236
    my @columns = @{$self->_columns()};
237
237
238
    foreach my $p ( keys %$properties ) {
238
    foreach my $p ( keys %$properties ) {
239
        unless ( grep {/^$p$/} @columns ) {
239
        unless ( grep { $_ eq $p } @columns ) {
240
            Koha::Exceptions::Object::PropertyNotFound->throw( "No property $p for " . ref($self) );
240
            Koha::Exceptions::Object::PropertyNotFound->throw( "No property $p for " . ref($self) );
241
        }
241
        }
242
    }
242
    }
Lines 442-448 sub AUTOLOAD { Link Here
442
442
443
    my @columns = @{$self->_columns()};
443
    my @columns = @{$self->_columns()};
444
    # Using direct setter/getter like $item->barcode() or $item->barcode($barcode);
444
    # Using direct setter/getter like $item->barcode() or $item->barcode($barcode);
445
    if ( grep {/^$method$/} @columns ) {
445
    if ( grep { $_ eq $method } @columns ) {
446
        if ( @_ ) {
446
        if ( @_ ) {
447
            $self->_result()->set_column( $method, @_ );
447
            $self->_result()->set_column( $method, @_ );
448
            return $self;
448
            return $self;
Lines 457-463 sub AUTOLOAD { Link Here
457
    Koha::Exceptions::Object::MethodNotCoveredByTests->throw(
457
    Koha::Exceptions::Object::MethodNotCoveredByTests->throw(
458
        error      => sprintf("The method %s->%s is not covered by tests!", ref($self), $method),
458
        error      => sprintf("The method %s->%s is not covered by tests!", ref($self), $method),
459
        show_trace => 1
459
        show_trace => 1
460
    ) unless grep { /^$method$/ } @known_methods;
460
    ) unless grep { $_ eq $method } @known_methods;
461
461
462
462
463
    my $r = eval { $self->_result->$method(@_) };
463
    my $r = eval { $self->_result->$method(@_) };
(-)a/Koha/Objects.pm (-1 / +1 lines)
Lines 384-390 sub AUTOLOAD { Link Here
384
    $method =~ s/.*:://;
384
    $method =~ s/.*:://;
385
385
386
386
387
    unless ( grep { /^$method$/ } @known_methods ) {
387
    unless ( grep { $_ eq $method } @known_methods ) {
388
        my $class = ref($self) ? ref($self) : $self;
388
        my $class = ref($self) ? ref($self) : $self;
389
        Koha::Exceptions::Object::MethodNotCoveredByTests->throw(
389
        Koha::Exceptions::Object::MethodNotCoveredByTests->throw(
390
            error      => sprintf("The method %s->%s is not covered by tests!", $class, $method),
390
            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 124-130 if ( $op eq 'edit' ) { Link Here
124
            my $mapping_suggestible = $mapping_suggestible[$i];
124
            my $mapping_suggestible = $mapping_suggestible[$i];
125
            my $mapping_sort        = $mapping_sort[$i];
125
            my $mapping_sort        = $mapping_sort[$i];
126
            $mapping_sort = undef if $mapping_sort eq 'undef';
126
            $mapping_sort = undef if $mapping_sort eq 'undef';
127
            $mapping_facet = ( grep {/^$search_field_name$/} @facetable_field_names ) ? $mapping_facet : 0;
127
            $mapping_facet = ( grep { $_ eq $search_field_name } @facetable_field_names ) ? $mapping_facet : 0;
128
128
129
            my $search_field = Koha::SearchFields->find({ name => $search_field_name }, { key => 'name' });
129
            my $search_field = Koha::SearchFields->find({ name => $search_field_name }, { key => 'name' });
130
            # TODO Check mapping format
130
            # TODO Check mapping format
Lines 200-206 for my $index_name (@index_names) { Link Here
200
            sort               => $s->get_column('sort') // 'undef', # To avoid warnings "Use of uninitialized value in lc"
200
            sort               => $s->get_column('sort') // 'undef', # To avoid warnings "Use of uninitialized value in lc"
201
            suggestible        => $s->get_column('suggestible'),
201
            suggestible        => $s->get_column('suggestible'),
202
            facet              => $s->get_column('facet'),
202
            facet              => $s->get_column('facet'),
203
            is_facetable       => ( grep {/^$name$/} @facetable_field_names ) ? 1 : 0,
203
            is_facetable       => ( grep { $_ eq $name } @facetable_field_names ) ? 1 : 0,
204
          };
204
          };
205
    }
205
    }
206
206
(-)a/catalogue/ISBDdetail.pl (-2 / +2 lines)
Lines 152-164 foreach my $myorder (@allorders_using_biblio) { Link Here
152
    my $basket = $myorder->{'basketno'};
152
    my $basket = $myorder->{'basketno'};
153
    if ((defined $myorder->{'datecancellationprinted'}) and  ($myorder->{'datecancellationprinted'} ne '0000-00-00') ){
153
    if ((defined $myorder->{'datecancellationprinted'}) and  ($myorder->{'datecancellationprinted'} ne '0000-00-00') ){
154
        push @deletedorders_using_biblio, $myorder;
154
        push @deletedorders_using_biblio, $myorder;
155
        unless (grep(/^$basket$/, @baskets_deletedorders)){
155
        unless (grep{ $_ eq $basket } @baskets_deletedorders){
156
            push @baskets_deletedorders,$myorder->{'basketno'};
156
            push @baskets_deletedorders,$myorder->{'basketno'};
157
        }
157
        }
158
    }
158
    }
159
    else {
159
    else {
160
        push @orders_using_biblio, $myorder;
160
        push @orders_using_biblio, $myorder;
161
        unless (grep(/^$basket$/, @baskets_orders)){
161
        unless (grep{ $_ eq $basket } @baskets_orders){
162
            push @baskets_orders,$myorder->{'basketno'};
162
            push @baskets_orders,$myorder->{'basketno'};
163
            }
163
            }
164
    }
164
    }
(-)a/catalogue/MARCdetail.pl (-2 / +2 lines)
Lines 328-340 foreach my $myorder (@allorders_using_biblio) { Link Here
328
    my $basket = $myorder->{'basketno'};
328
    my $basket = $myorder->{'basketno'};
329
    if ((defined $myorder->{'datecancellationprinted'}) and  ($myorder->{'datecancellationprinted'} ne '0000-00-00') ){
329
    if ((defined $myorder->{'datecancellationprinted'}) and  ($myorder->{'datecancellationprinted'} ne '0000-00-00') ){
330
        push @deletedorders_using_biblio, $myorder;
330
        push @deletedorders_using_biblio, $myorder;
331
        unless (grep(/^$basket$/, @baskets_deletedorders)){
331
        unless (grep{ $_ eq $basket } @baskets_deletedorders){
332
            push @baskets_deletedorders,$myorder->{'basketno'};
332
            push @baskets_deletedorders,$myorder->{'basketno'};
333
        }
333
        }
334
    }
334
    }
335
    else {
335
    else {
336
        push @orders_using_biblio, $myorder;
336
        push @orders_using_biblio, $myorder;
337
        unless (grep(/^$basket$/, @baskets_orders)){
337
        unless (grep { $_ eq $basket } @baskets_orders){
338
            push @baskets_orders,$myorder->{'basketno'};
338
            push @baskets_orders,$myorder->{'basketno'};
339
            }
339
            }
340
    }
340
    }
(-)a/catalogue/detail.pl (-2 / +2 lines)
Lines 522-534 foreach my $myorder (@allorders_using_biblio) { Link Here
522
    my $basket = $myorder->{'basketno'};
522
    my $basket = $myorder->{'basketno'};
523
    if ((defined $myorder->{'datecancellationprinted'}) and  ($myorder->{'datecancellationprinted'} ne '0000-00-00') ){
523
    if ((defined $myorder->{'datecancellationprinted'}) and  ($myorder->{'datecancellationprinted'} ne '0000-00-00') ){
524
        push @deletedorders_using_biblio, $myorder;
524
        push @deletedorders_using_biblio, $myorder;
525
        unless (grep(/^$basket$/, @baskets_deletedorders)){
525
        unless (grep{ $_ eq $basket } @baskets_deletedorders){
526
            push @baskets_deletedorders,$myorder->{'basketno'};
526
            push @baskets_deletedorders,$myorder->{'basketno'};
527
        }
527
        }
528
    }
528
    }
529
    else {
529
    else {
530
        push @orders_using_biblio, $myorder;
530
        push @orders_using_biblio, $myorder;
531
        unless (grep(/^$basket$/, @baskets_orders)){
531
        unless (grep{ $_ eq $basket } @baskets_orders){
532
            push @baskets_orders,$myorder->{'basketno'};
532
            push @baskets_orders,$myorder->{'basketno'};
533
            }
533
            }
534
    }
534
    }
(-)a/catalogue/imageviewer.pl (-2 / +2 lines)
Lines 89-101 foreach my $myorder (@allorders_using_biblio) { Link Here
89
    my $basket = $myorder->{'basketno'};
89
    my $basket = $myorder->{'basketno'};
90
    if ((defined $myorder->{'datecancellationprinted'}) and  ($myorder->{'datecancellationprinted'} ne '0000-00-00') ){
90
    if ((defined $myorder->{'datecancellationprinted'}) and  ($myorder->{'datecancellationprinted'} ne '0000-00-00') ){
91
        push @deletedorders_using_biblio, $myorder;
91
        push @deletedorders_using_biblio, $myorder;
92
        unless (grep(/^$basket$/, @baskets_deletedorders)){
92
        unless (grep{ $_ eq $basket } @baskets_deletedorders){
93
            push @baskets_deletedorders,$myorder->{'basketno'};
93
            push @baskets_deletedorders,$myorder->{'basketno'};
94
        }
94
        }
95
    }
95
    }
96
    else {
96
    else {
97
        push @orders_using_biblio, $myorder;
97
        push @orders_using_biblio, $myorder;
98
        unless (grep(/^$basket$/, @baskets_orders)){
98
        unless (grep{ $_ eq $basket } @baskets_orders){
99
            push @baskets_orders,$myorder->{'basketno'};
99
            push @baskets_orders,$myorder->{'basketno'};
100
            }
100
            }
101
    }
101
    }
(-)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 135-147 foreach my $myorder (@allorders_using_biblio) { Link Here
135
    my $basket = $myorder->{'basketno'};
135
    my $basket = $myorder->{'basketno'};
136
    if ((defined $myorder->{'datecancellationprinted'}) and  ($myorder->{'datecancellationprinted'} ne '0000-00-00') ){
136
    if ((defined $myorder->{'datecancellationprinted'}) and  ($myorder->{'datecancellationprinted'} ne '0000-00-00') ){
137
        push @deletedorders_using_biblio, $myorder;
137
        push @deletedorders_using_biblio, $myorder;
138
        unless (grep(/^$basket$/, @baskets_deletedorders)){
138
        unless (grep { $_ eq $basket } @baskets_deletedorders){
139
            push @baskets_deletedorders,$myorder->{'basketno'};
139
            push @baskets_deletedorders,$myorder->{'basketno'};
140
        }
140
        }
141
    }
141
    }
142
    else {
142
    else {
143
        push @orders_using_biblio, $myorder;
143
        push @orders_using_biblio, $myorder;
144
        unless (grep(/^$basket$/, @baskets_orders)){
144
        unless (grep{ $_ eq $basket } @baskets_orders){
145
            push @baskets_orders,$myorder->{'basketno'};
145
            push @baskets_orders,$myorder->{'basketno'};
146
            }
146
            }
147
    }
147
    }
(-)a/catalogue/moredetail.pl (-2 / +2 lines)
Lines 235-247 foreach my $myorder (@allorders_using_biblio) { Link Here
235
    my $basket = $myorder->{'basketno'};
235
    my $basket = $myorder->{'basketno'};
236
    if ((defined $myorder->{'datecancellationprinted'}) and  ($myorder->{'datecancellationprinted'} ne '0000-00-00') ){
236
    if ((defined $myorder->{'datecancellationprinted'}) and  ($myorder->{'datecancellationprinted'} ne '0000-00-00') ){
237
        push @deletedorders_using_biblio, $myorder;
237
        push @deletedorders_using_biblio, $myorder;
238
        unless (grep(/^$basket$/, @baskets_deletedorders)){
238
        unless (grep{ $_ eq $basket } @baskets_deletedorders){
239
            push @baskets_deletedorders,$myorder->{'basketno'};
239
            push @baskets_deletedorders,$myorder->{'basketno'};
240
        }
240
        }
241
    }
241
    }
242
    else {
242
    else {
243
        push @orders_using_biblio, $myorder;
243
        push @orders_using_biblio, $myorder;
244
        unless (grep(/^$basket$/, @baskets_orders)){
244
        unless (grep { $_ eq $basket } @baskets_orders){
245
            push @baskets_orders,$myorder->{'basketno'};
245
            push @baskets_orders,$myorder->{'basketno'};
246
            }
246
            }
247
    }
247
    }
(-)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 634-640 sub extract_messages { Link Here
634
            next if $entry =~ /^\./;
634
            next if $entry =~ /^\./;
635
            my $relentry = File::Spec->catfile($dir, $entry);
635
            my $relentry = File::Spec->catfile($dir, $entry);
636
            my $abspath = File::Spec->catfile($basedir, $relentry);
636
            my $abspath = File::Spec->catfile($basedir, $relentry);
637
            if (-d $abspath and not grep /^$relentry$/, @blacklist) {
637
            if (-d $abspath and not grep { $_ eq $relentry } @blacklist) {
638
                push @directories_to_scan, $relentry;
638
                push @directories_to_scan, $relentry;
639
            } elsif (-f $abspath and $relentry =~ /\.(pl|pm)$/) {
639
            } elsif (-f $abspath and $relentry =~ /\.(pl|pm)$/) {
640
                push @files_to_scan, $relentry;
640
                push @files_to_scan, $relentry;
(-)a/opac/opac-detail.pl (-1 / +1 lines)
Lines 720-726 if ( not $viewallitems and @items > $max_items_to_display ) { Link Here
720
    
720
    
721
    if ( C4::Context->preference('OPACAcquisitionDetails') ) {
721
    if ( C4::Context->preference('OPACAcquisitionDetails') ) {
722
        $itm->{on_order} = 1
722
        $itm->{on_order} = 1
723
          if grep /^$itm->{itemnumber}$/, @itemnumbers_on_order;
723
          if grep { $_ eq $itm->{itemnumber} } @itemnumbers_on_order;
724
    }
724
    }
725
725
726
    my $itembranch = $itm->{$separatebranch};
726
    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 431-437 my @allowed_sortby = qw /acqdate_asc acqdate_dsc author_az author_za call_number Link Here
431
@sort_by = $cgi->multi_param('sort_by');
431
@sort_by = $cgi->multi_param('sort_by');
432
$sort_by[0] = $default_sort_by if !$sort_by[0] && defined($default_sort_by);
432
$sort_by[0] = $default_sort_by if !$sort_by[0] && defined($default_sort_by);
433
foreach my $sort (@sort_by) {
433
foreach my $sort (@sort_by) {
434
    if ( grep { /^$sort$/ } @allowed_sortby ) {
434
    if ( grep { $_ eq $sort } @allowed_sortby ) {
435
        $template->param($sort => 1);
435
        $template->param($sort => 1);
436
    }
436
    }
437
}
437
}
(-)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 263-269 sub add_form { Link Here
263
    my $preview_is_available = 0;
263
    my $preview_is_available = 0;
264
264
265
    if ($code) {
265
    if ($code) {
266
        $preview_is_available = grep {/^$code$/} qw( CHECKIN CHECKOUT HOLD_SLIP );
266
        $preview_is_available = grep {$_ eq $code } qw( CHECKIN CHECKOUT HOLD_SLIP );
267
    }
267
    }
268
268
269
    $template->param(
269
    $template->param(
(-)a/tools/modborrowers.pl (-2 / +2 lines)
Lines 278-284 if ( $op eq 'do' ) { Link Here
278
    for my $field ( qw/surname firstname branchcode categorycode city state zipcode country sort1 sort2 dateenrolled dateexpiry borrowernotes opacnote/ ) {
278
    for my $field ( qw/surname firstname branchcode categorycode city state zipcode country sort1 sort2 dateenrolled dateexpiry borrowernotes opacnote/ ) {
279
        my $value = $input->param($field);
279
        my $value = $input->param($field);
280
        $infos->{$field} = $value if $value;
280
        $infos->{$field} = $value if $value;
281
        $infos->{$field} = "" if grep { /^$field$/ } @disabled;
281
        $infos->{$field} = "" if grep { $_ eq $field } @disabled;
282
    }
282
    }
283
283
284
    for my $field ( qw( dateenrolled dateexpiry ) ) {
284
    for my $field ( qw( dateenrolled dateexpiry ) ) {
Lines 313-319 if ( $op eq 'do' ) { Link Here
313
            # If this borrower is not in the category of this attribute, we don't want to modify this attribute
313
            # If this borrower is not in the category of this attribute, we don't want to modify this attribute
314
            ++$i and next if $attr_type->{category_code} and $attr_type->{category_code} ne $borrower_categorycode;
314
            ++$i and next if $attr_type->{category_code} and $attr_type->{category_code} ne $borrower_categorycode;
315
            my $valuename = "attr" . $i . "_value";
315
            my $valuename = "attr" . $i . "_value";
316
            if ( grep { /^$valuename$/ } @disabled ) {
316
            if ( grep { $_ eq $valuename } @disabled ) {
317
                # The attribute is disabled, we remove it for this borrower !
317
                # The attribute is disabled, we remove it for this borrower !
318
                eval {
318
                eval {
319
                    C4::Members::Attributes::DeleteBorrowerAttribute( $borrowernumber, $attribute );
319
                    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 23166