From b74f8cfab7c3deacc8cb14ff1bda26c562d564ca Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Wed, 11 Jun 2008 16:38:14 -0500 Subject: [PATCH] code cleanup - remove unused find_values() copy and paste The find_values() function in authorities/authorities.pl and authorities/detail.pl is not used; appears to be copied from additem.pl. No documentation changes. Signed-off-by: Joshua Ferraro --- authorities/authorities.pl | 35 ----------------------------------- authorities/detail.pl | 35 ----------------------------------- 2 files changed, 70 deletions(-) diff --git a/authorities/authorities.pl b/authorities/authorities.pl index ef857fb9e5..59acbb8b18 100755 --- a/authorities/authorities.pl +++ b/authorities/authorities.pl @@ -35,41 +35,6 @@ use vars qw( $is_a_modif ); my $itemtype; # created here because it can be used in build_authorized_values_list sub our($authorised_values_sth,$is_a_modif,$usedTagsLib,$mandatory_z3950); -=item find_value - - ($indicators, $value) = find_value($tag, $subfield, $record,$encoding); - -Find the given $subfield in the given $tag in the given -MARC::Record $record. If the subfield is found, returns -the (indicators, value) pair; otherwise, (undef, undef) is -returned. - -=cut - -sub find_value { - my ($tagfield,$insubfield,$record,$encoding) = @_; - my @result; - my $indicator; - if ($tagfield <10) { - if ($record->field($tagfield)) { - push @result, $record->field($tagfield)->data(); - } else { - push @result,""; - } - } else { - foreach my $field ($record->field($tagfield)) { - my @subfields = $field->subfields(); - foreach my $subfield (@subfields) { - if (@$subfield[0] eq $insubfield) { - push @result,@$subfield[1]; - $indicator = $field->indicator(1).$field->indicator(2); - } - } - } - } - return($indicator,@result); -} - =item build_authorized_values_list diff --git a/authorities/detail.pl b/authorities/detail.pl index 2ed7f27230..7dc1978c42 100755 --- a/authorities/detail.pl +++ b/authorities/detail.pl @@ -51,41 +51,6 @@ use C4::Koha; # use C4::Catalogue; our ($tagslib); -=item find_value - - ($indicators, $value) = find_value($tag, $subfield, $record,$encoding); - -Find the given $subfield in the given $tag in the given -MARC::Record $record. If the subfield is found, returns -the (indicators, value) pair; otherwise, (undef, undef) is -returned. - -=cut - -sub find_value { - my ($tagfield,$insubfield,$record,$encoding) = @_; - my @result; - my $indicator; - if ($tagfield <10) { - if ($record->field($tagfield)) { - push @result, $record->field($tagfield)->data(); - } else { - push @result,""; - } - } else { - foreach my $field ($record->field($tagfield)) { - my @subfields = $field->subfields(); - foreach my $subfield (@subfields) { - if (@$subfield[0] eq $insubfield) { - push @result,@$subfield[1]; - $indicator = $field->indicator(1).$field->indicator(2); - } - } - } - } - return($indicator,@result); -} - =item build_authorized_values_list -- 2.39.5