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

(-)a/Koha/Exporter/Record.pm (-3 / +14 lines)
Lines 122-136 sub _get_biblio_for_export { Link Here
122
    my $export_items = $params->{export_items} // 1;
122
    my $export_items = $params->{export_items} // 1;
123
    my $only_export_items_for_branches = $params->{only_export_items_for_branches};
123
    my $only_export_items_for_branches = $params->{only_export_items_for_branches};
124
    my $embed_see_from_headings = $params->{embed_see_from_headings};
124
    my $embed_see_from_headings = $params->{embed_see_from_headings};
125
    my $embed_see_also_from_headings = $params->{embed_see_also_from_headings};
125
126
126
    my $biblio = Koha::Biblios->find($biblionumber);
127
    my $biblio = Koha::Biblios->find($biblionumber);
127
    my $record = eval { $biblio->metadata->record };
128
    my $record = eval { $biblio->metadata->record };
128
129
129
    return if $@ or not defined $record;
130
    return if $@ or not defined $record;
130
131
131
    if ($embed_see_from_headings) {
132
    if ( $embed_see_from_headings || $embed_see_also_from_headings ) {
132
        my $record_processor = Koha::RecordProcessor->new( { filters => 'EmbedSeeFromHeadings' } );
133
        my @esfh_fields;
133
        $record_processor->process($record);
134
        push @esfh_fields, '4..' if $embed_see_from_headings;
135
        push @esfh_fields, '5..' if $embed_see_also_from_headings;
136
        my $esfh_record_processor = Koha::RecordProcessor->new(
137
            {
138
                filters => 'EmbedSeeFromHeadings',
139
                options => {
140
                    auth_fields => \@esfh_fields,
141
                }
142
            }
143
        );
144
        $esfh_record_processor->process($record);
134
    }
145
    }
135
146
136
    if ($export_items) {
147
    if ($export_items) {
(-)a/Koha/Filter/MARC/EmbedSeeFromHeadings.pm (-1 / +4 lines)
Lines 88-93 include in facets, sorting, or suggestion fields) Link Here
88
sub fields {
88
sub fields {
89
    my ($self, $record) = @_;
89
    my ($self, $record) = @_;
90
90
91
    my $params = $self->params;
92
    my $auth_fields = $params->{options}->{auth_fields} || [ '4..' ];
93
91
    my ($item_tag) = GetMarcFromKohaField( "items.itemnumber" );
94
    my ($item_tag) = GetMarcFromKohaField( "items.itemnumber" );
92
    $item_tag ||= '';
95
    $item_tag ||= '';
93
96
Lines 102-108 sub fields { Link Here
102
        my $authority = Koha::MetadataRecord::Authority->get_from_authid($authid);
105
        my $authority = Koha::MetadataRecord::Authority->get_from_authid($authid);
103
        next unless $authority;
106
        next unless $authority;
104
        my $auth_marc = $authority->record;
107
        my $auth_marc = $authority->record;
105
        my @seefrom = $auth_marc->field('4..');
108
        my @seefrom = $auth_marc->field(@$auth_fields);
106
        foreach my $authfield (@seefrom) {
109
        foreach my $authfield (@seefrom) {
107
            my $tag = substr($field->tag(), 0, 1) . substr($authfield->tag(), 1, 2);
110
            my $tag = substr($field->tag(), 0, 1) . substr($authfield->tag(), 1, 2);
108
            next if MARC::Field->is_controlfield_tag($tag);
111
            next if MARC::Field->is_controlfield_tag($tag);
(-)a/misc/export_records.pl (-1 / +7 lines)
Lines 55-60 my ( Link Here
55
    $end_accession,
55
    $end_accession,
56
    $marc_conditions,
56
    $marc_conditions,
57
    $embed_see_from_headings,
57
    $embed_see_from_headings,
58
    $embed_see_also_from_headings,
58
    $help
59
    $help
59
);
60
);
60
61
Lines 80-85 GetOptions( Link Here
80
    'end_accession=s'         => \$end_accession,
81
    'end_accession=s'         => \$end_accession,
81
    'marc_conditions=s'       => \$marc_conditions,
82
    'marc_conditions=s'       => \$marc_conditions,
82
    'embed_see_from_headings' => \$embed_see_from_headings,
83
    'embed_see_from_headings' => \$embed_see_from_headings,
84
    'embed_see_also_from_headings' => \$embed_see_also_from_headings,
83
    'h|help|?'                => \$help
85
    'h|help|?'                => \$help
84
) || pod2usage(1);
86
) || pod2usage(1);
85
87
Lines 259-264 else { Link Here
259
            export_items       => (not $dont_export_items),
261
            export_items       => (not $dont_export_items),
260
            clean              => $clean || 0,
262
            clean              => $clean || 0,
261
            embed_see_from_headings => $embed_see_from_headings || 0,
263
            embed_see_from_headings => $embed_see_from_headings || 0,
264
            embed_see_also_from_headings => $embed_see_also_from_headings || 0,
262
        }
265
        }
263
    );
266
    );
264
}
267
}
Lines 392-397 Print a brief help message. Link Here
392
395
393
 --embed_see_from_headings      Embed see from (non-preferred form) headings in bibliographic record.
396
 --embed_see_from_headings      Embed see from (non-preferred form) headings in bibliographic record.
394
397
398
=item B<--embed_see_also_from_headings>
399
400
 --embed_see_also_from_headings Embed see also from (non-preferred form) headings in bibliographic record.
401
395
=back
402
=back
396
403
397
=head1 AUTHOR
404
=head1 AUTHOR
398
- 

Return to bug 32509