[Koha-cvs] CVS: koha/acqui.simple marcimport.pl,1.6.2.21,1.6.2.22

Alan Millar amillar at users.sourceforge.net
Fri Jun 14 08:28:17 CEST 2002


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

Modified Files:
      Tag: rel-1-2
	marcimport.pl 
Log Message:
Move checkvalidisbn subroutine to Input.pm

Index: marcimport.pl
===================================================================
RCS file: /cvsroot/koha/koha/acqui.simple/marcimport.pl,v
retrieving revision 1.6.2.21
retrieving revision 1.6.2.22
diff -C2 -r1.6.2.21 -r1.6.2.22
*** marcimport.pl	14 Jun 2002 06:14:06 -0000	1.6.2.21
--- marcimport.pl	14 Jun 2002 06:28:14 -0000	1.6.2.22
***************
*** 18,21 ****
--- 18,22 ----
  use C4::Acquisitions;
  use C4::Output;
+ use C4::Input;
  
  #------------------
***************
*** 1571,1608 ****
  
  #--------------------------------------
- sub checkvalidisbn {
- 	use strict;
- 	my ($q)=@_ ;
- 
- 	my $isbngood = 0;
- 
- 	$q=~s/x$/X/g;		# upshift lower case X
- 	$q=~s/[^X\d]//g;
- 	$q=~s/X.//g;
- 	if (length($q)==10) {
- 	    my $checksum=substr($q,9,1);
- 	    my $isbn=substr($q,0,9);
- 	    my $i;
- 	    my $c=0;
- 	    for ($i=0; $i<9; $i++) {
- 		my $digit=substr($q,$i,1);
- 		$c+=$digit*(10-$i);
- 	    }
- 	    $c=int(11-($c/11-int($c/11))*11+.1);
- 	    ($c==10) && ($c='X');
- 	    if ($c eq $checksum) {
- 		$isbngood=1;
- 	    } else {
- 		$isbngood=0;
- 	    }
- 	} else {
- 	    $isbngood=0;
- 	} # if length good
- 
- 	return $isbngood;
- 
- } # sub checkvalidisbn
- 
- #-------------------------
  sub FormatMarcText {
      use strict;
--- 1572,1575 ----





More information about the Koha-cvs mailing list