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

(-)a/C4/ImportBatch.pm (-31 lines)
Lines 48-55 BEGIN { Link Here
48
      GetZ3950BatchId
48
      GetZ3950BatchId
49
      GetWebserviceBatchId
49
      GetWebserviceBatchId
50
      GetImportRecordMarc
50
      GetImportRecordMarc
51
      GetImportRecordMarcXML
52
      GetRecordFromImportBiblio
53
      AddImportBatch
51
      AddImportBatch
54
      GetImportBatch
52
      GetImportBatch
55
      AddAuthToBatch
53
      AddAuthToBatch
Lines 193-209 sub GetImportRecordMarc { Link Here
193
    return $marc, $encoding;
191
    return $marc, $encoding;
194
}
192
}
195
193
196
sub GetRecordFromImportBiblio {
197
    my ( $import_record_id, $embed_items ) = @_;
198
199
    my ($marc) = GetImportRecordMarc($import_record_id);
200
    my $record = MARC::Record->new_from_usmarc($marc);
201
202
    EmbedItemsInImportBiblio( $record, $import_record_id ) if $embed_items;
203
204
    return $record;
205
}
206
207
sub EmbedItemsInImportBiblio {
194
sub EmbedItemsInImportBiblio {
208
    my ( $record, $import_record_id ) = @_;
195
    my ( $record, $import_record_id ) = @_;
209
    my ( $itemtag, $itemsubfield ) = GetMarcFromKohaField( "items.itemnumber" );
196
    my ( $itemtag, $itemsubfield ) = GetMarcFromKohaField( "items.itemnumber" );
Lines 222-245 sub EmbedItemsInImportBiblio { Link Here
222
    return $record;
209
    return $record;
223
}
210
}
224
211
225
=head2 GetImportRecordMarcXML
226
227
  my $marcxml = GetImportRecordMarcXML($import_record_id);
228
229
=cut
230
231
sub GetImportRecordMarcXML {
232
    my ($import_record_id) = @_;
233
234
    my $dbh = C4::Context->dbh;
235
    my $sth = $dbh->prepare("SELECT marcxml FROM import_records WHERE import_record_id = ?");
236
    $sth->execute($import_record_id);
237
    my ($marcxml) = $sth->fetchrow();
238
    $sth->finish();
239
    return $marcxml;
240
241
}
242
243
=head2 AddImportBatch
212
=head2 AddImportBatch
244
213
245
  my $batch_id = AddImportBatch($params_hash);
214
  my $batch_id = AddImportBatch($params_hash);
(-)a/Koha/Import/Record.pm (+35 lines)
Lines 18-24 package Koha::Import::Record; Link Here
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Carp;
20
use Carp;
21
use MARC::Record;
21
22
23
use C4::Context;
22
use Koha::Database;
24
use Koha::Database;
23
25
24
use base qw(Koha::Object);
26
use base qw(Koha::Object);
Lines 29-34 Koha::Import::Record - Koha Import Record Object class Link Here
29
31
30
=head1 API
32
=head1 API
31
33
34
=head2 Public methods
35
36
=head3 get_marc_record
37
38
Returns a MARC::Record object
39
40
    my $marc_record = $import_record->get_marc_record({ embed_items => $embed_items })
41
42
If $embed_items is true then items from import_items are embedded into the
43
MARC::Record returned
44
45
=cut
46
47
sub get_marc_record {
48
    my ($self, $args) = @_;
49
50
    my $marcflavour = C4::Context->preference('marcflavour');
51
52
    my $format = $marcflavour eq 'UNIMARC' ? 'UNIMARC' : 'USMARC';
53
    if ($marcflavour eq 'UNIMARC' && $self->record_type eq 'auth') {
54
        $format = 'UNIMARCAUTH';
55
    }
56
57
    my $record = MARC::Record->new_from_xml($self->marcxml, $self->encoding, $format);
58
59
    if ($self->record_type eq 'biblio' && $args->{embed_items}) {
60
        require C4::ImportBatch;
61
        C4::ImportBatch::EmbedItemsInImportBiblio($record, $self->id);
62
    }
63
64
    return $record;
65
}
66
32
=head2 Internal methods
67
=head2 Internal methods
33
68
34
=head3 _type
69
=head3 _type
(-)a/authorities/authorities.pl (-26 / +12 lines)
Lines 24-36 use CGI qw ( -utf8 ); Link Here
24
use C4::Auth qw( get_template_and_user );
24
use C4::Auth qw( get_template_and_user );
25
use C4::Output qw( output_html_with_http_headers );
25
use C4::Output qw( output_html_with_http_headers );
26
use C4::AuthoritiesMarc qw( AddAuthority ModAuthority GetAuthority GetTagsLabels GetAuthMARCFromKohaField FindDuplicateAuthority );
26
use C4::AuthoritiesMarc qw( AddAuthority ModAuthority GetAuthority GetTagsLabels GetAuthMARCFromKohaField FindDuplicateAuthority );
27
use C4::ImportBatch qw( GetImportRecordMarc );
28
use C4::Context;
27
use C4::Context;
29
use Date::Calc qw( Today );
28
use Date::Calc qw( Today );
30
use MARC::File::USMARC;
29
use MARC::File::USMARC;
31
use MARC::File::XML;
30
use MARC::File::XML;
32
use C4::Biblio qw( TransformHtmlToMarc );
31
use C4::Biblio qw( TransformHtmlToMarc );
33
use Koha::Authority::Types;
32
use Koha::Authority::Types;
33
use Koha::Import::Records;
34
use Koha::ItemTypes;
34
use Koha::ItemTypes;
35
use vars qw( $tagslib);
35
use vars qw( $tagslib);
36
use vars qw( $authorised_values_sth);
36
use vars qw( $authorised_values_sth);
Lines 48-68 builds list, depending on authorised value... Link Here
48
48
49
=cut
49
=cut
50
50
51
sub MARCfindbreeding_auth {
52
    my ( $id ) = @_;
53
    my ($marc, $encoding) = GetImportRecordMarc($id);
54
    if ($marc) {
55
        my $record = MARC::Record->new_from_usmarc($marc);
56
        if ( !defined(ref($record)) ) {
57
                return -1;
58
        } else {
59
            return $record, $encoding;
60
        }
61
    } else {
62
        return -1;
63
    }
64
}
65
66
sub build_authorized_values_list {
51
sub build_authorized_values_list {
67
    my ( $tag, $subfield, $value, $dbh, $authorised_values_sth,$index_tag,$index_subfield ) = @_;
52
    my ( $tag, $subfield, $value, $dbh, $authorised_values_sth,$index_tag,$index_subfield ) = @_;
68
53
Lines 329-335 sub GetMandatoryFieldZ3950 { Link Here
329
}
314
}
330
315
331
sub build_tabs {
316
sub build_tabs {
332
    my ( $template, $record, $dbh, $encoding,$input ) = @_;
317
    my ( $template, $record, $dbh, $input ) = @_;
333
318
334
    # fill arrays
319
    # fill arrays
335
    my @loop_data = ();
320
    my @loop_data = ();
Lines 365-371 sub build_tabs { Link Here
365
350
366
            # if MARC::Record is not empty =>use it as master loop, then add missing subfields that should be in the tab.
351
            # if MARC::Record is not empty =>use it as master loop, then add missing subfields that should be in the tab.
367
            # if MARC::Record is empty => use tab as master loop.
352
            # if MARC::Record is empty => use tab as master loop.
368
            if ( $record != -1 && ( $record->field($tag) || $tag eq '000' ) ) {
353
            if ( $record && ( $record->field($tag) || $tag eq '000' ) ) {
369
                my @fields;
354
                my @fields;
370
                if ( $tag ne '000' ) {
355
                if ( $tag ne '000' ) {
371
                                @fields = $record->field($tag);
356
                                @fields = $record->field($tag);
Lines 571-583 $template->param(nonav => $nonav,index=>$myindex,authtypecode=>$authtypecode,b Link Here
571
$tagslib = GetTagsLabels(1,$authtypecode);
556
$tagslib = GetTagsLabels(1,$authtypecode);
572
$mandatory_z3950 = GetMandatoryFieldZ3950($authtypecode);
557
$mandatory_z3950 = GetMandatoryFieldZ3950($authtypecode);
573
558
574
my $record=-1;
559
my $record;
575
my $encoding="";
576
if (($authid) && !($breedingid)){
577
    $record = GetAuthority($authid);
578
}
579
if ($breedingid) {
560
if ($breedingid) {
580
    ( $record, $encoding ) = MARCfindbreeding_auth( $breedingid );
561
    my $import_record = Koha::Import::Records->find($breedingid);
562
    if ($import_record) {
563
        $record = $import_record->get_marc_record();
564
    }
565
} elsif ($authid) {
566
    $record = GetAuthority($authid);
581
}
567
}
582
568
583
my ($oldauthnumtagfield,$oldauthnumtagsubfield);
569
my ($oldauthnumtagfield,$oldauthnumtagsubfield);
Lines 619-625 if ($op eq "add") { Link Here
619
        exit;
605
        exit;
620
    } else {
606
    } else {
621
    # it may be a duplicate, warn the user and do nothing
607
    # it may be a duplicate, warn the user and do nothing
622
        build_tabs($template, $record, $dbh, $encoding,$input);
608
        build_tabs($template, $record, $dbh, $input);
623
        build_hidden_data;
609
        build_hidden_data;
624
        $template->param(authid =>$authid,
610
        $template->param(authid =>$authid,
625
                        duplicateauthid     => $duplicateauthid,
611
                        duplicateauthid     => $duplicateauthid,
Lines 640-646 if ($op eq "duplicate") Link Here
640
        {
626
        {
641
                $authid = "";
627
                $authid = "";
642
        }
628
        }
643
        build_tabs ($template, $record, $dbh,$encoding,$input);
629
        build_tabs ($template, $record, $dbh, $input);
644
        build_hidden_data;
630
        build_hidden_data;
645
        $template->param(oldauthtypetagfield=>$oldauthtypetagfield, oldauthtypetagsubfield=>$oldauthtypetagsubfield,
631
        $template->param(oldauthtypetagfield=>$oldauthtypetagfield, oldauthtypetagsubfield=>$oldauthtypetagsubfield,
646
                        oldauthnumtagfield=>$oldauthnumtagfield, oldauthnumtagsubfield=>$oldauthnumtagsubfield,
632
                        oldauthnumtagfield=>$oldauthnumtagfield, oldauthnumtagsubfield=>$oldauthnumtagsubfield,
(-)a/catalogue/showmarc.pl (-5 / +16 lines)
Lines 31-39 use C4::Context; Link Here
31
use C4::Output qw( output_html_with_http_headers );
31
use C4::Output qw( output_html_with_http_headers );
32
use C4::Auth qw( get_template_and_user );
32
use C4::Auth qw( get_template_and_user );
33
use C4::Biblio qw( GetMarcBiblio GetXmlBiblio );
33
use C4::Biblio qw( GetMarcBiblio GetXmlBiblio );
34
use C4::ImportBatch qw( GetRecordFromImportBiblio );
35
use C4::XSLT;
34
use C4::XSLT;
36
35
36
use Koha::Import::Records;
37
37
my $input= CGI->new;
38
my $input= CGI->new;
38
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
39
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
39
  {
40
  {
Lines 48-56 my $biblionumber= $input->param('id'); Link Here
48
my $importid= $input->param('importid');
49
my $importid= $input->param('importid');
49
my $view= $input->param('viewas')||'';
50
my $view= $input->param('viewas')||'';
50
51
52
my $marcflavour = C4::Context->preference('marcflavour');
53
51
my $record;
54
my $record;
55
my $record_type = 'biblio';
56
my $format = $marcflavour eq 'UNIMARC' ? 'UNIMARC' : 'USMARC';
52
if ($importid) {
57
if ($importid) {
53
    $record = C4::ImportBatch::GetRecordFromImportBiblio( $importid, 'embed_items' );
58
    my $import_record = Koha::Import::Records->find($importid);
59
    if ($import_record) {
60
        if ($marcflavour eq 'UNIMARC' && $import_record->record_type eq 'auth') {
61
            $format = 'UNIMARCAUTH';
62
        }
63
64
        $record = $import_record->get_marc_record({ embed_items => 1 });
65
    }
54
}
66
}
55
else {
67
else {
56
    $record =GetMarcBiblio({ biblionumber => $biblionumber });
68
    $record =GetMarcBiblio({ biblionumber => $biblionumber });
Lines 61-71 if(!ref $record) { Link Here
61
}
73
}
62
74
63
if($view eq 'card' || $view eq 'html') {
75
if($view eq 'card' || $view eq 'html') {
64
    my $xml = $importid ? $record->as_xml(): GetXmlBiblio($biblionumber);
76
    my $xml = $importid ? $record->as_xml($format): GetXmlBiblio($biblionumber);
65
    my $xsl;
77
    my $xsl;
66
    if ( $view eq 'card' ){
78
    if ( $view eq 'card' ){
67
        $xsl = C4::Context->preference('marcflavour') eq 'UNIMARC'
79
        $xsl = $marcflavour eq 'UNIMARC' ? 'UNIMARC_compact.xsl' : 'compact.xsl';
68
              ? 'UNIMARC_compact.xsl' : 'compact.xsl';
69
    }
80
    }
70
    else {
81
    else {
71
        $xsl = 'plainMARC.xsl';
82
        $xsl = 'plainMARC.xsl';
(-)a/t/db_dependent/ImportBatch.t (-39 / +97 lines)
Lines 10-15 use t::lib::Mocks; Link Here
10
use t::lib::TestBuilder;
10
use t::lib::TestBuilder;
11
11
12
use Koha::Database;
12
use Koha::Database;
13
use Koha::Import::Records;
13
14
14
BEGIN {
15
BEGIN {
15
    # Mock pluginsdir before loading Plugins module
16
    # Mock pluginsdir before loading Plugins module
Lines 17-23 BEGIN { Link Here
17
    t::lib::Mocks::mock_config( 'pluginsdir', $path );
18
    t::lib::Mocks::mock_config( 'pluginsdir', $path );
18
19
19
    use_ok('Koha::Plugins');
20
    use_ok('Koha::Plugins');
20
    use_ok('C4::ImportBatch', qw( AddImportBatch GetImportBatch AddBiblioToBatch AddItemsToImportBiblio GetRecordFromImportBiblio SetMatchedBiblionumber GetImportBiblios GetItemNumbersFromImportBatch CleanBatch DeleteBatch RecordsFromMarcPlugin ));
21
    use_ok('C4::ImportBatch', qw( AddImportBatch GetImportBatch AddBiblioToBatch AddItemsToImportBiblio SetMatchedBiblionumber GetImportBiblios GetItemNumbersFromImportBatch CleanBatch DeleteBatch RecordsFromMarcPlugin ));
21
}
22
}
22
23
23
# Start transaction
24
# Start transaction
Lines 93-139 my $original_record = MARC::Record->new; Link Here
93
$record->leader('03174nam a2200445 a 4500');
94
$record->leader('03174nam a2200445 a 4500');
94
$original_record->leader('03174nam a2200445 a 4500');
95
$original_record->leader('03174nam a2200445 a 4500');
95
my ($item_tag, $item_subfield) = C4::Biblio::GetMarcFromKohaField( 'items.itemnumber' );
96
my ($item_tag, $item_subfield) = C4::Biblio::GetMarcFromKohaField( 'items.itemnumber' );
96
my @fields = (
97
my @fields;
97
    MARC::Field->new(
98
if (C4::Context->preference('marcflavour') eq 'UNIMARC') {
98
        100, '1', ' ',
99
    @fields = (
99
        a => 'Knuth, Donald Ervin',
100
        MARC::Field->new(
100
        d => '1938',
101
            100, ' ', ' ',
101
    ),
102
            a => '20220520d        u||y0frey50      ba',
102
    MARC::Field->new(
103
        ),
103
        245, '1', '4',
104
        MARC::Field->new(
104
        a => 'The art of computer programming',
105
            700, ' ', ' ',
105
        c => 'Donald E. Knuth.',
106
            a => 'Knuth, Donald Ervin',
106
    ),
107
            f => '1938',
107
    MARC::Field->new(
108
        ),
108
        650, ' ', '0',
109
        MARC::Field->new(
109
        a => 'Computer programming.',
110
            200, ' ', ' ',
110
        9 => '462',
111
            a => 'The art of computer programming',
111
    ),
112
            f => 'Donald E. Knuth.',
112
    MARC::Field->new(
113
        ),
113
        $item_tag, ' ', ' ',
114
        MARC::Field->new(
114
        e => 'my edition ❤',
115
            650, ' ', '0',
115
        i => 'my item part',
116
            a => 'Computer programming.',
116
    ),
117
            9 => '462',
117
    MARC::Field->new(
118
        ),
118
        $item_tag, ' ', ' ',
119
        MARC::Field->new(
119
        e => 'my edition 2',
120
            $item_tag, ' ', ' ',
120
        i => 'my item part 2',
121
            e => 'my edition ❤',
121
    ),
122
            i => 'my item part',
122
);
123
        ),
124
        MARC::Field->new(
125
            $item_tag, ' ', ' ',
126
            e => 'my edition 2',
127
            i => 'my item part 2',
128
        ),
129
    );
130
} else {
131
    @fields = (
132
        MARC::Field->new(
133
            100, '1', ' ',
134
            a => 'Knuth, Donald Ervin',
135
            d => '1938',
136
        ),
137
        MARC::Field->new(
138
            245, '1', '4',
139
            a => 'The art of computer programming',
140
            c => 'Donald E. Knuth.',
141
        ),
142
        MARC::Field->new(
143
            650, ' ', '0',
144
            a => 'Computer programming.',
145
            9 => '462',
146
        ),
147
        MARC::Field->new(
148
            $item_tag, ' ', ' ',
149
            e => 'my edition ❤',
150
            i => 'my item part',
151
        ),
152
        MARC::Field->new(
153
            $item_tag, ' ', ' ',
154
            e => 'my edition 2',
155
            i => 'my item part 2',
156
        ),
157
    );
158
}
123
$record->append_fields(@fields);
159
$record->append_fields(@fields);
124
$original_record->append_fields(@fields);
160
$original_record->append_fields(@fields);
125
my $import_record_id = AddBiblioToBatch( $id_import_batch1, 0, $record, 'utf8', int(rand(99999)), 0 );
161
my $import_record_id = AddBiblioToBatch( $id_import_batch1, 0, $record, 'utf8', int(rand(99999)), 0 );
126
AddItemsToImportBiblio( $id_import_batch1, $import_record_id, $record, 0 );
162
AddItemsToImportBiblio( $id_import_batch1, $import_record_id, $record, 0 );
127
163
128
my $record_from_import_biblio_with_items = C4::ImportBatch::GetRecordFromImportBiblio( $import_record_id, 'embed_items' );
164
my $import_record = Koha::Import::Records->find($import_record_id);
165
my $record_from_import_biblio_with_items = $import_record->get_marc_record({ embed_items => 1 });
129
$original_record->leader($record_from_import_biblio_with_items->leader());
166
$original_record->leader($record_from_import_biblio_with_items->leader());
130
is_deeply( $record_from_import_biblio_with_items, $original_record, 'GetRecordFromImportBiblio should return the record with items if specified' );
167
is_deeply( $record_from_import_biblio_with_items, $original_record, 'Koha::Import::Record::get_marc_record should return the record with items if specified' );
131
my $utf8_field = $record_from_import_biblio_with_items->subfield($item_tag, 'e');
168
my $utf8_field = $record_from_import_biblio_with_items->subfield($item_tag, 'e');
132
is($utf8_field, 'my edition ❤');
169
is($utf8_field, 'my edition ❤');
133
$original_record->delete_fields($original_record->field($item_tag)); #Remove items fields
170
$original_record->delete_fields($original_record->field($item_tag)); #Remove items fields
134
my $record_from_import_biblio_without_items = C4::ImportBatch::GetRecordFromImportBiblio( $import_record_id );
171
my $record_from_import_biblio_without_items = $import_record->get_marc_record();
135
$original_record->leader($record_from_import_biblio_without_items->leader());
172
$original_record->leader($record_from_import_biblio_without_items->leader());
136
is_deeply( $record_from_import_biblio_without_items, $original_record, 'GetRecordFromImportBiblio should return the record without items by default' );
173
is_deeply( $record_from_import_biblio_without_items, $original_record, 'Koha::Import::Record::get_marc_record should return the record without items by default' );
137
174
138
my $another_biblio = $builder->build_sample_biblio;
175
my $another_biblio = $builder->build_sample_biblio;
139
C4::ImportBatch::SetMatchedBiblionumber( $import_record_id, $another_biblio->biblionumber );
176
C4::ImportBatch::SetMatchedBiblionumber( $import_record_id, $another_biblio->biblionumber );
Lines 175-181 my $id_import_batch3 = C4::ImportBatch::AddImportBatch($sample_import_batch3); Link Here
175
212
176
# Test CleanBatch
213
# Test CleanBatch
177
C4::ImportBatch::CleanBatch( $id_import_batch3 );
214
C4::ImportBatch::CleanBatch( $id_import_batch3 );
178
my $import_record = get_import_record( $id_import_batch3 );
215
$import_record = get_import_record( $id_import_batch3 );
179
is( $import_record, "0E0", "Batch 3 has been cleaned" );
216
is( $import_record, "0E0", "Batch 3 has been cleaned" );
180
217
181
# Test DeleteBatch
218
# Test DeleteBatch
Lines 221-227 subtest "RecordsFromMarcPlugin" => sub { Link Here
221
258
222
    # Create a test file
259
    # Create a test file
223
    my ( $fh, $name ) = tempfile();
260
    my ( $fh, $name ) = tempfile();
224
    print $fh q|
261
    if (C4::Context->preference('marcflavour') eq 'UNIMARC') {
262
        print $fh q{
263
003 = NLAmRIJ
264
100,a = 20220520d        u||y0frey50      ba
265
700,a = Author
266
200,ind2 = 0
267
200,a = Silence in the library
268
500 , a= Some note
269
270
700,a = Another
271
245,a = Noise in the library};
272
        close $fh;
273
    } else {
274
        print $fh q|
225
003 = NLAmRIJ
275
003 = NLAmRIJ
226
100,a = Author
276
100,a = Author
227
245,ind2 = 0
277
245,ind2 = 0
Lines 230-236 subtest "RecordsFromMarcPlugin" => sub { Link Here
230
280
231
100,a = Another
281
100,a = Another
232
245,a = Noise in the library|;
282
245,a = Noise in the library|;
233
    close $fh;
283
        close $fh;
284
    }
234
285
235
    t::lib::Mocks::mock_config( 'enable_plugins', 1 );
286
    t::lib::Mocks::mock_config( 'enable_plugins', 1 );
236
287
Lines 241-250 subtest "RecordsFromMarcPlugin" => sub { Link Here
241
    my $records = C4::ImportBatch::RecordsFromMarcPlugin( $name, ref $plugin, 'UTF-8' );
292
    my $records = C4::ImportBatch::RecordsFromMarcPlugin( $name, ref $plugin, 'UTF-8' );
242
    is( @$records, 2, 'Two results returned' );
293
    is( @$records, 2, 'Two results returned' );
243
    is( ref $records->[0], 'MARC::Record', 'Returned MARC::Record object' );
294
    is( ref $records->[0], 'MARC::Record', 'Returned MARC::Record object' );
244
    is( $records->[0]->subfield('245', 'a'), 'Silence in the library',
295
    if (C4::Context->preference('marcflavour') eq 'UNIMARC') {
245
        'Checked one field in first record' );
296
        is( $records->[0]->subfield('200', 'a'), 'Silence in the library',
246
    is( $records->[1]->subfield('100', 'a'), 'Another',
297
            'Checked one field in first record' );
247
        'Checked one field in second record' );
298
        is( $records->[1]->subfield('700', 'a'), 'Another',
299
            'Checked one field in second record' );
300
    } else {
301
        is( $records->[0]->subfield('245', 'a'), 'Silence in the library',
302
            'Checked one field in first record' );
303
        is( $records->[1]->subfield('100', 'a'), 'Another',
304
            'Checked one field in second record' );
305
    }
248
};
306
};
249
307
250
subtest "_get_commit_action" => sub {
308
subtest "_get_commit_action" => sub {
(-)a/tools/showdiffmarc.pl (-3 / +4 lines)
Lines 30-39 use C4::Output qw( output_html_with_http_headers ); Link Here
30
use C4::Auth qw( get_template_and_user );
30
use C4::Auth qw( get_template_and_user );
31
use C4::Biblio qw( GetMarcBiblio );
31
use C4::Biblio qw( GetMarcBiblio );
32
use C4::Auth qw( get_template_and_user );
32
use C4::Auth qw( get_template_and_user );
33
use C4::ImportBatch qw( GetRecordFromImportBiblio GetImportBiblios );
33
use C4::ImportBatch qw( GetImportBiblios );
34
use C4::AuthoritiesMarc qw( GetAuthority );
34
use C4::AuthoritiesMarc qw( GetAuthority );
35
35
36
use Koha::Biblios;
36
use Koha::Biblios;
37
use Koha::Import::Records;
37
38
38
# Input params
39
# Input params
39
my $input        = CGI->new;
40
my $input        = CGI->new;
Lines 79-85 if( $record ) { Link Here
79
}
80
}
80
81
81
if( $importid ) {
82
if( $importid ) {
82
    $recordImportid = C4::ImportBatch::GetRecordFromImportBiblio( $importid, 'embed_items' );
83
    my $import_record = Koha::Import::Records->find($importid);
84
    my $recordImportid = $import_record->get_marc_record({ embed_items => 1 });
83
    $formatted2 = $recordImportid->as_formatted;
85
    $formatted2 = $recordImportid->as_formatted;
84
    my $biblio = GetImportBiblios($importid);
86
    my $biblio = GetImportBiblios($importid);
85
    $importTitle = $biblio->[0]->{'title'};
87
    $importTitle = $biblio->[0]->{'title'};
86
- 

Return to bug 29333