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::Biblios; |
53 |
use Koha::Biblios; |
52 |
use Koha::ItemTypes; |
54 |
use Koha::ItemTypes; |
Lines 59-65
use Koha::UI::Form::Builder::Biblio;
Link Here
|
59 |
use MARC::File::USMARC; |
61 |
use MARC::File::USMARC; |
60 |
use MARC::File::XML; |
62 |
use MARC::File::XML; |
61 |
use URI::Escape qw( uri_escape_utf8 ); |
63 |
use URI::Escape qw( uri_escape_utf8 ); |
62 |
use List::MoreUtils qw(firstval); |
|
|
63 |
|
64 |
|
64 |
if ( C4::Context->preference('marcflavour') eq 'UNIMARC' ) { |
65 |
if ( C4::Context->preference('marcflavour') eq 'UNIMARC' ) { |
65 |
MARC::File::XML->default_record_format('UNIMARC'); |
66 |
MARC::File::XML->default_record_format('UNIMARC'); |
Lines 661-676
if ( $op eq "addbiblio" ) {
Link Here
|
661 |
# it is not a duplicate (determined either by Koha itself or by user checking it's not a duplicate) |
662 |
# it is not a duplicate (determined either by Koha itself or by user checking it's not a duplicate) |
662 |
if ( !$duplicatebiblionumber or $confirm_not_duplicate ) { |
663 |
if ( !$duplicatebiblionumber or $confirm_not_duplicate ) { |
663 |
my $oldbibitemnum; |
664 |
my $oldbibitemnum; |
664 |
my $marc_modification_template_name = C4::Context->preference("SaveBiblioMarcModificationTemplate"); |
665 |
|
665 |
if ($marc_modification_template_name) { |
666 |
my $template_id = C4::Context->preference("SaveBiblioMarcModificationTemplate"); |
666 |
my $template = firstval { $_->{'name'} eq $marc_modification_template_name } GetModificationTemplates(); |
667 |
if ($template_id) { |
|
|
668 |
my $template = Koha::MarcModificationTemplates->find($template_id); |
667 |
if ($template) { |
669 |
if ($template) { |
668 |
ModifyRecordWithTemplate($template->{'template_id'}, $record); |
670 |
ModifyRecordWithTemplate($template_id, $record); |
669 |
} |
671 |
} |
670 |
else { |
672 |
else { |
671 |
warn "No MARC modification template exists with name \"$marc_modification_template_name\""; |
673 |
croak "No MARC modification template exists with id \"$template_id\""; |
672 |
} |
674 |
} |
673 |
} |
675 |
} |
|
|
676 |
|
674 |
if ( $is_a_modif ) { |
677 |
if ( $is_a_modif ) { |
675 |
my $member = Koha::Patrons->find($loggedinuser); |
678 |
my $member = Koha::Patrons->find($loggedinuser); |
676 |
ModBiblio( |
679 |
ModBiblio( |