my $cgiparams = $input->Vars;
my $op = $cgiparams->{'op'} || '';
my $booksellerid = $input->param('booksellerid');
+my $allmatch = $input->param('allmatch');
my $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid });
my $data;
$template->param("batch_details" => 1,
"basketno" => $cgiparams->{'basketno'},
loop_currencies => \@loop_currency,
+ "allmatch" => $allmatch,
);
import_biblios_list($template, $cgiparams->{'import_batch_id'});
if ( C4::Context->preference('AcqCreateItem') eq 'ordering' ) {
# retrieve the file you want to import
my $import_batch_id = $cgiparams->{'import_batch_id'};
my $biblios = GetImportRecordsRange($import_batch_id);
+ my $duplinbatch;
+ my $imported = 0;
my @import_record_id_selected = $input->param("import_record_id");
my @quantities = $input->param('quantity');
my @prices = $input->param('price');
# 1st insert the biblio, or find it through matcher
unless ( $biblionumber ) {
+ $duplinbatch=$import_batch_id and next if FindDuplicate($marcrecord);
# add the biblio
my $bibitemnum;
} else {
SetImportRecordStatus( $biblio->{'import_record_id'}, 'imported' );
}
+ $imported++;
}
# go to basket page
- print $input->redirect("/cgi-bin/koha/acqui/basket.pl?basketno=".$cgiparams->{'basketno'});
+ if ( $imported ) {
+ print $input->redirect("/cgi-bin/koha/acqui/basket.pl?basketno=".$cgiparams->{'basketno'}."&duplinbatch=$duplinbatch");
+ } else {
+ print $input->redirect("/cgi-bin/koha/acqui/addorderiso2709.pl?import_batch_id=$import_batch_id&basketno=".$cgiparams->{'basketno'}."&booksellerid=$booksellerid&allmatch=1");
+ }
exit;
}
my $query = new CGI;
our $basketno = $query->param('basketno');
my $booksellerid = $query->param('booksellerid');
+my $duplinbatch = $query->param('duplinbatch');
my ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user(
{
grouped => $basket->{basketgroupid},
unclosable => @orders ? 0 : 1,
has_budgets => $has_budgets,
+ duplinbatch => $duplinbatch,
);
}
<div id="bd">
<div id="yui-main">
<div class="yui-b">
+ [% IF ( allmatch ) %]<div class="dialog alert">
+ <h4>No records imported</h4>
+ No record have been imported because they all match an existing record in your catalog.<br />You'll have to treat them individually.
+ </div>
+ [% END %]
+
[% IF ( batch_details ) %]
<h1>Add orders from [% comments %]
([% file_name %] staged on [% upload_timestamp | $KohaDates with_hours => 1 %])
</div>
</div>
[% END %]
+ [% IF ( duplinbatch ) %]<div class="dialog alert">
+ <h4>Duplicate warning</h4>
+ <p>Some records have not been automatically added because they match an existing record in your catalog:<a href="/cgi-bin/koha/acqui/addorderiso2709.pl?import_batch_id=[% duplinbatch %]&basketno=[% basketno %]&booksellerid=[% booksellerid %]" title="Open in new window" target="_blank" class="popup" style="margin-left:10px">Display them</a></p>
+ </div>[% END %]
<div id="acqui_basket_content" class="yui-g">
[% IF ( books_loop ) %]