[Koha-cvs] CVS: koha/opac opac-search.pl,1.30,1.31

Waylon Robertson genjimoto at users.sourceforge.net
Sat Jun 25 07:26:16 CEST 2005


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

Modified Files:
	opac-search.pl 
Log Message:
restored search for available books functionality while ensuring that a search not asking about the availablity doesn't take longer than normal. Achieved via new parameter in SearchMarc::Catalogsearch called $extratables.

Index: opac-search.pl
===================================================================
RCS file: /cvsroot/koha/koha/opac/opac-search.pl,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -r1.30 -r1.31
*** opac-search.pl	20 Jun 2005 14:33:32 -0000	1.30
--- opac-search.pl	25 Jun 2005 05:26:14 -0000	1.31
***************
*** 9,13 ****
  use C4::Database;
  use HTML::Template;
! use C4::SearchMarcTest;
  use C4::Acquisition;
  use C4::Biblio;
--- 9,13 ----
  use C4::Database;
  use HTML::Template;
! use C4::SearchMarc;
  use C4::Acquisition;
  use C4::Biblio;
***************
*** 117,120 ****
--- 117,121 ----
  	findseealso($dbh,\@tags);
      my $sqlstring;
+     my $extratables;
      if ($itemtypesstring ne ''){
          $sqlstring = 'and (biblioitems.itemtype IN (';
***************
*** 134,137 ****
--- 135,139 ----
          $sqlstring .= 'and biblio.biblionumber=items.biblionumber and (items.holdingbranch IN (';
          my $branchesloop=0;
+         $extratables = ',items';
          foreach my $branch (@branches){
              if ($branch ne ''){
***************
*** 146,154 ****
      }
    if ($avail){
      $sqlstring .= "and biblioitems.biblioitemnumber=items.biblioitemnumber and items.itemnumber !=issues.itemnumber and biblio.biblionumber !=reserves.biblionumber and (items.itemlost IS NULL or items.itemlost = 0) and (items.notforloan IS NULL or items.notforloan =0) and (items.wthdrawn IS NULL or items.wthdrawn =0) ";
    }
  	my ($results,$total) = catalogsearch($dbh, \@tags,\@and_or,
  										\@excluding, \@operator, \@value,
! 										$startfrom*$resultsperpage, $resultsperpage,$orderby,$desc_or_asc,$sqlstring);
  	if ($total ==1) {
  	if (C4::Context->preference("BiblioDefaultView") eq "normal") {
--- 148,157 ----
      }
    if ($avail){
+   	$extratables .= ',items,issues,reserves';
      $sqlstring .= "and biblioitems.biblioitemnumber=items.biblioitemnumber and items.itemnumber !=issues.itemnumber and biblio.biblionumber !=reserves.biblionumber and (items.itemlost IS NULL or items.itemlost = 0) and (items.notforloan IS NULL or items.notforloan =0) and (items.wthdrawn IS NULL or items.wthdrawn =0) ";
    }
  	my ($results,$total) = catalogsearch($dbh, \@tags,\@and_or,
  										\@excluding, \@operator, \@value,
! 										$startfrom*$resultsperpage, $resultsperpage,$orderby,$desc_or_asc,$sqlstring, $extratables);
  	if ($total ==1) {
  	if (C4::Context->preference("BiblioDefaultView") eq "normal") {
***************
*** 412,416 ****
  }
  # ADDED BY JF
! #if ($totalresults == 1){
      # if its a barcode search by definition we will only have one result.
      # And if we have a result
--- 415,419 ----
  }
  # ADDED BY JF
! if ($totalresults == 1){
      # if its a barcode search by definition we will only have one result.
      # And if we have a result





More information about the Koha-cvs mailing list