From 04dc662eba4f467daf0b89e0a8fe00b1fa210283 Mon Sep 17 00:00:00 2001 From: Lisette Scheer Date: Tue, 18 Nov 2025 02:47:21 +0000 Subject: [PATCH] Bug 32748: (QA follow-up) Fix spelling and tidy --- C4/Koha.pm | 12 ++++++------ Koha/UI/Form/Builder/Item.pm | 8 ++++---- .../intranet-tmpl/prog/en/includes/html_helpers.inc | 8 ++++++-- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/C4/Koha.pm b/C4/Koha.pm index e6fe6e75d46..b0d025de195 100644 --- a/C4/Koha.pm +++ b/C4/Koha.pm @@ -509,8 +509,8 @@ C<$opac> If set to a true value, displays OPAC descriptions rather than normal o =cut sub GetAuthorisedValues { - my $category = shift // ''; # optional parameter - my $opac = shift ? 1 : 0; # normalise to be safe + my $category = shift // ''; # optional parameter + my $opac = shift ? 1 : 0; # normalise to be safe my $options = shift // ''; my $no_limit; if ($options) { $no_limit = $options->{'no_limit'}; } #optional parameter to ignore library limitation @@ -523,7 +523,7 @@ sub GetAuthorisedValues { return $result if $result; my @results; - my $dbh = C4::Context->dbh; + my $dbh = C4::Context->dbh; my $select_clause = 'SELECT av.*'; my @where_args; @@ -540,7 +540,7 @@ sub GetAuthorisedValues { LEFT JOIN authorised_values_branches ON ( id = av_id ) } if $branch_limit; my @where_strings; - if($category) { + if ($category) { push @where_strings, "category = ?"; push @where_args, $category; } @@ -550,8 +550,8 @@ sub GetAuthorisedValues { 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 6a16e8317e4..35b50193989 100644 --- a/Koha/UI/Form/Builder/Item.pm +++ b/Koha/UI/Form/Builder/Item.pm @@ -210,12 +210,12 @@ sub generate_subfield_form { } else { $filtered_itemtypes = $all_itemtypes; } - while (my $itemtype = $filtered_itemtypes->next) { + while ( my $itemtype = $filtered_itemtypes->next ) { push @authorised_values, $itemtype->itemtype; $authorised_lib{ $itemtype->itemtype } = $itemtype->translated_description; } - while (my $itemtype = $all_itemtypes->next) { - if (!grep { $_ eq $itemtype->itemtype } @authorised_values) { + while ( my $itemtype = $all_itemtypes->next ) { + if ( !grep { $_ eq $itemtype->itemtype } @authorised_values ) { $restricted_values{ $itemtype->itemtype } = $itemtype->translated_description; } } @@ -255,7 +255,7 @@ sub generate_subfield_form { my $av = GetAuthorisedValues( $subfield->{authorised_value}, undef, { 'no_limit' => 1 } ); for my $r (@$av) { push @authorised_values, $r->{authorised_value}; - $authorised_lib{ $r->{authorised_value} } = $r->{lib}; + $authorised_lib{ $r->{authorised_value} } = $r->{lib}; $restricted_values{ $r->{authorised_value} } = $r->{restricted}; } } diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc index 6515b51f4ab..cb299962b2d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc @@ -136,7 +136,9 @@ [% IF aval == mv.default %] [% SET matched = 1 %] [% IF mv.restricted.$aval %] - + [% ELSE %] [% END %] @@ -157,7 +159,9 @@ [% IF mv.restricted %] [% FOREACH code IN mv.restricted.keys %] [% IF mv.default == code %] - + [% END %] [% END %] [% END %] -- 2.39.5