View | Details | Raw Unified | Return to bug 6875
Collapse All | Expand All

(-)a/C4/Biblio.pm (-39 lines)
Lines 2876-2920 sub _AddBiblioNoZebra { Link Here
2876
    return %result;
2876
    return %result;
2877
}
2877
}
2878
2878
2879
=head2 _find_value
2880
2881
  ($indicators, $value) = _find_value($tag, $subfield, $record,$encoding);
2882
2883
Find the given $subfield in the given $tag in the given
2884
MARC::Record $record.  If the subfield is found, returns
2885
the (indicators, value) pair; otherwise, (undef, undef) is
2886
returned.
2887
2888
PROPOSITION :
2889
Such a function is used in addbiblio AND additem and serial-edit and maybe could be used in Authorities.
2890
I suggest we export it from this module.
2891
2892
=cut
2893
2894
sub _find_value {
2895
    my ( $tagfield, $insubfield, $record, $encoding ) = @_;
2896
    my @result;
2897
    my $indicator;
2898
    if ( $tagfield < 10 ) {
2899
        if ( $record->field($tagfield) ) {
2900
            push @result, $record->field($tagfield)->data();
2901
        } else {
2902
            push @result, "";
2903
        }
2904
    } else {
2905
        foreach my $field ( $record->field($tagfield) ) {
2906
            my @subfields = $field->subfields();
2907
            foreach my $subfield (@subfields) {
2908
                if ( @$subfield[0] eq $insubfield ) {
2909
                    push @result, @$subfield[1];
2910
                    $indicator = $field->indicator(1) . $field->indicator(2);
2911
                }
2912
            }
2913
        }
2914
    }
2915
    return ( $indicator, @result );
2916
}
2917
2918
=head2 _koha_marc_update_bib_ids
2879
=head2 _koha_marc_update_bib_ids
2919
2880
2920
2881
(-)a/C4/Items.pm (-1 / +39 lines)
Lines 2491-2496 sub GetItemHolds { Link Here
2491
}
2491
}
2492
=head1  OTHER FUNCTIONS
2492
=head1  OTHER FUNCTIONS
2493
2493
2494
=head2 _find_value
2495
2496
  ($indicators, $value) = _find_value($tag, $subfield, $record,$encoding);
2497
2498
Find the given $subfield in the given $tag in the given
2499
MARC::Record $record.  If the subfield is found, returns
2500
the (indicators, value) pair; otherwise, (undef, undef) is
2501
returned.
2502
2503
PROPOSITION :
2504
Such a function is used in addbiblio AND additem and serial-edit and maybe could be used in Authorities.
2505
I suggest we export it from this module.
2506
2507
=cut
2508
2509
sub _find_value {
2510
    my ( $tagfield, $insubfield, $record, $encoding ) = @_;
2511
    my @result;
2512
    my $indicator;
2513
    if ( $tagfield < 10 ) {
2514
        if ( $record->field($tagfield) ) {
2515
            push @result, $record->field($tagfield)->data();
2516
        } else {
2517
            push @result, "";
2518
        }
2519
    } else {
2520
        foreach my $field ( $record->field($tagfield) ) {
2521
            my @subfields = $field->subfields();
2522
            foreach my $subfield (@subfields) {
2523
                if ( @$subfield[0] eq $insubfield ) {
2524
                    push @result, @$subfield[1];
2525
                    $indicator = $field->indicator(1) . $field->indicator(2);
2526
                }
2527
            }
2528
        }
2529
    }
2530
    return ( $indicator, @result );
2531
}
2532
2494
2533
2495
=head2 PrepareItemrecordDisplay
2534
=head2 PrepareItemrecordDisplay
2496
2535
2497
- 

Return to bug 6875