Bug 32748: (QA follow-up) Fix spelling and tidy

Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
Lisette Scheer 2025-11-18 02:47:21 +00:00 committed by Pedro Amorim
parent b443b31998
commit 5205fc8bcc
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
3 changed files with 16 additions and 12 deletions

View File

@ -503,8 +503,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
@ -517,7 +517,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;
@ -534,7 +534,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;
}
@ -544,8 +544,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, '
. (

View File

@ -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};
}
}

View File

@ -136,7 +136,9 @@
[% IF aval == mv.default %]
[% SET matched = 1 %]
[% IF mv.restricted.$aval %]
<option value="[%- aval | html -%]" selected="selected" style="float:right" title="This value ([%- mv.labels.$aval | html -%]) is limited to other librairies">[%- mv.labels.$aval | html -%] &#9888;</option>
<option value="[%- aval | html -%]" selected="selected" style="float:right" title="This value ([%- mv.labels.$aval | html -%]) is limited to other libraries"
>[%- mv.labels.$aval | html -%] &#9888;</option
>
[% ELSE %]
<option value="[%- aval | html -%]" selected="selected">[%- mv.labels.$aval | html -%]</option>
[% END %]
@ -157,7 +159,9 @@
[% IF mv.restricted %]
[% FOREACH code IN mv.restricted.keys %]
[% IF mv.default == code %]
<option value="[%- code | html -%]" selected="selected" style="float:right" title="This value ([%- mv.restricted.$code | html -%]) is limited to other librairies">[%- mv.restricted.$code | html -%] &#9888;</option>
<option value="[%- code | html -%]" selected="selected" style="float:right" title="This value ([%- mv.restricted.$code | html -%]) is limited to other libraries"
>[%- mv.restricted.$code | html -%] &#9888;</option
>
[% END %]
[% END %]
[% END %]