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

(-)a/C4/ImportBatch.pm (-19 lines)
Lines 192-215 sub GetImportRecordMarc { Link Here
192
    return $marc, $encoding;
192
    return $marc, $encoding;
193
}
193
}
194
194
195
sub EmbedItemsInImportBiblio {
196
    my ( $record, $import_record_id ) = @_;
197
    my ( $itemtag, $itemsubfield ) = GetMarcFromKohaField( "items.itemnumber" );
198
    my $dbh = C4::Context->dbh;
199
    my $import_items = $dbh->selectall_arrayref(q|
200
        SELECT import_items.marcxml
201
        FROM import_items
202
        WHERE import_record_id = ?
203
    |, { Slice => {} }, $import_record_id );
204
    my @item_fields;
205
    for my $import_item ( @$import_items ) {
206
        my $item_marc = MARC::Record::new_from_xml($import_item->{marcxml}, 'UTF-8');
207
        push @item_fields, $item_marc->field($itemtag);
208
    }
209
    $record->append_fields(@item_fields);
210
    return $record;
211
}
212
213
=head2 AddImportBatch
195
=head2 AddImportBatch
214
196
215
  my $batch_id = AddImportBatch($params_hash);
197
  my $batch_id = AddImportBatch($params_hash);
216
- 

Return to bug 38279