From ba72072eccff4add29a6d4cdf01bfcde2ddf903c 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 Signed-off-by: Mathieu Saby --- C4/Koha.pm | 11 +++++++---- Koha/UI/Form/Builder/Item.pm | 11 ++++++----- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/C4/Koha.pm b/C4/Koha.pm index 0060f7578a..5d6af652e0 100644 --- a/C4/Koha.pm +++ b/C4/Koha.pm @@ -527,10 +527,11 @@ sub GetAuthorisedValues { 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 @@ -543,12 +544,14 @@ 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; } - if ( @where_strings > 0 ) { - $query .= " WHERE " . join( " AND ", @where_strings ); + + if(@where_strings > 0) { + $query .= " WHERE " . join(" AND ", @where_strings); } $query .= ' ORDER BY category, ' . ( diff --git a/Koha/UI/Form/Builder/Item.pm b/Koha/UI/Form/Builder/Item.pm index 6b03170418..a71b563c0b 100644 --- a/Koha/UI/Form/Builder/Item.pm +++ b/Koha/UI/Form/Builder/Item.pm @@ -269,12 +269,12 @@ 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)) ) ? () @@ -282,6 +282,7 @@ sub generate_subfield_form { ), }; } + } # it's a thesaurus / authority field -- 2.39.5