[Koha-cvs] CVS: koha/C4 SearchMarc.pm,1.31,1.32

Paul POULAIN tipaul at users.sourceforge.net
Thu Nov 18 11:34:27 CET 2004


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

Modified Files:
	SearchMarc.pm 
Log Message:
fixing but to remove "request" link on "notforloan" materials

Index: SearchMarc.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/SearchMarc.pm,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -r1.31 -r1.32
*** SearchMarc.pm	5 Nov 2004 10:10:48 -0000	1.31
--- SearchMarc.pm	18 Nov 2004 10:34:24 -0000	1.32
***************
*** 320,327 ****
  	my $counter = $offset;
  	# HINT : biblionumber as bn is important. The hash is fills biblionumber with items.biblionumber.
! 	# so if you dont' has an item, you get a not nice epty value.
! 	$sth = $dbh->prepare("SELECT biblio.biblionumber as bn,biblio.*, biblioitems.*,marc_biblio.bibid
  							FROM biblio, marc_biblio 
  							LEFT JOIN biblioitems on biblio.biblionumber = biblioitems.biblionumber
  							WHERE biblio.biblionumber = marc_biblio.biblionumber AND bibid = ?");
  	my @finalresult = ();
--- 320,328 ----
  	my $counter = $offset;
  	# HINT : biblionumber as bn is important. The hash is fills biblionumber with items.biblionumber.
! 	# so if you dont' has an item, you get a not nice empty value.
! 	$sth = $dbh->prepare("SELECT biblio.biblionumber as bn,biblio.*, biblioitems.*,marc_biblio.bibid,itemtypes.notforloan
  							FROM biblio, marc_biblio 
  							LEFT JOIN biblioitems on biblio.biblionumber = biblioitems.biblionumber
+ 							LEFT JOIN itemtypes on itemtypes.itemtype=biblioitems.itemtype
  							WHERE biblio.biblionumber = marc_biblio.biblionumber AND bibid = ?");
  	my @finalresult = ();
***************
*** 330,334 ****
  	my $oldline;
  	my ($oldbibid, $oldauthor, $oldtitle);
! 	my $sth_itemCN = $dbh->prepare("select * from items where biblionumber=?");
  	my $sth_issue = $dbh->prepare("select date_due,returndate from issues where itemnumber=?");
  	# parse all biblios between start & end.
--- 331,335 ----
  	my $oldline;
  	my ($oldbibid, $oldauthor, $oldtitle);
! 	my $sth_itemCN = $dbh->prepare("select items.* from items where biblionumber=?");
  	my $sth_issue = $dbh->prepare("select date_due,returndate from issues where itemnumber=?");
  	# parse all biblios between start & end.
***************
*** 338,341 ****
--- 339,343 ----
  		my $continue=1;
  		my $line = $sth->fetchrow_hashref;
+ 		warn "==> ".$line->{notforloan};
  		my $biblionumber=$line->{bn};
  # 		$continue=0 unless $line->{bn};
***************
*** 343,346 ****
--- 345,349 ----
  		$sth_itemCN->execute($biblionumber);
  		my @CNresults = ();
+ 		my $notforloan=1; # to see if there is at least 1 item that can be issued
  		while (my $item = $sth_itemCN->fetchrow_hashref) {
  			# parse the result, putting holdingbranch & itemcallnumber in separate array
***************
*** 361,364 ****
--- 364,368 ----
  			$lineCN{location} = $item->{location};
  			$lineCN{date_due} = format_date($date_due);
+ 			$notforloan=0 unless ($item->{notforloan} or $item->{wthdrawn} or $item->{itemlost});
  			push @CNresults,\%lineCN;
  			$totalitems++;
***************
*** 369,372 ****
--- 373,379 ----
  		$newline{totitem} = $totalitems;
  		$newline{biblionumber} = $biblionumber;
+ 		$newline{norequests} = 0;
+ 		$newline{norequests} = 1 if ($line->{notforloan}); # itemtype not issuable
+ 		$newline{norequests} = 1 if (!$line->{notforloan} && $notforloan); # itemtype issuable but all items not issuable for instance
  		my @CNresults2= @CNresults;
  		$newline{CN} = \@CNresults2;





More information about the Koha-cvs mailing list