[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] CVS: koha/C4 Catalogue.pm,1.11,1.12
From: |
Steve Tonnesen |
Subject: |
[Koha-cvs] CVS: koha/C4 Catalogue.pm,1.11,1.12 |
Date: |
Thu, 16 May 2002 11:10:37 -0700 |
Update of /cvsroot/koha/koha/C4
In directory usw-pr-cvs1:/tmp/cvs-serv16463
Modified Files:
Catalogue.pm
Log Message:
Starting rewrite of Catalogue.pm using Paul's new marc schema, and Alan's
koha-wide ban on $dbh->quote. :)
Index: Catalogue.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Catalogue.pm,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** Catalogue.pm 6 Nov 2001 18:15:34 -0000 1.11
--- Catalogue.pm 16 May 2002 18:10:35 -0000 1.12
***************
*** 66,91 ****
my $dbh=&C4Connect;
my $title=$biblio->{'title'};
- my $q_title=$dbh->quote($title);
my $subtitle=$biblio->{'subtitle'};
- my $q_subtitle=$dbh->quote($subtitle);
- ($q_subtitle) || ($q_subtitle="''");
my $author=$biblio->{'author'};
- my $q_author=$dbh->quote($author);
my $unititle=$biblio->{'unititle'};
- my $q_unititle=$dbh->quote($unititle);
my $copyrightdate=$biblio->{'copyrightdate'};
my $serial=$biblio->{'serial'};
my $seriestitle=$biblio->{'seriestitle'};
- my $q_seriestitle=$dbh->quote($seriestitle);
my $notes=$biblio->{'notes'};
- my $q_notes=$dbh->quote($notes);
my $subject=$biblio->{'subject'};
my $additionalauthors=$biblio->{'additionalauthors'};
my $sth=$dbh->prepare("select max(biblionumber) from biblio");
$sth->execute;
my ($biblionumber) = $sth->fetchrow;
$biblionumber++;
! $sth=$dbh->prepare("insert into biblio
(biblionumber,title,author,unititle,copyrightdate,serial,seriestitle,notes)
values
($biblionumber,$q_title,$q_author,$q_unititle,$copyrightdate,$serial,$q_seriestitle,$q_notes)");
! $sth->execute;
$sth=$dbh->prepare("insert into bibliosubtitle (biblionumber,subtitle)
values ($biblionumber,$q_subtitle)");
$sth->execute;
--- 66,89 ----
my $dbh=&C4Connect;
my $title=$biblio->{'title'};
my $subtitle=$biblio->{'subtitle'};
my $author=$biblio->{'author'};
my $unititle=$biblio->{'unititle'};
my $copyrightdate=$biblio->{'copyrightdate'};
my $serial=$biblio->{'serial'};
my $seriestitle=$biblio->{'seriestitle'};
my $notes=$biblio->{'notes'};
my $subject=$biblio->{'subject'};
my $additionalauthors=$biblio->{'additionalauthors'};
+
+ # Why am I doing this? This is a potential race condition. At the very
least,
+ # this needs code to ensure that two inserts didn't use the same
+ # biblionumber...
+
my $sth=$dbh->prepare("select max(biblionumber) from biblio");
$sth->execute;
my ($biblionumber) = $sth->fetchrow;
$biblionumber++;
! $sth=$dbh->prepare("insert into biblio
(biblionumber,title,author,unititle,copyrightdate,serial,seriestitle,notes)
values (?, ?, ?, ?, ?, ?, ?, ?)");
! $sth->execute($biblionumber, $title, $author, $unititle, $copyrightdate,
$serial, $seriestitle, $notes);
$sth=$dbh->prepare("insert into bibliosubtitle (biblionumber,subtitle)
values ($biblionumber,$q_subtitle)");
$sth->execute;
***************
*** 96,102 ****
}
foreach (@$additionalauthors) {
! my $q_additionalauthor=$dbh->quote($_);
! my $sth=$dbh->prepare("insert into additionalauthors
(biblionumber,author) values ($biblionumber,$q_additionalauthor)");
! $sth->execute;
}
}
--- 94,99 ----
}
foreach (@$additionalauthors) {
! my $sth=$dbh->prepare("insert into additionalauthors
(biblionumber,author) values (?, ?)");
! $sth->execute($biblionumber, $additionalauthor);
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Koha-cvs] CVS: koha/C4 Catalogue.pm,1.11,1.12,
Steve Tonnesen <=