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

(-)a/C4/Koha.pm (-4 / +7 lines)
Lines 527-536 sub GetAuthorisedValues { Link Here
527
    
527
    
528
    my $select_clause = 'SELECT av.*';
528
    my $select_clause = 'SELECT av.*';
529
    my @where_args;
529
    my @where_args;
530
    if ($branch_limit && $no_limit) {
530
    if ( $branch_limit && $no_limit ) {
531
        $select_clause .= ', IF (branchcode = ? OR branchcode IS NULL, 0, 1) as restricted';
531
        $select_clause .= ', IF (branchcode = ? OR branchcode IS NULL, 0, 1) as restricted';
532
        push @where_args, $branch_limit;
532
        push @where_args, $branch_limit;
533
    }
533
    }
534
534
    my $query = qq{
535
    my $query = qq{
535
        $select_clause
536
        $select_clause
536
        FROM authorised_values av
537
        FROM authorised_values av
Lines 543-554 sub GetAuthorisedValues { Link Here
543
        push @where_strings, "category = ?";
544
        push @where_strings, "category = ?";
544
        push @where_args,    $category;
545
        push @where_args,    $category;
545
    }
546
    }
546
    if($branch_limit && !defined $no_limit) {
547
548
    if ( $branch_limit && !defined $no_limit ) {
547
        push @where_strings, "( branchcode = ? OR branchcode IS NULL )";
549
        push @where_strings, "( branchcode = ? OR branchcode IS NULL )";
548
        push @where_args,    $branch_limit;
550
        push @where_args,    $branch_limit;
549
    }
551
    }
550
    if ( @where_strings > 0 ) {
552
551
        $query .= " WHERE " . join( " AND ", @where_strings );
553
    if(@where_strings > 0) {
554
        $query .= " WHERE " . join(" AND ", @where_strings);
552
    }
555
    }
553
    $query .= ' ORDER BY category, '
556
    $query .= ' ORDER BY category, '
554
        . (
557
        . (
(-)a/Koha/UI/Form/Builder/Item.pm (-6 / +6 lines)
Lines 269-280 sub generate_subfield_form { Link Here
269
            };
269
            };
270
        } else {
270
        } else {
271
            $subfield_data{marc_value} = {
271
            $subfield_data{marc_value} = {
272
                type    => 'select',
272
                type       => 'select',
273
                id      => "tag_" . $tag . "_subfield_" . $subfieldtag . "_" . $index_subfield,
273
                id         => "tag_" . $tag . "_subfield_" . $subfieldtag . "_" . $index_subfield,
274
                values  => \@authorised_values,
274
                values     => \@authorised_values,
275
                labels  => \%authorised_lib,
275
                labels     => \%authorised_lib,
276
                restricted => \%authorised_restricted,
276
                restricted => \%authorised_restricted,
277
                default => $value,
277
                default    => $value,
278
                (
278
                (
279
                      ( grep { $_ eq $subfield->{authorised_value} } (qw(branches itemtypes cn_source)) )
279
                      ( grep { $_ eq $subfield->{authorised_value} } (qw(branches itemtypes cn_source)) )
280
                    ? ()
280
                    ? ()
Lines 282-287 sub generate_subfield_form { Link Here
282
                ),
282
                ),
283
            };
283
            };
284
        }
284
        }
285
285
    }
286
    }
286
287
287
    # it's a thesaurus / authority field
288
    # it's a thesaurus / authority field
288
- 

Return to bug 32748