[Koha-cvs] CVS: koha/acqui.simple marcimport.pl,1.6.2.15,1.6.2.16

Alan Millar amillar at users.sourceforge.net
Sun Jun 9 22:41:01 CEST 2002


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

Modified Files:
      Tag: rel-1-2
	marcimport.pl 
Log Message:
Minor cleanups and comments

Index: marcimport.pl
===================================================================
RCS file: /cvsroot/koha/koha/acqui.simple/marcimport.pl,v
retrieving revision 1.6.2.15
retrieving revision 1.6.2.16
diff -C2 -r1.6.2.15 -r1.6.2.16
*** marcimport.pl	9 Jun 2002 05:28:25 -0000	1.6.2.15
--- marcimport.pl	9 Jun 2002 20:40:59 -0000	1.6.2.16
***************
*** 92,96 ****
  	['082', 'a', 'dewey',			0	],
  	['100', 'a', 'author',			0	],
! 	['245', 'a', 'title',			0	],
  	['245', 'b', 'subtitle',		0	],
  	['260', 'a', 'place',			0, ':'	],
--- 92,96 ----
  	['082', 'a', 'dewey',			0	],
  	['100', 'a', 'author',			0	],
! 	['245', 'a', 'title',			0, ':;'	],
  	['245', 'b', 'subtitle',		0	],
  	['260', 'a', 'place',			0, ':'	],
***************
*** 226,231 ****
  		$bib,		# hash ref to named fields
  		$fieldlist,	# list ref
! 		$lccn, $isbn, $issn, $dewey, $author, 
! 		$place, $publisher, $publicationyear, $volume, 
  		$number, @subjects, $notes, $additionalauthors, 
  		$copyrightdate, $seriestitle,
--- 226,231 ----
  		$bib,		# hash ref to named fields
  		$fieldlist,	# list ref
! 		$lccn, $isbn, $issn, $dewey, 
! 		$publisher, $publicationyear, $volume, 
  		$number, @subjects, $notes, $additionalauthors, 
  		$copyrightdate, $seriestitle,
***************
*** 274,279 ****
  		$isbn			=$bib->{isbn};
  		$issn			=$bib->{issn};
- 		$author			=$bib->{author};
- 		$place			=$bib->{place};
  		$publisher		=$bib->{publisher};
  		$publicationyear	=$bib->{publicationyear};
--- 274,277 ----
***************
*** 289,293 ****
  	    $marcinput=$input->hidden(-name=>'marc', -default=>$marc);
  	    $subtitleinput=$input->textfield(-name=>'subtitle', -default=>$bib->{subtitle}, -size=>40);
! 	    $authorinput=$input->textfield(-name=>'author', -default=>$author);
  	    $illustratorinput=$input->textfield(-name=>'illustrator', 
  		-default=>$bib->{illustrator});
--- 287,291 ----
  	    $marcinput=$input->hidden(-name=>'marc', -default=>$marc);
  	    $subtitleinput=$input->textfield(-name=>'subtitle', -default=>$bib->{subtitle}, -size=>40);
! 	    $authorinput=$input->textfield(-name=>'author', -default=>$bib->{author});
  	    $illustratorinput=$input->textfield(-name=>'illustrator', 
  		-default=>$bib->{illustrator});
***************
*** 315,324 ****
  	    $isbninput=$input->textfield(-name=>'isbn', -default=>$isbn);
  	    $deweyinput=$input->textfield(-name=>'dewey', -default=>$bib->{dewey});
! 	    $cleanauthor=$author;
  	    $cleanauthor=~s/[^A-Za-z]//g;
  	    $subclassinput=$input->textfield(-name=>'subclass', -default=>uc(substr($cleanauthor,0,3)));
  	    $publisherinput=$input->textfield(-name=>'publishercode', -default=>$publisher);
  	    $pubyearinput=$input->textfield(-name=>'publicationyear', -default=>$publicationyear);
! 	    $placeinput=$input->textfield(-name=>'place', -default=>$place);
  	    $pagesinput=$input->textfield(-name=>'pages', -default=>$bib->{pages});
  	    $sizeinput=$input->textfield(-name=>'size', -default=>$bib->{size});
--- 313,322 ----
  	    $isbninput=$input->textfield(-name=>'isbn', -default=>$isbn);
  	    $deweyinput=$input->textfield(-name=>'dewey', -default=>$bib->{dewey});
! 	    $cleanauthor=$bib->{author};
  	    $cleanauthor=~s/[^A-Za-z]//g;
  	    $subclassinput=$input->textfield(-name=>'subclass', -default=>uc(substr($cleanauthor,0,3)));
  	    $publisherinput=$input->textfield(-name=>'publishercode', -default=>$publisher);
  	    $pubyearinput=$input->textfield(-name=>'publicationyear', -default=>$publicationyear);
! 	    $placeinput=$input->textfield(-name=>'place', -default=>$bib->{place});
  	    $pagesinput=$input->textfield(-name=>'pages', -default=>$bib->{pages});
  	    $sizeinput=$input->textfield(-name=>'size', -default=>$bib->{size});
***************
*** 330,334 ****
  
  	    #print "<PRE>getting itemtypeselect</PRE>\n";
