|
Lines 44-51
use C4::ClassSource qw( GetClassSources );
Link Here
|
| 44 |
use C4::ImportBatch qw( GetImportRecordMarc ); |
44 |
use C4::ImportBatch qw( GetImportRecordMarc ); |
| 45 |
use C4::Charset qw( SetMarcUnicodeFlag ); |
45 |
use C4::Charset qw( SetMarcUnicodeFlag ); |
| 46 |
use C4::MarcModificationTemplates; |
46 |
use C4::MarcModificationTemplates; |
|
|
47 |
use Koha::MarcModificationTemplates; |
| 47 |
use Koha::BiblioFrameworks; |
48 |
use Koha::BiblioFrameworks; |
| 48 |
use Koha::DateUtils qw( dt_from_string ); |
49 |
use Koha::DateUtils qw( dt_from_string ); |
|
|
50 |
use Carp; |
| 49 |
|
51 |
|
| 50 |
use Koha::Biblios; |
52 |
use Koha::Biblios; |
| 51 |
use Koha::ItemTypes; |
53 |
use Koha::ItemTypes; |
|
Lines 57-63
use Koha::Patrons;
Link Here
|
| 57 |
use MARC::File::USMARC; |
59 |
use MARC::File::USMARC; |
| 58 |
use MARC::File::XML; |
60 |
use MARC::File::XML; |
| 59 |
use URI::Escape qw( uri_escape_utf8 ); |
61 |
use URI::Escape qw( uri_escape_utf8 ); |
| 60 |
use List::MoreUtils qw(firstval); |
|
|
| 61 |
|
62 |
|
| 62 |
if ( C4::Context->preference('marcflavour') eq 'UNIMARC' ) { |
63 |
if ( C4::Context->preference('marcflavour') eq 'UNIMARC' ) { |
| 63 |
MARC::File::XML->default_record_format('UNIMARC'); |
64 |
MARC::File::XML->default_record_format('UNIMARC'); |
|
Lines 886-901
if ( $op eq "addbiblio" ) {
Link Here
|
| 886 |
# it is not a duplicate (determined either by Koha itself or by user checking it's not a duplicate) |
887 |
# it is not a duplicate (determined either by Koha itself or by user checking it's not a duplicate) |
| 887 |
if ( !$duplicatebiblionumber or $confirm_not_duplicate ) { |
888 |
if ( !$duplicatebiblionumber or $confirm_not_duplicate ) { |
| 888 |
my $oldbibitemnum; |
889 |
my $oldbibitemnum; |
| 889 |
my $marc_modification_template_name = C4::Context->preference("SaveBiblioMarcModificationTemplate"); |
890 |
|
| 890 |
if ($marc_modification_template_name) { |
891 |
my $template_id = C4::Context->preference("SaveBiblioMarcModificationTemplate"); |
| 891 |
my $template = firstval { $_->{'name'} eq $marc_modification_template_name } GetModificationTemplates(); |
892 |
if ($template_id) { |
|
|
893 |
my $template = Koha::MarcModificationTemplates->find($template_id); |
| 892 |
if ($template) { |
894 |
if ($template) { |
| 893 |
ModifyRecordWithTemplate($template->{'template_id'}, $record); |
895 |
ModifyRecordWithTemplate($template_id, $record); |
| 894 |
} |
896 |
} |
| 895 |
else { |
897 |
else { |
| 896 |
warn "No MARC modification template exists with name \"$marc_modification_template_name\""; |
898 |
croak "No MARC modification template exists with id \"$template_id\""; |
| 897 |
} |
899 |
} |
| 898 |
} |
900 |
} |
|
|
901 |
|
| 899 |
if ( $is_a_modif ) { |
902 |
if ( $is_a_modif ) { |
| 900 |
my $member = Koha::Patrons->find($loggedinuser); |
903 |
my $member = Koha::Patrons->find($loggedinuser); |
| 901 |
ModBiblio( |
904 |
ModBiblio( |