[Koha-cvs] CVS: koha/acqui.simple addbooks.pl,1.5.2.3,1.5.2.4

Steve Tonnesen tonnesen at users.sourceforge.net
Thu Jun 27 18:26:54 CEST 2002


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

Modified Files:
      Tag: rel-1-2
	addbooks.pl 
Log Message:
Re-enabling the max(barcode) + 1 behaviour.  Checks that the last digit is a
number before adding 1.  If the last digit isn't a number, fall back to Roger's
behaviour of using biblionumber as barcode.


Index: addbooks.pl
===================================================================
RCS file: /cvsroot/koha/koha/acqui.simple/addbooks.pl,v
retrieving revision 1.5.2.3
retrieving revision 1.5.2.4
diff -C2 -r1.5.2.3 -r1.5.2.4
*** addbooks.pl	26 Jun 2002 21:58:45 -0000	1.5.2.3
--- addbooks.pl	27 Jun 2002 16:26:52 -0000	1.5.2.4
***************
*** 320,327 ****
  EOF
  	}
! #	my $sth=$dbh->prepare("select max(barcode) from items");
! #	$sth->execute;
! #	my ($maxbarcode) = $sth->fetchrow;
! #	$maxbarcode++;
  #       print STDERR "MaxBarcode: $maxbarcode \n";
  	print << "EOF";
--- 320,333 ----
  EOF
  	}
! 	my $sth=$dbh->prepare("select max(barcode) from items");
! 	$sth->execute;
! 	my ($maxbarcode) = $sth->fetchrow;
! 	if ($maxbarcode=~/\d$/) {
! 	    # maxbarcode ends in a digit
! 	    $maxbarcode++;
! 	} else {
! 	    $maxbarcode=$biblionumber;
! 	}
! 	$maxbarcode++;
  #       print STDERR "MaxBarcode: $maxbarcode \n";
  	print << "EOF";
***************
*** 333,338 ****
  <input type=hidden name=biblioitemnumber value=$biblioitemnumber>
  <table>
! <!-- tr><td>BARCODE</td><td><input name=barcode size=10 value=\$maxbarcode --> 
! <tr><td>BARCODE</td><td><input name=barcode size=10 value=$biblionumber> 
  Home Branch: <select name=homebranch>
  EOF
--- 339,344 ----
  <input type=hidden name=biblioitemnumber value=$biblioitemnumber>
  <table>
! <tr><td>BARCODE</td><td><input name=barcode size=10 value=$maxbarcode> 
! <!-- <tr><td>BARCODE</td><td><input name=barcode size=10 value=$biblionumber> --> 
  Home Branch: <select name=homebranch>
  EOF





More information about the Koha-cvs mailing list