[Koha-cvs] CVS: koha/acqui.simple marcimport.pl,1.16,1.17

Andrew Arensburger arensb at users.sourceforge.net
Sun Oct 13 09:39:28 CEST 2002


Update of /cvsroot/koha/koha/acqui.simple
In directory usw-pr-cvs1:/tmp/cvs-serv5498

Modified Files:
	marcimport.pl 
Log Message:
Added magic RCS comment.
Removed trailing whitespace.


Index: marcimport.pl
===================================================================
RCS file: /cvsroot/koha/koha/acqui.simple/marcimport.pl,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -r1.16 -r1.17
*** marcimport.pl	11 Oct 2002 12:45:10 -0000	1.16
--- marcimport.pl	13 Oct 2002 07:39:26 -0000	1.17
***************
*** 85,89 ****
  if ($input->param('z3950queue')) {
  	AcceptZ3950Queue($dbh,$input);
! } 
  
  if ($input->param('uploadmarc')) {
--- 85,89 ----
  if ($input->param('z3950queue')) {
  	AcceptZ3950Queue($dbh,$input);
! }
  
  if ($input->param('uploadmarc')) {
***************
*** 158,162 ****
  	$data,
      );
! 	
      if ($file=~/Z-(\d+)/) {
  	my $id=$1;
--- 158,162 ----
  	$data,
      );
! 
      if ($file=~/Z-(\d+)/) {
  	my $id=$1;
***************
*** 170,174 ****
  	($data) = $sth->fetchrow;
      }
!     
      my $file=MARC::File::USMARC->indata ($data);
      my $oldkoha;
--- 170,174 ----
  	($data) = $sth->fetchrow;
      }
! 
      my $file=MARC::File::USMARC->indata ($data);
      my $oldkoha;
***************
*** 217,221 ****
      $template->param(file => $data);
      print "Content-Type: text/html\n\n", $template->output;
! }    
  
  # lists all records from the MARC file
--- 217,221 ----
      $template->param(file => $data);
      print "Content-Type: text/html\n\n", $template->output;
! }
  
  # lists all records from the MARC file
***************
*** 244,248 ****
      my ($numrecords,$resultsid,$data,$startdate,$enddate);
  		# FIXME - there's already a $data a few lines above.
!     
      $dbh = C4::Context->dbh;
  
--- 244,248 ----
      my ($numrecords,$resultsid,$data,$startdate,$enddate);
  		# FIXME - there's already a $data a few lines above.
! 
      $dbh = C4::Context->dbh;
  
***************
*** 250,254 ****
  
      # File can be z3950 search query or uploaded MARC data
