koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] CVS: koha/C4 SearchMarc.pm,1.42,1.43


From: Waylon Robertson
Subject: [Koha-cvs] CVS: koha/C4 SearchMarc.pm,1.42,1.43
Date: Wed, 01 Jun 2005 14:18:43 -0700

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

Modified Files:
        SearchMarc.pm 
Log Message:
New Feature: catalogsearch() has a new parameter, $sqlstring. A developer puts 
into it whatever they want to tack onto the end of the where statement. See 
usage in opac-search.pl

Index: SearchMarc.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/SearchMarc.pm,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -r1.42 -r1.43
*** SearchMarc.pm       4 May 2005 15:40:01 -0000       1.42
--- SearchMarc.pm       1 Jun 2005 21:18:39 -0000       1.43
***************
*** 100,104 ****
  }
  
! =head1  my ($count, @results) = catalogsearch($dbh, $tags, $and_or, 
$excluding, $operator, $value, $offset,$length,$orderby);
  
  =head2 $dbh is a link to the DB handler.
--- 100,104 ----
  }
  
! =head1  my ($count, @results) = catalogsearch($dbh, $tags, $and_or, 
$excluding, $operator, $value, $offset,$length,$orderby,$sqlstring);
  
  =head2 $dbh is a link to the DB handler.
***************
*** 147,150 ****
--- 147,154 ----
  (for example title, title DESC,...)
  
+ =head2 $sqlstring
+ 
+ optional argument containing an sql string to be used in the 'where' 
statement. see usage in opac-search.pl.
+ 
  =head2 RETURNS
  
***************
*** 166,170 ****
  
  sub catalogsearch {
!       my ($dbh, $tags, $and_or, $excluding, $operator, $value, 
$offset,$length,$orderby,$desc_or_asc) = @_;
        # build the sql request. She will look like :
        # select m1.bibid
--- 170,174 ----
  
  sub catalogsearch {
!       my ($dbh, $tags, $and_or, $excluding, $operator, $value, 
$offset,$length,$orderby,$desc_or_asc,$sqlstring) = @_;
        # build the sql request. She will look like :
        # select m1.bibid
***************
*** 273,285 ****
        # Finds the basic results without the NOT requests
        my ($sql_tables, $sql_where1, $sql_where2) = 
create_request($dbh,address@hidden, address@hidden, address@hidden, 
address@hidden);
! 
        $sql_where1 .= "and TO_DAYS( NOW( ) ) - TO_DAYS( biblio.timestamp ) 
<30" if $orderby =~ "biblio.timestamp";
        my $sth;
        if ($sql_where2) {
!               $sth = $dbh->prepare("select distinct m1.bibid from 
biblio,biblioitems,marc_biblio,$sql_tables where 
biblio.biblionumber=marc_biblio.biblionumber and 
biblio.biblionumber=biblioitems.biblionumber and m1.bibid=marc_biblio.bibid and 
$sql_where2 and ($sql_where1) order by $orderby $desc_or_asc");
!               warn "Q2 : select distinct m1.bibid from 
biblio,biblioitems,marc_biblio,$sql_tables where 
biblio.biblionumber=marc_biblio.biblionumber and 
biblio.biblionumber=biblioitems.biblionumber and m1.bibid=marc_biblio.bibid and 
$sql_where2 and ($sql_where1) order by $orderby $desc_or_asc term is  @$value";
        } else {
!               $sth = $dbh->prepare("select distinct m1.bibid from 
biblio,biblioitems,marc_biblio,$sql_tables where 
biblio.biblionumber=marc_biblio.biblionumber and 
biblio.biblionumber=biblioitems.biblionumber and m1.bibid=marc_biblio.bibid and 
$sql_where1 order by $orderby $desc_or_asc");
!               warn "Q : select distinct m1.bibid from 
biblio,biblioitems,marc_biblio,$sql_tables where 
biblio.biblionumber=marc_biblio.biblionumber and 
biblio.biblionumber=biblioitems.biblionumber and m1.bibid=marc_biblio.bibid and 
$sql_where1 order by $orderby $desc_or_asc";
        }
        $sth->execute();
--- 277,289 ----
        # Finds the basic results without the NOT requests
        my ($sql_tables, $sql_where1, $sql_where2) = 
create_request($dbh,address@hidden, address@hidden, address@hidden, 
address@hidden);
!   $sql_where1 .=" ". $sqlstring;
        $sql_where1 .= "and TO_DAYS( NOW( ) ) - TO_DAYS( biblio.timestamp ) 
<30" if $orderby =~ "biblio.timestamp";
        my $sth;
        if ($sql_where2) {
!               $sth = $dbh->prepare("select distinct m1.bibid from 
biblio,biblioitems,items,marc_biblio,$sql_tables where 
biblio.biblionumber=marc_biblio.biblionumber and 
biblio.biblionumber=biblioitems.biblionumber and m1.bibid=marc_biblio.bibid and 
$sql_where2 and ($sql_where1) order by $orderby $desc_or_asc");
!               warn "Q2 : select distinct m1.bibid from 
biblio,biblioitems,items,marc_biblio,$sql_tables where 
biblio.biblionumber=marc_biblio.biblionumber and 
biblio.biblionumber=biblioitems.biblionumber and m1.bibid=marc_biblio.bibid and 
$sql_where2 and ($sql_where1) order by $orderby $desc_or_asc term is  @$value";
        } else {
!               $sth = $dbh->prepare("select distinct m1.bibid from 
biblio,biblioitems,items,marc_biblio,$sql_tables where 
biblio.biblionumber=marc_biblio.biblionumber and 
biblio.biblionumber=biblioitems.biblionumber and m1.bibid=marc_biblio.bibid and 
$sql_where1 order by $orderby $desc_or_asc");
!               warn "Q : select distinct m1.bibid from 
biblio,biblioitems,items,marc_biblio,$sql_tables where 
biblio.biblionumber=marc_biblio.biblionumber and 
biblio.biblionumber=biblioitems.biblionumber and m1.bibid=marc_biblio.bibid and 
$sql_where1 order by $orderby $desc_or_asc";
        }
        $sth->execute();




reply via email to

[Prev in Thread] Current Thread [Next in Thread]