Lines 58-63
my ($template, $loggedinuser, $cookie, $userflags) = get_template_and_user({
Link Here
|
58 |
my $cgiparams = $input->Vars; |
58 |
my $cgiparams = $input->Vars; |
59 |
my $op = $cgiparams->{'op'}; |
59 |
my $op = $cgiparams->{'op'}; |
60 |
my $booksellerid = $input->param('booksellerid'); |
60 |
my $booksellerid = $input->param('booksellerid'); |
|
|
61 |
my $allmatch = $input->param('allmatch'); |
61 |
my $bookseller = GetBookSellerFromId($booksellerid); |
62 |
my $bookseller = GetBookSellerFromId($booksellerid); |
62 |
my $data; |
63 |
my $data; |
63 |
|
64 |
|
Lines 122-127
if ($op eq ""){
Link Here
|
122 |
$template->param("batch_details" => 1, |
123 |
$template->param("batch_details" => 1, |
123 |
"basketno" => $cgiparams->{'basketno'}, |
124 |
"basketno" => $cgiparams->{'basketno'}, |
124 |
loop_currencies => \@loop_currency, |
125 |
loop_currencies => \@loop_currency, |
|
|
126 |
"allmatch" => $allmatch, |
125 |
); |
127 |
); |
126 |
import_biblios_list($template, $cgiparams->{'import_batch_id'}); |
128 |
import_biblios_list($template, $cgiparams->{'import_batch_id'}); |
127 |
if ( C4::Context->preference('AcqCreateItem') eq 'ordering' && !$ordernumber ) { |
129 |
if ( C4::Context->preference('AcqCreateItem') eq 'ordering' && !$ordernumber ) { |
Lines 157-170
if ($op eq ""){
Link Here
|
157 |
# retrieve the file you want to import |
159 |
# retrieve the file you want to import |
158 |
my $import_batch_id = $cgiparams->{'import_batch_id'}; |
160 |
my $import_batch_id = $cgiparams->{'import_batch_id'}; |
159 |
my $biblios = GetImportRecordsRange($import_batch_id); |
161 |
my $biblios = GetImportRecordsRange($import_batch_id); |
|
|
162 |
my $duplinbatch; |
163 |
my $imported = 0; |
160 |
for my $biblio (@$biblios){ |
164 |
for my $biblio (@$biblios){ |
161 |
# 1st insert the biblio, or find it through matcher |
165 |
# 1st insert the biblio, or find it through matcher |
162 |
my ( $marcblob, $encoding ) = GetImportRecordMarc( $biblio->{'import_record_id'} ); |
166 |
my ( $marcblob, $encoding ) = GetImportRecordMarc( $biblio->{'import_record_id'} ); |
163 |
my $marcrecord = MARC::Record->new_from_usmarc($marcblob) || die "couldn't translate marc information"; |
167 |
my $marcrecord = MARC::Record->new_from_usmarc($marcblob) || die "couldn't translate marc information"; |
164 |
my $match = GetImportRecordMatches( $biblio->{'import_record_id'}, 1 ); |
168 |
my $match = GetImportRecordMatches( $biblio->{'import_record_id'}, 1 ); |
165 |
my $biblionumber=$#$match > -1?$match->[0]->{'biblionumber'}:0; |
169 |
my $biblionumber=$#$match > -1?$match->[0]->{'biblionumber'}:0; |
166 |
|
|
|
167 |
unless ( $biblionumber ) { |
170 |
unless ( $biblionumber ) { |
|
|
171 |
$duplinbatch=$import_batch_id and next if FindDuplicate($marcrecord); |
168 |
# add the biblio |
172 |
# add the biblio |
169 |
my $bibitemnum; |
173 |
my $bibitemnum; |
170 |
|
174 |
|
Lines 261-269
if ($op eq ""){
Link Here
|
261 |
} else { |
265 |
} else { |
262 |
SetImportRecordStatus( $biblio->{'import_record_id'}, 'imported' ); |
266 |
SetImportRecordStatus( $biblio->{'import_record_id'}, 'imported' ); |
263 |
} |
267 |
} |
|
|
268 |
$imported++; |
264 |
} |
269 |
} |
265 |
# go to basket page |
270 |
# go to basket page |
266 |
print $input->redirect("/cgi-bin/koha/acqui/basket.pl?basketno=".$cgiparams->{'basketno'}); |
271 |
if ( $imported ) { |
|
|
272 |
print $input->redirect("/cgi-bin/koha/acqui/basket.pl?basketno=".$cgiparams->{'basketno'}."&duplinbatch=$duplinbatch"); |
273 |
} else { |
274 |
print $input->redirect("/cgi-bin/koha/acqui/addorderiso2709.pl?import_batch_id=$import_batch_id&basketno=".$cgiparams->{'basketno'}."&booksellerid=$booksellerid&allmatch=1"); |
275 |
} |
267 |
exit; |
276 |
exit; |
268 |
} |
277 |
} |
269 |
|
278 |
|