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

(-)a/acqui/addorderiso2709.pl (-18 / +14 lines)
Lines 51-56 use Koha::Acquisition::Baskets; Link Here
51
use Koha::Acquisition::Currencies;
51
use Koha::Acquisition::Currencies;
52
use Koha::Acquisition::Orders;
52
use Koha::Acquisition::Orders;
53
use Koha::Acquisition::Booksellers;
53
use Koha::Acquisition::Booksellers;
54
use Koha::Import::Records;
54
use Koha::Patrons;
55
use Koha::Patrons;
55
56
56
my $input = CGI->new;
57
my $input = CGI->new;
Lines 442-448 sub import_biblios_list { Link Here
442
    my ($template, $import_batch_id) = @_;
443
    my ($template, $import_batch_id) = @_;
443
    my $batch = GetImportBatch($import_batch_id,'staged');
444
    my $batch = GetImportBatch($import_batch_id,'staged');
444
    return () unless $batch and $batch->{import_status} =~ /^staged$|^reverted$/;
445
    return () unless $batch and $batch->{import_status} =~ /^staged$|^reverted$/;
445
    my $biblios = GetImportRecordsRange($import_batch_id,'','',$batch->{import_status});
446
    my $import_records = Koha::Import::Records->search({
447
        import_batch_id => $import_batch_id,
448
        status => $batch->{import_status}
449
    });
446
    my @list = ();
450
    my @list = ();
447
    my $item_error = 0;
451
    my $item_error = 0;
448
452
Lines 464-493 sub import_biblios_list { Link Here
464
    }
468
    }
465
469
466
    my $biblio_count = 0;
470
    my $biblio_count = 0;
