|
Lines 3-8
Link Here
|
| 3 |
|
3 |
|
| 4 |
use strict; |
4 |
use strict; |
| 5 |
use warnings; |
5 |
use warnings; |
|
|
6 |
use Modern::Perl; |
| 6 |
#use diagnostics; |
7 |
#use diagnostics; |
| 7 |
BEGIN { |
8 |
BEGIN { |
| 8 |
# find Koha's Perl modules |
9 |
# find Koha's Perl modules |
|
Lines 24-29
use C4::Koha;
Link Here
|
| 24 |
use C4::Debug; |
25 |
use C4::Debug; |
| 25 |
use C4::Charset; |
26 |
use C4::Charset; |
| 26 |
use C4::Items; |
27 |
use C4::Items; |
|
|
28 |
use C4::MarcModificationTemplates; |
| 29 |
|
| 27 |
use YAML; |
30 |
use YAML; |
| 28 |
use Unicode::Normalize; |
31 |
use Unicode::Normalize; |
| 29 |
use Time::HiRes qw(gettimeofday); |
32 |
use Time::HiRes qw(gettimeofday); |
|
Lines 43-48
my $cleanisbn = 1;
Link Here
|
| 43 |
my ($sourcetag,$sourcesubfield,$idmapfl, $dedup_barcode); |
46 |
my ($sourcetag,$sourcesubfield,$idmapfl, $dedup_barcode); |
| 44 |
my $framework = ''; |
47 |
my $framework = ''; |
| 45 |
my $localcust; |
48 |
my $localcust; |
|
|
49 |
my $marc_mod_template = ''; |
| 50 |
my $marc_mod_template_id = -1; |
| 46 |
|
51 |
|
| 47 |
$|=1; |
52 |
$|=1; |
| 48 |
|
53 |
|
|
Lines 79-84
GetOptions(
Link Here
|
| 79 |
'dedupbarcode' => \$dedup_barcode, |
84 |
'dedupbarcode' => \$dedup_barcode, |
| 80 |
'framework=s' => \$framework, |
85 |
'framework=s' => \$framework, |
| 81 |
'custom:s' => \$localcust, |
86 |
'custom:s' => \$localcust, |
|
|
87 |
'marcmodtemplate:s' => \$marc_mod_template, |
| 82 |
); |
88 |
); |
| 83 |
$biblios ||= !$authorities; |
89 |
$biblios ||= !$authorities; |
| 84 |
$insert ||= !$update; |
90 |
$insert ||= !$update; |
|
Lines 114-119
if(defined $localcust) { #local customize module
Link Here
|
| 114 |
$localcust=\&customize if $localcust; |
120 |
$localcust=\&customize if $localcust; |
| 115 |
} |
121 |
} |
| 116 |
|
122 |
|
|
|
123 |
if($marc_mod_template ne '') { |
| 124 |
my @templates = GetModificationTemplates(); |
| 125 |
foreach my $this_template (@templates) { |
| 126 |
if($this_template->{'name'} eq $marc_mod_template) { |
| 127 |
$marc_mod_template_id = $this_template->{'template_id'}; |
| 128 |
last; |
| 129 |
} |
| 130 |
} |
| 131 |
if($marc_mod_template_id < 0) { |
| 132 |
die "Can't located MARC modification template '$marc_mod_template'\n"; |
| 133 |
} |
| 134 |
} |
| 135 |
|
| 117 |
my $dbh = C4::Context->dbh; |
136 |
my $dbh = C4::Context->dbh; |
| 118 |
my $heading_fields=get_heading_fields(); |
137 |
my $heading_fields=get_heading_fields(); |
| 119 |
|
138 |
|
|
Lines 263-268
RECORD: while ( ) {
Link Here
|
| 263 |
} |
282 |
} |
| 264 |
} |
283 |
} |
| 265 |
SetUTF8Flag($record); |
284 |
SetUTF8Flag($record); |
|
|
285 |
if($marc_mod_template_id > 0) { |
| 286 |
print "Modifying MARC\n"; |
| 287 |
ModifyRecordWithTemplate( $marc_mod_template_id, $record ); |
| 288 |
} |
| 266 |
&$localcust($record) if $localcust; |
289 |
&$localcust($record) if $localcust; |
| 267 |
my $isbn; |
290 |
my $isbn; |
| 268 |
# remove trailing - in isbn (only for biblios, of course) |
291 |
# remove trailing - in isbn (only for biblios, of course) |
| 269 |
- |
|
|