Adding Branch Independancy.
[koha.git] / z3950 / z3950import.pl
index 3cbe20a..053a478 100644 (file)
@@ -42,6 +42,7 @@ use C4::Input;
 use C4::Biblio;
 use C4::SimpleMarc;
 use C4::Z3950;
+use C4::Breeding;
 use MARC::File::USMARC;
 use HTML::Template;
 
@@ -161,12 +162,12 @@ sub ProcessRecord {
     if ($file=~/Z-(\d+)/) {
        my $id=$1;
        my $resultsid=$input->param('resultsid');
-       my $sth=$dbh->prepare("select results from z3950results where id=$resultsid");
-       $sth->execute;
+       my $sth=$dbh->prepare("select results from z3950results where id=?");
+       $sth->execute($resultsid);
        ($data) = $sth->fetchrow;
     } else {
-       my $sth=$dbh->prepare("select marc from uploadedmarc where id=$file");
-       $sth->execute;
+       my $sth=$dbh->prepare("select marc from uploadedmarc where id=?");
+       $sth->execute($file);
        ($data) = $sth->fetchrow;
     }
 
@@ -252,8 +253,8 @@ sub ListFileRecords {
     # if z3950 results
     if (not $file=~/Z-(\d+)/) {
        # This is a Marc upload
-       $sth=$dbh->prepare("select marc,name from uploadedmarc where id=$file");
-       $sth->execute;
+       $sth=$dbh->prepare("select marc,name from uploadedmarc where id=?");
+       $sth->execute($file);
        ($data, $name) = $sth->fetchrow;
        $template->param(IS_MARC => 1);
        $template->param(recordsource => $name);
@@ -281,7 +282,7 @@ sub ListFileRecords {
                     $startdate,$enddate,$serverstring) = $sth->fetchrow ) {
                my ($srvid, $server, $database, $auth) = split(/\//, $serverstring, 4);
                if ( $server ) {
-                       my $srvname=&z3950servername($dbh,$srvid,"$server/$database");
+                       my $srvname=&z3950servername($srvid,"$server/$database");
                        $template->param(srvid => $srvid);
                        $template->param(srvname => $srvname);
                } # if $server
@@ -651,7 +652,7 @@ sub AcceptZ3950Queue {
           }
         }
 
-       $error=addz3950queue($dbh,$input->param('query'), $input->param('type'),
+       $error=addz3950queue($input->param('query'), $input->param('type'),
                $input->param('rand'), @serverlist);
        if ( $error ) {
            print qq|
@@ -805,7 +806,7 @@ sub AcceptBiblioitem {
        $biblioitem{volumeddesc}        =$input->param('volumeddesc');
        $biblioitem{illus}              =$input->param('illustrator');
        $biblioitem{pages}              =$input->param('pages');
-       $biblioitem{notes}              =$input->param('notes');
+       $biblioitem{bnotes}             =$input->param('notes');
        $biblioitem{size}               =$input->param('size');
        $biblioitem{place}              =$input->param('place');
        $biblioitem{lccn}               =$input->param('lccn');
@@ -996,6 +997,23 @@ sub FormatMarcText {
 
 #---------------
 # $Log$
+# Revision 1.5  2004/01/12 16:56:29  tipaul
+# synch'ing with rel_2_0
+#
+# Revision 1.4.2.1  2004/01/08 16:31:54  slef
+# DBI call fix for bug 662. No syntax check: missing module?
+#
+# Revision 1.4  2003/07/15 00:02:49  slef
+# Work on bug 515... can we do a single-side rename of notes to bnotes?
+#
+# Revision 1.3  2003/04/22 12:22:53  tipaul
+# 1st draft for z3950 client import.
+# moving Breeding farm script to a perl package C4/Breeding.pm
+#
+# Revision 1.2  2003/02/19 01:01:11  wolfpac444
+# Removed the unecessary $dbh argument from being passed.
+# Resolved a few minor FIXMEs.
+#
 # Revision 1.1  2002/11/22 10:15:22  tipaul
 # moving z3950 related scripts to specific dir
 #