!     
      # if z3950 results
      if (not $file=~/Z-(\d+)/) {
--- 250,254 ----
  
      # File can be z3950 search query or uploaded MARC data
! 
      # if z3950 results
      if (not $file=~/Z-(\d+)/) {
***************
*** 262,278 ****
  
      if ($file=~/Z-(\d+)/) {
! 	# This is a z3950 search 
  	$template->param(IS_Z3950 =>1);
  	my $id=$1;		# search query id number
  	my $serverstring;
  	my $starttimer=time();
! 	
  	$sth=$dbh->prepare("
  		select z3950results.numrecords,z3950results.id,z3950results.results,
! 			z3950results.startdate,z3950results.enddate,server 
! 		from z3950queue left outer join z3950results 
! 		     on z3950queue.id=z3950results.queryid 
  		where z3950queue.id=?
! 		order by server  
  	    ");
  	$sth->execute($id);
--- 262,278 ----
  
      if ($file=~/Z-(\d+)/) {
! 	# This is a z3950 search
  	$template->param(IS_Z3950 =>1);
  	my $id=$1;		# search query id number
  	my $serverstring;
  	my $starttimer=time();
! 
  	$sth=$dbh->prepare("
  		select z3950results.numrecords,z3950results.id,z3950results.results,
! 			z3950results.startdate,z3950results.enddate,server
! 		from z3950queue left outer join z3950results
! 		     on z3950queue.id=z3950results.queryid
  		where z3950queue.id=?
! 		order by server
  	    ");
  	$sth->execute($id);
***************
*** 315,319 ****
  		    $template->param(previous => $previous);
  		    $template->param(next => $next);
! 		    my $stj=$dbh->prepare("update z3950results 
  			set highestseen=? where id=?");
  		    $stj->execute($startrecord+10,$resultsid);
--- 315,319 ----
  		    $template->param(previous => $previous);
  		    $template->param(next => $next);
! 		    my $stj=$dbh->prepare("update z3950results
  			set highestseen=? where id=?");
  		    $stj->execute($startrecord+10,$resultsid);
***************
*** 354,358 ****
  	} else {
  #
! # This is an uploaded Marc record   
  #
  	    my @loop = ();
--- 354,358 ----
  	} else {
  #
! # This is an uploaded Marc record
  #
  	    my @loop = ();
***************
*** 389,394 ****
  #    $bib=extractmarcfields($record);
  
!     $sth=$dbh->prepare("select * 
! 	  from biblioitems 
  	  where (isbn=? and isbn!='')  or (issn=? and issn!='')  or (lccn=? and lccn!='') ");
      $sth->execute($oldkoha->{isbn},$oldkoha->{issn},$oldkoha->{lccn});
--- 389,394 ----
  #    $bib=extractmarcfields($record);
  
!     $sth=$dbh->prepare("select *
! 	  from biblioitems
  	  where (isbn=? and isbn!='')  or (issn=? and issn!='')  or (lccn=? and lccn!='') ");
      $sth->execute($oldkoha->{isbn},$oldkoha->{issn},$oldkoha->{lccn});
***************
*** 399,403 ****
      }
      ($oldkoha->{author}) && ($oldkoha->{author}="by $oldkoha->{author}");
!     
      $searchfield="";
      foreach $fieldname ( "controlnumber", "lccn", "issn", "isbn") {
--- 399,403 ----
      }
      ($oldkoha->{author}) && ($oldkoha->{author}="by $oldkoha->{author}");
! 
      $searchfield="";
      foreach $fieldname ( "controlnumber", "lccn", "issn", "isbn") {
***************
*** 440,444 ****
      	$elapsedtime,
  	$resultstatus, $statuscolor,
! 	$id, $term, $type, $done, 
  	$startdate, $enddate, $servers,
  	$record,$bib,$title,
--- 440,444 ----
      	$elapsedtime,
  	$resultstatus, $statuscolor,
! 	$id, $term, $type, $done,
  	$startdate, $enddate, $servers,
  	$record,$bib,$title,
***************
*** 465,474 ****
      # Check queued queries
      $sth=$dbh->prepare("select id,term,type,done,
! 		startdate,enddate,servers 
! 	from z3950queue 
! 	order by id desc 
  	limit 20 ");
      $sth->execute;
!     while ( ($id, $term, $type, $done, 
  		$startdate, $enddate, $servers) = $sth->fetchrow) {
  	$type=uc($type);
--- 465,474 ----
      # Check queued queries
      $sth=$dbh->prepare("select id,term,type,done,
! 		startdate,enddate,servers
! 	from z3950queue
! 	order by id desc
  	limit 20 ");
      $sth->execute;
!     while ( ($id, $term, $type, $done,
  		$startdate, $enddate, $servers) = $sth->fetchrow) {
  	$type=uc($type);
***************
*** 479,483 ****
  	# See if query produced results
  	$sti=$dbh->prepare("select id,server,startdate,enddate,numrecords,results
! 		from z3950results 
  		where queryid=?");
  	$sti->execute($id);
--- 479,483 ----
  	# See if query produced results
  	$sti=$dbh->prepare("select id,server,startdate,enddate,numrecords,results
! 		from z3950results
  		where queryid=?");
  	$sti->execute($id);
***************
*** 486,490 ****
  	    $realenddate=0;
  	    $totalrecords=0;
! 	    while (my ($r_id,$r_server,$r_startdate,$r_enddate,$r_numrecords,$r_marcdata) 
  		= $sti->fetchrow) {
  		if ($r_enddate==0) {
--- 486,490 ----
  	    $realenddate=0;
  	    $totalrecords=0;
! 	    while (my ($r_id,$r_server,$r_startdate,$r_enddate,$r_numrecords,$r_marcdata)
  		= $sti->fetchrow) {
  		if ($r_enddate==0) {
***************
*** 543,548 ****
      print "<td valign=top width=30%>\n";
  
!     my $sth=$dbh->prepare("select id,name,checked 
! 	from z3950servers 
  	order by rank");
  		# FIXME - There's already a $sth in this function.
--- 543,548 ----
      print "<td valign=top width=30%>\n";
  
!     my $sth=$dbh->prepare("select id,name,checked
! 	from z3950servers
  	order by rank");
  		# FIXME - There's already a $sth in this function.
***************
*** 554,558 ****
      }
      $serverlist.="<input type=checkbox name=S-MAN> <input name=manualz3950server size=25 value=otherserver:210/DATABASE>\n";
!     
      my $rand=rand(1000000000);
  print << "EOF";
--- 554,558 ----
      }
      $serverlist.="<input type=checkbox name=S-MAN> <input name=manualz3950server size=25 value=otherserver:210/DATABASE>\n";
! 
      my $rand=rand(1000000000);
  print << "EOF";
***************
*** 567,574 ****
      <tr><td>Query Term</td><td><input name=query></td></tr>
      <tr><td colspan=2 align=center>
! 		<input type=radio name=type value=isbn checked>&nbsp;ISBN 
  		<input type=radio name=type value=lccn        >&nbsp;LCCN<br>
! 		<input type=radio name=type value=author      >&nbsp;Author 
! 		<input type=radio name=type value=title       >&nbsp;Title 
  		<input type=radio name=type value=keyword     >&nbsp;Keyword</td></tr>
              <tr><td colspan=2> $serverlist </td></tr>
--- 567,574 ----
      <tr><td>Query Term</td><td><input name=query></td></tr>
      <tr><td colspan=2 align=center>
! 		<input type=radio name=type value=isbn checked>&nbsp;ISBN
  		<input type=radio name=type value=lccn        >&nbsp;LCCN<br>
! 		<input type=radio name=type value=author      >&nbsp;Author
! 		<input type=radio name=type value=title       >&nbsp;Title
  		<input type=radio name=type value=keyword     >&nbsp;Keyword</td></tr>
              <tr><td colspan=2> $serverlist </td></tr>
***************
*** 653,657 ****
          }
  
! 	$error=addz3950queue($dbh,$input->param('query'), $input->param('type'), 
  		$input->param('rand'), @serverlist);
  	if ( $error ) {
--- 653,657 ----
          }
  
! 	$error=addz3950queue($dbh,$input->param('query'), $input->param('type'),
  		$input->param('rand'), @serverlist);
  	if ( $error ) {
***************
*** 670,674 ****
  system init directory so that is running after the machine starts up.
  |;
! 	
  	    } # if daemon
  	    print qq|
--- 670,674 ----
  system init directory so that is running after the machine starts up.
  |;
! 
  	    } # if daemon
  	    print qq|
***************
*** 709,714 ****
      my $q_marcrecord=$dbh->quote($marcrecord);
      my $q_name=$dbh->quote($name);
!     my $sth=$dbh->prepare("insert into uploadedmarc 
! 		(marc,name) 
  	values ($q_marcrecord, $q_name)");
      $sth->execute;
--- 709,714 ----
      my $q_marcrecord=$dbh->quote($marcrecord);
      my $q_name=$dbh->quote($name);
!     my $sth=$dbh->prepare("insert into uploadedmarc
! 		(marc,name)
  	values ($q_marcrecord, $q_name)");
      $sth->execute;
***************
*** 758,763 ****
      # See if it already exists
      # FIXME - There's already a $sth in this context.
!     my $sth=$dbh->prepare("select biblionumber,biblioitemnumber 
! 	from biblioitems 
  	where isbn=? or issn=? or lccn=?");
      $sth->execute($oldkoha->{isbn},$oldkoha->{issn},$oldkoha->{lccn});
--- 758,763 ----
      # See if it already exists
      # FIXME - There's already a $sth in this context.
!     my $sth=$dbh->prepare("select biblionumber,biblioitemnumber
! 	from biblioitems
  	where isbn=? or issn=? or lccn=?");
      $sth->execute($oldkoha->{isbn},$oldkoha->{issn},$oldkoha->{lccn});
***************
*** 777,788 ****
    	my %biblio;
    	my %biblioitem;
!   
    	# convert to upper case and split on lines
    	my $subjectheadings=$input->param('subject');
    	my @subjectheadings=split(/[\r\n]+/,$subjectheadings);
!   
    	my $additionalauthors=$input->param('additionalauthors');
    	my @additionalauthors=split(/[\r\n]+|\|/,uc($additionalauthors));
!   
    	# Use individual assignments to hash buckets, in case
    	#  any of the input parameters are empty or don't exist
--- 777,788 ----
    	my %biblio;
    	my %biblioitem;
! 
    	# convert to upper case and split on lines
    	my $subjectheadings=$input->param('subject');
    	my @subjectheadings=split(/[\r\n]+/,$subjectheadings);
! 
    	my $additionalauthors=$input->param('additionalauthors');
    	my @additionalauthors=split(/[\r\n]+|\|/,uc($additionalauthors));
! 
    	# Use individual assignments to hash buckets, in case
    	#  any of the input parameters are empty or don't exist
***************
*** 794,798 ****
    	$biblio{abstract}	=$input->param('abstract');
    	$biblio{subtitle}	=$input->param('subtitle');
!   
   	$biblioitem{volume}		=$input->param('volume');
    	$biblioitem{number}		=$input->param('number');
--- 794,798 ----
    	$biblio{abstract}	=$input->param('abstract');
    	$biblio{subtitle}	=$input->param('subtitle');
! 
   	$biblioitem{volume}		=$input->param('volume');
    	$biblioitem{number}		=$input->param('number');
***************
*** 824,831 ****
  # 		\@additionalauthors
  # 	);
!   
   	if ( $error ) {
  	    print "<H2>Error adding biblio item</H2> $error\n";
! 	} else { 
  	    $template->param(title => $title);
  	    $template->param(biblionumber => $biblionumber);
--- 824,831 ----
  # 		\@additionalauthors
  # 	);
! 
   	if ( $error ) {
  	    print "<H2>Error adding biblio item</H2> $error\n";
! 	} else {
  	    $template->param(title => $title);
  	    $template->param(biblionumber => $biblionumber);
***************
*** 868,873 ****
      my $replacementprice=($input->param('replacementprice') || 0);
  
!     my $sth=$dbh->prepare("select barcode 
! 	from items 
  	where barcode=?");
      $sth->execute($barcode);
--- 868,873 ----
      my $replacementprice=($input->param('replacementprice') || 0);
  
!     my $sth=$dbh->prepare("select barcode
! 	from items
  	where barcode=?");
      $sth->execute($barcode);
***************
*** 999,1002 ****
--- 999,1006 ----
  #---------------
  # $Log$
+ # Revision 1.17  2002/10/13 07:39:26  arensb
+ # Added magic RCS comment.
+ # Removed trailing whitespace.
+ #
  # Revision 1.16  2002/10/11 12:45:10  arensb
  # Replaced &requireDBI with C4::Context->dbh, thus making the "use





More information about the Koha-cvs mailing list