! 	    $itemtypeselect=&GetKeyTableSelectOptions(
  		$dbh, 'itemtypes', 'itemtype', 'description', 1);
  	    #print "<PRE>it=$itemtypeselect</PRE>\n";
--- 328,332 ----
  
  	    #print "<PRE>getting itemtypeselect</PRE>\n";
! 	    $itemtypeselect=&getkeytableselectoptions(
  		$dbh, 'itemtypes', 'itemtype', 'description', 1);
  	    #print "<PRE>it=$itemtypeselect</PRE>\n";
***************
*** 418,423 ****
--- 416,423 ----
  	# if z3950 results
  	if ($file=~/Z-(\d+)/) {
+ 	    # This is a z3950 search 
  	    $recordsource='';
  	} else {
+ 	    # This is a Marc upload
  	    my $sth=$dbh->prepare("select marc,name from uploadedmarc where id=$file");
  	    $sth->execute;
***************
*** 425,441 ****
  	    $recordsource="from $name";
  	}
! 	    print << "EOF";
! 	<center>
! 	<p>
! 	<a href=$ENV{'SCRIPT_NAME'}?menu=$menu>Select a New File</a>
! 	<p>
! 	<table border=0 cellpadding=10 cellspacing=0>
! 	<tr><th bgcolor=black>
! 	  <font color=white>Select a Record to Import $recordsource</font>
! 	</th></tr>
! 	<tr><td bgcolor=#dddddd>
  EOF
  	if ($file=~/Z-(\d+)/) {
! 	    my $id=$1;
  	    my $sth=$dbh->prepare("select servers from z3950queue where id=$id");
  	    $sth->execute;
--- 425,445 ----
  	    $recordsource="from $name";
  	}
! 
! 	print << "EOF";
! 	  <center>
! 	  <p>
! 	  <a href=$ENV{'SCRIPT_NAME'}?menu=$menu>Select a New File</a>
! 	  <p>
! 	  <table border=0 cellpadding=10 cellspacing=0>
! 	  <tr><th bgcolor=black>
! 	    <font color=white>Select a Record to Import $recordsource</font>
! 	  </th></tr>
! 	  <tr><td bgcolor=#dddddd>
  EOF
+ 
  	if ($file=~/Z-(\d+)/) {
! 	    # This is a z3950 search 
! 
! 	    my $id=$1;		# search results id number
  	    my $sth=$dbh->prepare("select servers from z3950queue where id=$id");
  	    $sth->execute;
***************
*** 495,500 ****
  		}
  		print "<ul>\n";
! 		my $stj=$dbh->prepare("update z3950results set highestseen=".($startrecord+10)." where id=$resultsid");
! 		$stj->execute;
  		if ($sti->rows == 0) {
  		    print "pending...";
--- 499,506 ----
  		}
  		print "<ul>\n";
! 		my $stj=$dbh->prepare("update z3950results 
! 			set highestseen=? where id=?");
! 		$stj->execute($startrecord+10,$resultsid);
! 
  		if ($sti->rows == 0) {
  		    print "pending...";
***************
*** 533,537 ****
  	    print "<hr>It took $elapsed seconds to process this page.\n";
  	} else {
! 	    
  	    my @records=parsemarcfileformat($data);
  	    foreach $record (@records) {
--- 539,544 ----
  	    print "<hr>It took $elapsed seconds to process this page.\n";
  	} else {
! 	    # This is an uploaded Marc record   
! 
  	    my @records=parsemarcfileformat($data);
  	    foreach $record (@records) {
***************
*** 603,606 ****
--- 610,614 ----
      # return 
      my $bib;		# pointer to hash of named output fields
+ 			# Example: $bib->{'author'} = "Twain, Mark";
  
      my $debug=0;
***************
*** 1262,1266 ****
      }
  
!     my $branchselect=GetKeyTableSelectOptions(
  		$dbh, 'branches', 'branchcode', 'branchname', 0);
  
--- 1270,1274 ----
      }
  
!     my $branchselect=getkeytableselectoptions(
  		$dbh, 'branches', 'branchcode', 'branchname', 0);
  
***************
*** 1337,1341 ****
  # Create an HTML option list for a <SELECT> form tag by using
  #    values from a DB file
! sub GetKeyTableSelectOptions {
  	use strict;
  	# inputs
--- 1345,1349 ----
  # Create an HTML option list for a <SELECT> form tag by using
  #    values from a DB file
! sub getkeytableselectoptions {
  	use strict;
  	# inputs
***************
*** 1372,1376 ****
  	}
  	return $selectclause;
! } # sub GetKeyTableSelectOptions
  
  #---------------------------------
--- 1380,1384 ----
  	}
  	return $selectclause;
! } # sub getkeytableselectoptions
  
  #---------------------------------
***************
*** 1529,1533 ****
  	    $sth->execute($query, $type, $serverlist, $requestid);
  	}
! } # sub
  
  #--------------------------------------
--- 1537,1541 ----
  	    $sth->execute($query, $type, $serverlist, $requestid);
  	}
! } # sub addz3950queue
  
  #--------------------------------------





More information about the Koha-cvs mailing list