[Koha-cvs] CVS: koha/C4 Biblio.pm,1.115.2.7,1.115.2.8

Paul POULAIN tipaul at users.sourceforge.net
Fri Mar 25 17:23:53 CET 2005


Update of /cvsroot/koha/koha/C4
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8572/C4

Modified Files:
      Tag: rel_2_2
	Biblio.pm 
Log Message:
some improvements :
* return immediatly when a subfield is empty
* search duplicate on isbn must be done only when there is an isbn ;-)

Index: Biblio.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Biblio.pm,v
retrieving revision 1.115.2.7
retrieving revision 1.115.2.8
diff -C2 -r1.115.2.7 -r1.115.2.8
*** Biblio.pm	10 Mar 2005 15:52:28 -0000	1.115.2.7
--- Biblio.pm	25 Mar 2005 16:23:49 -0000	1.115.2.8
***************
*** 412,415 ****
--- 412,416 ----
        )
        = @_;
+ 	  return unless $subfieldvalues;
  # warn "$tagid / $subfieldcode / $subfieldvalues";
      # if not value, end of job, we do nothing
***************
*** 2515,2523 ****
  	my $dbh = C4::Context->dbh;
  	my $result = MARCmarc2koha($dbh,$record,'');
  	# search duplicate on ISBN, easy and fast...
! 	my $sth = $dbh->prepare("select biblio.biblionumber,bibid,title from biblio,biblioitems,marc_biblio where biblio.biblionumber=biblioitems.biblionumber and marc_biblio.biblionumber=biblioitems.biblionumber and isbn=?");
! 	$sth->execute($result->{'isbn'});
! 	my ($biblionumber,$bibid,$title) = $sth->fetchrow;
! 	return $biblionumber,$bibid,$title if ($biblionumber);
  	# a more complex search : build a request for SearchMarc::catalogsearch()
  	my (@tags, @and_or, @excluding, @operator, @value, $offset,$length);
--- 2516,2528 ----
  	my $dbh = C4::Context->dbh;
  	my $result = MARCmarc2koha($dbh,$record,'');
+ 	my $sth;
+ 	my ($biblionumber,$bibid,$title);
  	# search duplicate on ISBN, easy and fast...
! 	if ($result->{isbn}) {
! 		$sth = $dbh->prepare("select biblio.biblionumber,bibid,title from biblio,biblioitems,marc_biblio where biblio.biblionumber=biblioitems.biblionumber and marc_biblio.biblionumber=biblioitems.biblionumber and isbn=?");
! 		$sth->execute($result->{'isbn'});
! 		($biblionumber,$bibid,$title) = $sth->fetchrow;
! 		return $biblionumber,$bibid,$title if ($biblionumber);
! 	}
  	# a more complex search : build a request for SearchMarc::catalogsearch()
  	my (@tags, @and_or, @excluding, @operator, @value, $offset,$length);
***************
*** 2619,2622 ****
--- 2624,2632 ----
  # $Id$
  # $Log$
+ # Revision 1.115.2.8  2005/03/25 16:23:49  tipaul
+ # some improvements :
+ # * return immediatly when a subfield is empty
+ # * search duplicate on isbn must be done only when there is an isbn ;-)
+ #
  # Revision 1.115.2.7  2005/03/10 15:52:28  tipaul
  # * adding glass to opac marc detail.





More information about the Koha-cvs mailing list