Lines 45-52
use C4::ClassSource qw( GetClassSources );
Link Here
|
45 |
use C4::ImportBatch qw( GetImportRecordMarc ); |
45 |
use C4::ImportBatch qw( GetImportRecordMarc ); |
46 |
use C4::Charset qw( SetMarcUnicodeFlag ); |
46 |
use C4::Charset qw( SetMarcUnicodeFlag ); |
47 |
use C4::MarcModificationTemplates; |
47 |
use C4::MarcModificationTemplates; |
|
|
48 |
use Koha::MarcModificationTemplates; |
48 |
use Koha::BiblioFrameworks; |
49 |
use Koha::BiblioFrameworks; |
49 |
use Koha::DateUtils qw( dt_from_string ); |
50 |
use Koha::DateUtils qw( dt_from_string ); |
|
|
51 |
use Carp; |
50 |
|
52 |
|
51 |
use Koha::ItemTypes; |
53 |
use Koha::ItemTypes; |
52 |
use Koha::Libraries; |
54 |
use Koha::Libraries; |
Lines 56-62
use Koha::BiblioFrameworks;
Link Here
|
56 |
use MARC::File::USMARC; |
58 |
use MARC::File::USMARC; |
57 |
use MARC::File::XML; |
59 |
use MARC::File::XML; |
58 |
use URI::Escape qw( uri_escape_utf8 ); |
60 |
use URI::Escape qw( uri_escape_utf8 ); |
59 |
use List::MoreUtils qw(firstval); |
|
|
60 |
|
61 |
|
61 |
if ( C4::Context->preference('marcflavour') eq 'UNIMARC' ) { |
62 |
if ( C4::Context->preference('marcflavour') eq 'UNIMARC' ) { |
62 |
MARC::File::XML->default_record_format('UNIMARC'); |
63 |
MARC::File::XML->default_record_format('UNIMARC'); |
Lines 860-875
if ( $op eq "addbiblio" ) {
Link Here
|
860 |
# it is not a duplicate (determined either by Koha itself or by user checking it's not a duplicate) |
861 |
# it is not a duplicate (determined either by Koha itself or by user checking it's not a duplicate) |
861 |
if ( !$duplicatebiblionumber or $confirm_not_duplicate ) { |
862 |
if ( !$duplicatebiblionumber or $confirm_not_duplicate ) { |
862 |
my $oldbibitemnum; |
863 |
my $oldbibitemnum; |
863 |
my $marc_modification_template_name = C4::Context->preference("SaveBiblioMarcModificationTemplate"); |
864 |
|
864 |
if ($marc_modification_template_name) { |
865 |
my $template_id = C4::Context->preference("SaveBiblioMarcModificationTemplate"); |
865 |
my $template = firstval { $_->{'name'} eq $marc_modification_template_name } GetModificationTemplates(); |
866 |
print STDERR "ID IS: $template_id"; |
|
|
867 |
if ($template_id) { |
868 |
my $template = Koha::MarcModificationTemplates->find($template_id); |
866 |
if ($template) { |
869 |
if ($template) { |
867 |
ModifyRecordWithTemplate($template->{'template_id'}, $record); |
870 |
ModifyRecordWithTemplate($template_id, $record); |
868 |
} |
871 |
} |
869 |
else { |
872 |
else { |
870 |
warn "No MARC modification template exists with name \"$marc_modification_template_name\""; |
873 |
croak "No MARC modification template exists with id \"$template_id\""; |
871 |
} |
874 |
} |
872 |
} |
875 |
} |
|
|
876 |
|
873 |
if ( $is_a_modif ) { |
877 |
if ( $is_a_modif ) { |
874 |
ModBiblio( $record, $biblionumber, $frameworkcode ); |
878 |
ModBiblio( $record, $biblionumber, $frameworkcode ); |
875 |
} |
879 |
} |