467
    foreach my $biblio (@$biblios) {
471
    while ( my $import_record = $import_records->next ) {
468
        my $item_id = 1;
472
        my $item_id = 1;
469
        $biblio_count++;
473
        $biblio_count++;
470
        my $citation = $biblio->{'title'};
474
        my $match = GetImportRecordMatches($import_record->import_record_id, 1);
471
        $citation .= " $biblio->{'author'}" if $biblio->{'author'};
472
        $citation .= " (" if $biblio->{'issn'} or $biblio->{'isbn'};
473
        $citation .= $biblio->{'isbn'} if $biblio->{'isbn'};
474
        $citation .= ", " if $biblio->{'issn'} and $biblio->{'isbn'};
475
        $citation .= $biblio->{'issn'} if $biblio->{'issn'};
476
        $citation .= ")" if $biblio->{'issn'} or $biblio->{'isbn'};
477
        my $match = GetImportRecordMatches($biblio->{'import_record_id'}, 1);
478
        my %cellrecord = (
475
        my %cellrecord = (
479
            import_record_id => $biblio->{'import_record_id'},
476
            import_record_id => $import_record->import_record_id,
480
            citation => $citation,
477
            import_biblio => $import_record->import_biblio,
481
            import  => 1,
478
            import  => 1,
482
            status => $biblio->{'status'},
479
            status => $import_record->status,
483
            record_sequence => $biblio->{'record_sequence'},
480
            record_sequence => $import_record->record_sequence,
484
            overlay_status => $biblio->{'overlay_status'},
481
            overlay_status => $import_record->overlay_status,
485
            match_biblionumber => $#$match > -1 ? $match->[0]->{'biblionumber'} : 0,
482
            match_biblionumber => $#$match > -1 ? $match->[0]->{'biblionumber'} : 0,
486
            match_citation     => $#$match > -1 ? $match->[0]->{'title'} || '' . ' ' . $match->[0]->{'author'} || '': '',
483
            match_citation     => $#$match > -1 ? $match->[0]->{'title'} || '' . ' ' . $match->[0]->{'author'} || '': '',
487
            match_score => $#$match > -1 ? $match->[0]->{'score'} : 0,
484
            match_score => $#$match > -1 ? $match->[0]->{'score'} : 0,
488
        );
485
        );
489
        my ( $marcblob, $encoding ) = GetImportRecordMarc( $biblio->{'import_record_id'} );
486
        my $marcrecord = $import_record->get_marc_record || die "couldn't translate marc information";
490
        my $marcrecord = MARC::Record->new_from_usmarc($marcblob) || die "couldn't translate marc information";
491
487
492
        my $infos = get_infos_syspref('MarcFieldsToOrder', $marcrecord, ['price', 'quantity', 'budget_code', 'discount', 'sort1', 'sort2','replacementprice']);
488
        my $infos = get_infos_syspref('MarcFieldsToOrder', $marcrecord, ['price', 'quantity', 'budget_code', 'discount', 'sort1', 'sort2','replacementprice']);
493
        my $price = $infos->{price};
489
        my $price = $infos->{price};
Lines 584-590 sub import_biblios_list { Link Here
584
    my $overlay_action = GetImportBatchOverlayAction($import_batch_id);
580
    my $overlay_action = GetImportBatchOverlayAction($import_batch_id);
585
    my $nomatch_action = GetImportBatchNoMatchAction($import_batch_id);
581
    my $nomatch_action = GetImportBatchNoMatchAction($import_batch_id);
586
    my $item_action = GetImportBatchItemAction($import_batch_id);
582
    my $item_action = GetImportBatchItemAction($import_batch_id);
587
    $template->param(biblio_list => \@list,
583
    $template->param(import_biblio_list => \@list,
588
                        num_results => $num_records,
584
                        num_results => $num_records,
589
                        import_batch_id => $import_batch_id,
585
                        import_batch_id => $import_batch_id,
590
                        "overlay_action_${overlay_action}" => 1,
586
                        "overlay_action_${overlay_action}" => 1,
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt (-3 / +11 lines)
Lines 109-120 Link Here
109
                                    <input type="hidden" name="import_batch_id" value="[% import_batch_id | html %]" />
109
                                    <input type="hidden" name="import_batch_id" value="[% import_batch_id | html %]" />
110
                                    <input type="hidden" name="ordernumber" value="[% ordernumber | html %]" />
110
                                    <input type="hidden" name="ordernumber" value="[% ordernumber | html %]" />
111
111
112
                                    [% FOREACH biblio IN biblio_list %]
112
                                    [% FOREACH biblio IN import_biblio_list %]
113
                                        <fieldset class="biblio unselected rows" style="float:none;">
113
                                        <fieldset class="biblio unselected rows" style="float:none;">
114
                                            <legend>
114
                                            <legend>
115
                                                <label for="record_[% biblio.import_record_id | html %]" style="width:auto;">
115
                                                <label for="record_[% biblio.import_record_id | html %]" style="width:auto;">
116
                                                    <input type="checkbox" name="import_record_id" id="record_[% biblio.import_record_id | html %]" value="[% biblio.import_record_id | html %]" />
116
                                                    <input type="checkbox" name="import_record_id" id="record_[% biblio.import_record_id | html %]" value="[% biblio.import_record_id | html %]" />
117
                                                    <span class="citation">[% biblio.citation | html %]</span>
117
                                                    <span class="citation">
118
                                                        [%- biblio.import_biblio.title | html -%]
119
                                                         [% biblio.import_biblio.author -%]
120
                                                        [% IF (biblio.import_biblio.isbn || biblio.import_biblio.issn) -%](
121
                                                            [% biblio.import_biblio.isbn -%]
122
                                                            [%- IF (biblio.import_biblio.isbn && biblio.import_biblio.issn ) %] & [%- END -%]
123
                                                            [%- biblio.import_biblio.issn %]
124
                                                             )
125
                                                        [%- END -%]
126
                                                    </span>
118
                                                </label>
127
                                                </label>
119
                                                <span class="links" style="font-weight: normal;">
128
                                                <span class="links" style="font-weight: normal;">
120
                                                    ( <a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% biblio.import_record_id | uri %]" class="previewData">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;importid=[% biblio.import_record_id | html %]" class="previewData">Card</a> | <a href="/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=[% booksellerid | html %]&amp;basketno=[% basketno | html %]&amp;breedingid=[% biblio.import_record_id | html %]&amp;import_batch_id=[% biblio.import_batch_id | html %]&amp;biblionumber=[% biblio.match_biblionumber | html %]">Add order</a> )
129
                                                    ( <a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% biblio.import_record_id | uri %]" class="previewData">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;importid=[% biblio.import_record_id | html %]" class="previewData">Card</a> | <a href="/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=[% booksellerid | html %]&amp;basketno=[% basketno | html %]&amp;breedingid=[% biblio.import_record_id | html %]&amp;import_batch_id=[% biblio.import_batch_id | html %]&amp;biblionumber=[% biblio.match_biblionumber | html %]">Add order</a> )
121
- 

Return to bug 31569