# Continue working on updateItem!!!!!!
#
+# updateItem is looking not bad. Need to add addSubfield and deleteSubfield
+# functions
+#
+# Trying to track down $dbh's that aren't disconnected....
+#
use strict;
}
}
}
+ $dbh->disconnect;
return($Subfield_ID, $Subfield_Key);
}
# Also, this subroutine should search through the $biblio object and compare it
# to the existing record and _LOG ALL CHANGES MADE_ in some way. I'd like for
# this logging feature to be usable to undo changes easily.
-#
-# Need to add support for bibliosubject, additionalauthors, bibliosubtitle tables
my ($env, $biblio) = @_;
my $biblionumber=$biblio->{'biblionumber'};
my $sth=$dbh->prepare("select * from biblio where biblionumber=$biblionumber");
$sth->execute;
my $origbiblio=$sth->fetchrow_hashref;
- $sth=$dbh->prepare("select subtitle from bibliosubtitle where biblionumber=$biblionumber"):
+ $sth=$dbh->prepare("select subtitle from bibliosubtitle where biblionumber=$biblionumber");
$sth->execute;
my ($subtitle)=$sth->fetchrow;
$origbiblio->{'subtitle'}=$subtitle;
my $origadditionalauthors;
while (my ($author) = $sth->fetchrow) {
push (@{$origbiblio->{'additionalauthors'}}, $author);
- $origadditionalauthors->{$subject}=1;
+ $origadditionalauthors->{$author}=1;
}
$sth=$dbh->prepare("select subject from bibliosubjects where biblionumber=$biblionumber");
$sth->execute;
# Check for subject heading changes
my $newsubject='';
+ my $subjects;
foreach $newsubject (@{$biblio->{'subject'}}) {
$subjects->{$newsubject}=1;
if ($origsubjects->{$newsubject}) {
}
}
}
+ my $origsubject;
foreach $origsubject (keys %$origsubjects) {
if ($subjects->{$origsubject} == 1) {
my $q_origsubject=$dbh->quote($origsubject);
}
}
+ $dbh->disconnect;
}
sub logchange {
my $item=shift;
my $original=shift;
my $new=shift;
- print "KOHA: $section $item $original $new\n";
+ print "KOHA: $type $section $item $original $new\n";
} elsif ($database eq 'marc') {
my $type=shift;
+ my $Record_ID=shift;
my $tag=shift;
my $mark=shift;
my $subfield_ID=shift;
my $original=shift;
my $new=shift;
- print "MARC: $tag $mark $subfield_ID $original $new\n";
+ print "MARC: $type $Record_ID $tag $mark $subfield_ID $original $new\n";
}
}
logchange('marc', 'change', $Record_ID, '010', 'a', $obi->{'lccn'}, $biblioitem->{'lccn'});
changeSubfield($Record_ID, '010', 'a', $obi->{'lccn'}, $biblioitem->{'lccn'});
}
+ $sth->finish;
+ $dbh->disconnect;
}
logchange('marc', 'delete', $Record_ID, '876', 'h', $Subfield_Key, 'Restricted');
}
}
+ $sth->finish;
+ $dbh->disconnect;
}
END { } # module clean-up code here (global destructor)