From 50bbbf3a489baeb095f7c3c419efd11973f8f24b Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Fri, 28 Jul 2023 12:20:05 +0000 Subject: [PATCH] Bug 32748: (follow-up) Perltidy --- C4/Koha.pm | 9 ++++++--- Koha/UI/Form/Builder/Item.pm | 22 +++++++++------------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/C4/Koha.pm b/C4/Koha.pm index 9049c4e9de..49f0df55b6 100644 --- a/C4/Koha.pm +++ b/C4/Koha.pm @@ -503,10 +503,11 @@ sub GetAuthorisedValues { my $dbh = C4::Context->dbh; my $select_clause = 'SELECT av.*'; my @where_args; - if ($branch_limit && $no_limit) { + if ( $branch_limit && $no_limit ) { $select_clause .= ', IF (branchcode = ? OR branchcode IS NULL, 0, 1) as restricted'; push @where_args, $branch_limit; } + my $query = qq{ $select_clause FROM authorised_values av @@ -519,10 +520,12 @@ sub GetAuthorisedValues { push @where_strings, "category = ?"; push @where_args, $category; } - if($branch_limit && !defined $no_limit) { + + if ( $branch_limit && !defined $no_limit ) { push @where_strings, "( branchcode = ? OR branchcode IS NULL )"; - push @where_args, $branch_limit; + push @where_args, $branch_limit; } + if(@where_strings > 0) { $query .= " WHERE " . join(" AND ", @where_strings); } diff --git a/Koha/UI/Form/Builder/Item.pm b/Koha/UI/Form/Builder/Item.pm index 180b6f8ba6..7c13a4a48d 100644 --- a/Koha/UI/Form/Builder/Item.pm +++ b/Koha/UI/Form/Builder/Item.pm @@ -277,24 +277,20 @@ sub generate_subfield_form { } else { $subfield_data{marc_value} = { - type => 'select', - id => "tag_" - . $tag - . "_subfield_" - . $subfieldtag . "_" - . $index_subfield, - values => \@authorised_values, - labels => \%authorised_lib, + type => 'select', + id => "tag_" . $tag . "_subfield_" . $subfieldtag . "_" . $index_subfield, + values => \@authorised_values, + labels => \%authorised_lib, restricted => \%authorised_restricted, - default => $value, + default => $value, ( - ( - grep { $_ eq $subfield->{authorised_value} } - (qw(branches itemtypes cn_source)) - ) ? () : ( category => $subfield->{authorised_value} ) + ( grep { $_ eq $subfield->{authorised_value} } (qw(branches itemtypes cn_source)) ) + ? () + : ( category => $subfield->{authorised_value} ) ), }; } + } # it's a thesaurus / authority field -- 2.30.2