From b38546f1d150edaf85180d4be2aa68df42674f27 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 30 Dec 2019 08:04:29 -0500 Subject: [PATCH] Bug 24279: Claims Returned does not work when set from additem.pl Test Plan: 1) Configure Claimes Returned 2) Apply this patch 3) Go to additem.pl for that item 4) Note the claims returned lost status does not show in the lost status pulldown Signed-off-by: Katrin Fischer Signed-off-by: Marcel de Rooy Signed-off-by: Jonathan Druart --- cataloguing/additem.pl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl index 130ff0a3f2..9f375370fa 100755 --- a/cataloguing/additem.pl +++ b/cataloguing/additem.pl @@ -170,7 +170,17 @@ sub generate_subfield_form { my @authorised_values; my %authorised_lib; # builds list, depending on authorised value... - if ( $subfieldlib->{authorised_value} eq "branches" ) { + if ( $subfieldlib->{authorised_value} eq "LOST" ) { + my $ClaimReturnedLostValue = C4::Context->preference('ClaimReturnedLostValue'); + push @authorised_values, qq{}; + my $av = GetAuthorisedValues( $subfieldlib->{authorised_value} ); + for my $r ( @$av ) { + next if $ClaimReturnedLostValue && $r->{authorised_value} eq $ClaimReturnedLostValue; + push @authorised_values, $r->{authorised_value}; + $authorised_lib{$r->{authorised_value}} = $r->{lib}; + } + } + elsif ( $subfieldlib->{authorised_value} eq "branches" ) { foreach my $thisbranch (@$branches) { push @authorised_values, $thisbranch->{branchcode}; $authorised_lib{$thisbranch->{branchcode}} = $thisbranch->{branchname}; -- 2.39.5