Lines 28-33
use C4::Charset;
Link Here
|
28 |
use C4::AuthoritiesMarc; |
28 |
use C4::AuthoritiesMarc; |
29 |
use C4::MarcModificationTemplates; |
29 |
use C4::MarcModificationTemplates; |
30 |
use Koha::Plugins::Handler; |
30 |
use Koha::Plugins::Handler; |
|
|
31 |
use Koha::Logger; |
31 |
|
32 |
|
32 |
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); |
33 |
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); |
33 |
|
34 |
|
Lines 812-817
sub BatchCommitItems {
Link Here
|
812 |
sub BatchRevertRecords { |
813 |
sub BatchRevertRecords { |
813 |
my $batch_id = shift; |
814 |
my $batch_id = shift; |
814 |
|
815 |
|
|
|
816 |
my $logger = Koha::Logger->get( { category => 'C4.ImportBatch.BatchRevertRecords' } ); |
817 |
$logger->trace("C4::ImportBatch::BatchRevertRecords( $batch_id )"); |
818 |
|
815 |
my $record_type; |
819 |
my $record_type; |
816 |
my $num_deleted = 0; |
820 |
my $num_deleted = 0; |
817 |
my $num_errors = 0; |
821 |
my $num_errors = 0; |
Lines 867-872
sub BatchRevertRecords {
Link Here
|
867 |
if ($record_type eq 'biblio') { |
871 |
if ($record_type eq 'biblio') { |
868 |
my $biblionumber = $rowref->{'matched_biblionumber'}; |
872 |
my $biblionumber = $rowref->{'matched_biblionumber'}; |
869 |
my $oldbiblio = GetBiblio($biblionumber); |
873 |
my $oldbiblio = GetBiblio($biblionumber); |
|
|
874 |
|
875 |
$logger->info("Biblio record $biblionumber does not exist, restoration of this record was skipped") unless $oldbiblio; |
876 |
next unless $oldbiblio; # Record has since been deleted. Deleted records should stay deleted. |
877 |
|
870 |
$num_items_deleted += BatchRevertItems($rowref->{'import_record_id'}, $rowref->{'matched_biblionumber'}); |
878 |
$num_items_deleted += BatchRevertItems($rowref->{'import_record_id'}, $rowref->{'matched_biblionumber'}); |
871 |
ModBiblio($old_record, $biblionumber, $oldbiblio->{'frameworkcode'}); |
879 |
ModBiblio($old_record, $biblionumber, $oldbiblio->{'frameworkcode'}); |
872 |
} else { |
880 |
} else { |
873 |
- |
|
|