Lines 52-61
$dbh->{AutoCommit} = 0;
Link Here
|
52 |
#sysprefs |
52 |
#sysprefs |
53 |
C4::Context->disable_syspref_cache() if ( defined( C4::Context->disable_syspref_cache() ) ); |
53 |
C4::Context->disable_syspref_cache() if ( defined( C4::Context->disable_syspref_cache() ) ); |
54 |
my $CataloguingLog = C4::Context->preference('CataloguingLog'); |
54 |
my $CataloguingLog = C4::Context->preference('CataloguingLog'); |
55 |
my $dontmerge = C4::Context->preference('dontmerge'); |
55 |
my $mergelimit = C4::Context->preference('AuthorityMergeLimit'); |
56 |
$dontmerge = "0" unless defnonull($dontmerge); |
|
|
57 |
$dbh->do("UPDATE systempreferences SET value=0 WHERE variable='CataloguingLog'"); |
56 |
$dbh->do("UPDATE systempreferences SET value=0 WHERE variable='CataloguingLog'"); |
58 |
$dbh->do("UPDATE systempreferences SET value=1 where variable='dontmerge'"); |
57 |
$dbh->do("UPDATE systempreferences SET value=0 where variable='AuthorityMergeLimit'"); |
59 |
$dbh->commit() unless $test_parameter; |
58 |
$dbh->commit() unless $test_parameter; |
60 |
my ( $itemfield, $itemnumbersubfield ) = &GetMarcFromKohaField( "items.itemnumber", '' ); |
59 |
my ( $itemfield, $itemnumbersubfield ) = &GetMarcFromKohaField( "items.itemnumber", '' ); |
61 |
|
60 |
|
Lines 98-113
while ( my ( $biblionumber, $biblioitemnumber, $frameworkcode ) = $sth->fetchrow
Link Here
|
98 |
|
97 |
|
99 |
my $sthCataloguingLog = $dbh->prepare("UPDATE systempreferences SET value=? WHERE variable='CataloguingLog'"); |
98 |
my $sthCataloguingLog = $dbh->prepare("UPDATE systempreferences SET value=? WHERE variable='CataloguingLog'"); |
100 |
$sthCataloguingLog->execute($CataloguingLog); |
99 |
$sthCataloguingLog->execute($CataloguingLog); |
101 |
my $sthdontmerge = $dbh->prepare("UPDATE systempreferences SET value=? WHERE variable='dontmerge'"); |
100 |
my $sthmergelimit = $dbh->prepare("UPDATE systempreferences SET value=? WHERE variable='AuthorityMergeLimit'"); |
102 |
$sthdontmerge->execute($dontmerge); |
101 |
$sthmergelimit->execute($mergelimit); |
103 |
$dbh->commit() unless $test_parameter; |
102 |
$dbh->commit() unless $test_parameter; |
104 |
my $timeneeded = time() - $starttime; |
103 |
my $timeneeded = time() - $starttime; |
105 |
print "$count MARC record done in $timeneeded seconds\n"; |
104 |
print "$count MARC record done in $timeneeded seconds\n"; |
106 |
if ( scalar(@errors) > 0 ) { |
105 |
if ( scalar(@errors) > 0 ) { |
107 |
print "Some biblionumber could not be processed though: ", join( " ", @errors ); |
106 |
print "Some biblionumber could not be processed though: ", join( " ", @errors ); |
108 |
} |
107 |
} |
109 |
|
|
|
110 |
sub defnonull { |
111 |
my $var = shift; |
112 |
return defined $var && $var ne q{}; |
113 |
} |