From tonnesen@users.sourceforge.net Fri Oct 5 14:19:32 2001 From: Steve Tonnesen To: koha-devel@lists.koha-community.org Subject: [Koha-devel] CVS: koha/acqui.simple addbooks.pl,NONE,1.1 viewmarc.pl,NONE,1.1 Date: Fri, 05 Oct 2001 14:20:04 +0000 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3438059610451092184==" --===============3438059610451092184== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Update of /cvsroot/koha/koha/acqui.simple In directory usw-pr-cvs1:/tmp/cvs-serv13572/koha/acqui.simple Added Files: addbooks.pl viewmarc.pl=20 Log Message: Added simple acquisitions script --- NEW FILE --- #!/usr/bin/perl # # TODO # # Add info on biblioitems and items already entered as you enter new ones # use C4::Database; use CGI; use strict; use C4::Acquisitions; use C4::Output; my $input =3D new CGI; my $dbh=3DC4Connect; my $isbn=3D$input->param('isbn'); my $q_isbn=3D$dbh->quote($isbn); my $biblioitemnumber; print $input->header; print startpage(); print startmenu('acquisitions'); ($input->param('checkforbiblio')) && (checkforbiblio()); ($input->param('newbiblioitem')) && (newbiblioitem()); ($input->param('newitem')) && (newitem()); sub checkforbiblio { my $title=3D$input->param('title'); my $q_title=3D$dbh->quote($title); my $author=3D$input->param('author'); my $q_author=3D$dbh->quote($author); my $seriestitle=3D$input->param('seriestitle'); my $serial=3D0; ($seriestitle) && ($serial=3D1); my $q_seriestitle=3D$dbh->quote($seriestitle); my $copyrightdate=3D$input->param('copyrightdate'); my $q_copyrightdate=3D$dbh->quote($copyrightdate); my $notes=3D$input->param('notes'); my $q_notes=3D$dbh->quote($notes); my $subtitle=3D$input->param('subtitle'); my $q_subtitle=3D$dbh->quote($subtitle); my $sth=3D$dbh->prepare("select biblionumber from biblio where title=3D$q= _title and author=3D$q_author and copyrightdate=3D$q_copyrightdate"); $sth->execute; my $biblionumber=3D0; if ($sth->rows) { ($biblionumber) =3D $sth->fetchrow; } else { print "Adding new biblio for $title by $author
\n"; my $sth=3D$dbh->prepare("select max(biblionumber) from biblio"); $sth->execute; ($biblionumber) =3D $sth->fetchrow; $biblionumber++; $sth=3D$dbh->prepare("insert into biblio (biblionumber, title, author, serial, seriestitle, copyrightdate, notes) values ($biblionumber, $q_title, $q_author, $serial, $q_seriestitle, $q_copyrightdate, $q_notes)"); $sth->execute; $sth=3D$dbh->prepare("insert into bibliosubtitle (subtitle, biblionumber) values ($q_subtitle, $biblionumber)"); $sth->execute; } my $itemtypeselect=3D''; $sth=3D$dbh->prepare("select itemtype,description from itemtypes"); $sth->execute; while (my ($itemtype, $description) =3D $sth->fetchrow) { $itemtypeselect.=3D"