Lines 176-182
if ($op eq ""){
Link Here
|
176 |
my $c_quantity = shift( @quantities ) || GetMarcQuantity($marcrecord, C4::Context->preference('marcflavour') ) || 1; |
176 |
my $c_quantity = shift( @quantities ) || GetMarcQuantity($marcrecord, C4::Context->preference('marcflavour') ) || 1; |
177 |
my $c_budget_id = shift( @budgets_id ) || $input->param('all_budget_id') || $budget_id; |
177 |
my $c_budget_id = shift( @budgets_id ) || $input->param('all_budget_id') || $budget_id; |
178 |
my $c_discount = shift ( @discount); |
178 |
my $c_discount = shift ( @discount); |
179 |
$c_discount = $c_discount / 100 if $c_discount > 1; |
179 |
$c_discount = $c_discount / 100 if $c_discount && $c_discount > 1; |
180 |
my $c_sort1 = shift( @sort1 ) || $input->param('all_sort1') || ''; |
180 |
my $c_sort1 = shift( @sort1 ) || $input->param('all_sort1') || ''; |
181 |
my $c_sort2 = shift( @sort2 ) || $input->param('all_sort2') || ''; |
181 |
my $c_sort2 = shift( @sort2 ) || $input->param('all_sort2') || ''; |
182 |
|
182 |
|
Lines 198-203
if ($op eq ""){
Link Here
|
198 |
} |
198 |
} |
199 |
( $biblionumber, $bibitemnum ) = AddBiblio( $marcrecord, $cgiparams->{'frameworkcode'} || '' ); |
199 |
( $biblionumber, $bibitemnum ) = AddBiblio( $marcrecord, $cgiparams->{'frameworkcode'} || '' ); |
200 |
SetImportRecordStatus( $biblio->{'import_record_id'}, 'imported' ); |
200 |
SetImportRecordStatus( $biblio->{'import_record_id'}, 'imported' ); |
|
|
201 |
|
202 |
#We need to provide information to koha.import_record_matches to tell Koha that this import_record matches the |
203 |
#just AddBiblio'd biblio. This is necessary to prevent adding the same import_record to koha.biblio many times. |
204 |
SetImportRecordBiblioMatch($biblio->{'import_record_id'}, $biblionumber); |
205 |
|
201 |
# 2nd add authorities if applicable |
206 |
# 2nd add authorities if applicable |
202 |
if (C4::Context->preference("BiblioAddsAuthorities")){ |
207 |
if (C4::Context->preference("BiblioAddsAuthorities")){ |
203 |
my $headings_linked =BiblioAutoLink($marcrecord, $cgiparams->{'frameworkcode'}); |
208 |
my $headings_linked =BiblioAutoLink($marcrecord, $cgiparams->{'frameworkcode'}); |
Lines 358-364
sub import_biblios_list {
Link Here
|
358 |
my ($template, $import_batch_id) = @_; |
363 |
my ($template, $import_batch_id) = @_; |
359 |
my $batch = GetImportBatch($import_batch_id,'staged'); |
364 |
my $batch = GetImportBatch($import_batch_id,'staged'); |
360 |
return () unless $batch and $batch->{import_status} =~ /^staged$|^reverted$/; |
365 |
return () unless $batch and $batch->{import_status} =~ /^staged$|^reverted$/; |
361 |
my $biblios = GetImportRecordsRange($import_batch_id,'','',$batch->{import_status}); |
366 |
my $biblios = GetImportRecordsRange($import_batch_id,'','',undef); |
362 |
my @list = (); |
367 |
my @list = (); |
363 |
|
368 |
|
364 |
foreach my $biblio (@$biblios) { |
369 |
foreach my $biblio (@$biblios) { |
Lines 403-408
sub import_biblios_list {
Link Here
|
403 |
$cellrecord{discount} = $discount || ''; |
408 |
$cellrecord{discount} = $discount || ''; |
404 |
$cellrecord{sort1} = $sort1 || ''; |
409 |
$cellrecord{sort1} = $sort1 || ''; |
405 |
$cellrecord{sort2} = $sort2 || ''; |
410 |
$cellrecord{sort2} = $sort2 || ''; |
|
|
411 |
|
412 |
get_matched_cellrecord_items( \%cellrecord ); |
413 |
|
406 |
|
414 |
|
407 |
push @list, \%cellrecord; |
415 |
push @list, \%cellrecord; |
408 |
} |
416 |
} |
Lines 464-469
sub add_matcher_list {
Link Here
|
464 |
$template->param(available_matchers => \@matchers); |
472 |
$template->param(available_matchers => \@matchers); |
465 |
} |
473 |
} |
466 |
|
474 |
|
|
|
475 |
#Get the Items already in Koha for this import_record. |
476 |
#A summary of them is displayed for the user. |
477 |
sub get_matched_cellrecord_items { |
478 |
my $cellrecord = shift; |
479 |
|
480 |
if ($cellrecord->{match_biblionumber}) { |
481 |
my $itemsCountByBranch = C4::Items::GetItemsCountByBranch( $cellrecord->{match_biblionumber} ); |
482 |
my $loginBranchcode = $template->{VARS}->{LoginBranchcode}; |
483 |
my $totalItemsCount = 0; |
484 |
my @availabilityMap; |
485 |
foreach my $homebranch (sort keys %$itemsCountByBranch) { |
486 |
push (@availabilityMap, $homebranch.' = '.$itemsCountByBranch->{ $homebranch }->{ count }); |
487 |
$totalItemsCount += $itemsCountByBranch->{ $homebranch }->{ count }; |
488 |
} |
489 |
my $loginBranchcount = $itemsCountByBranch->{ $loginBranchcode }->{ count }; |
490 |
$cellrecord->{loginBranchItemsCount} = $loginBranchcount || '0'; |
491 |
$cellrecord->{totalItemsCount} = $totalItemsCount; |
492 |
$cellrecord->{availabilityMap} = join("\n", @availabilityMap); |
493 |
} |
494 |
} |
495 |
|
467 |
sub get_infos_syspref { |
496 |
sub get_infos_syspref { |
468 |
my ($record, $field_list) = @_; |
497 |
my ($record, $field_list) = @_; |
469 |
my $syspref = C4::Context->preference('MarcFieldsToOrder'); |
498 |
my $syspref = C4::Context->preference('MarcFieldsToOrder'); |