From d9fa74c37e4d0f20661630c2ba8d0552a8141a37 Mon Sep 17 00:00:00 2001 From: tipaul Date: Thu, 19 Dec 2002 14:20:27 +0000 Subject: [PATCH] minor bugfix (for biblio modification) --- acqui.simple/addbiblio.pl | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/acqui.simple/addbiblio.pl b/acqui.simple/addbiblio.pl index 3175d45bde..ca013f176b 100755 --- a/acqui.simple/addbiblio.pl +++ b/acqui.simple/addbiblio.pl @@ -88,10 +88,18 @@ $record = MARCgetbiblio($dbh,$bibid) if ($bibid); $record = MARCfindbreeding($dbh,$isbn) if ($isbn); my $is_a_modif=0; my ($oldbiblionumtagfield,$oldbiblionumtagsubfield); +my ($oldbiblioitemnumtagfield,$oldbiblioitemnumtagsubfield,$bibitem,$oldbiblioitemnumber); if ($bibid) { $is_a_modif=1; -($oldbiblionumtagfield,$oldbiblionumtagsubfield) = &MARCfind_marc_from_kohafield($dbh,"biblio.biblionumber"); -warn "==>$oldbiblionumtagfield,$oldbiblionumtagsubfield"; + # if it's a modif, retrieve old biblio and bibitem numbers for the future modification of old-DB. + ($oldbiblionumtagfield,$oldbiblionumtagsubfield) = &MARCfind_marc_from_kohafield($dbh,"biblio.biblionumber"); + ($oldbiblioitemnumtagfield,$oldbiblioitemnumtagsubfield) = &MARCfind_marc_from_kohafield($dbh,"biblioitems.biblioitemnumber"); + # search biblioitems value + my $sth=$dbh->prepare("select biblioitemnumber from biblioitems where biblionumber=?"); + $sth->execute($oldbiblionumber); + ($oldbiblioitemnumber) = $sth->fetchrow; + warn "==>$oldbiblionumtagfield,$oldbiblionumtagsubfield"; + warn "==>$oldbiblioitemnumtagfield,$oldbiblioitemnumtagsubfield => $oldbiblioitemnumber"; } #------------------------------------------------------------------------------------------------------------------------------ @@ -291,6 +299,9 @@ if ($op eq "addbiblio") { oldbiblionumber => $oldbiblionumber, bibid => $bibid, oldbiblionumtagfield => $oldbiblionumtagfield, - oldbiblionumtagsubfield => $oldbiblionumtagsubfield); + oldbiblionumtagsubfield => $oldbiblionumtagsubfield, + oldbiblioitemnumtagfield => $oldbiblioitemnumtagfield, + oldbiblioitemnumtagsubfield => $oldbiblioitemnumtagsubfield, + oldbiblioitemnumber => $oldbiblioitemnumber); } print $input->header(-cookie => $cookie),$template->output; -- 2.39.5