koha-cvs
[Top][All Lists]
Advanced

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

[Koha-cvs] CVS: koha/C4 Search.pm,1.56,1.57


From: Mike Hansen
Subject: [Koha-cvs] CVS: koha/C4 Search.pm,1.56,1.57
Date: Thu, 20 Feb 2003 18:25:06 -0800

Update of /cvsroot/koha/koha/C4
In directory sc8-pr-cvs1:/tmp/cvs-serv22609/koha/C4

Modified Files:
        Search.pm 
Log Message:
Fixed the subject search.


Index: Search.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Search.pm,v
retrieving revision 1.56
retrieving revision 1.57
diff -C2 -r1.56 -r1.57
*** Search.pm   4 Feb 2003 04:44:35 -0000       1.56
--- Search.pm   21 Feb 2003 02:25:03 -0000      1.57
***************
*** 1002,1019 ****
        }
        if ($type eq 'subject'){
-               # FIXME - Subject search is badly broken. The query defined by
-               # $query returns a single item (the subject), but later code
-               # expects a ref-to-hash with all sorts of stuff in it.
-               # Also, the count of items (biblios?) with the given subject is
-               # wrong.
- 
                my @key=split(' ',$search->{'subject'});
                my address@hidden;
                my $i=1;
!               $query="select distinct(subject) from bibliosubject where( 
subject like
!               '$key[0]%' or subject like '% $key[0]%' or subject like '% 
$key[0]' or subject like '%($key[0])%')";
!               while ($i<$count){
!                       $query.=" and (subject like '$key[$i]%' or subject like 
'% $key[$i]%'
!                       or subject like '% $key[$i]'
                        or subject like '%($key[$i])%')";
                        $i++;
--- 1002,1013 ----
        }
        if ($type eq 'subject'){
                my @key=split(' ',$search->{'subject'});
                my address@hidden;
                my $i=1;
!               $query="select * from bibliosubject, biblioitems where 
! (bibliosubject.biblionumber = biblioitems.biblionumber) and ( subject like    
        
! '$key[0]%' or subject like '% $key[0]%' or subject like '% $key[0]' or 
subject 
! like '%($key[0])%')";         while ($i<$count){                      
$query.=" and (subject like 
! '$key[$i]%' or subject like '% $key[$i]%'                     or subject like 
'% $key[$i]'
                        or subject like '%($key[$i])%')";
                        $i++;
***************
*** 1181,1185 ****
    my @results;
    while (my $data=$sth->fetchrow_hashref){
!     
$results[$i]="$data->{'title'}\t$data->{'author'}\t$data->{'biblionumber'}";
      $i++;
    }
--- 1175,1179 ----
    my @results;
    while (my $data=$sth->fetchrow_hashref){
!     push @results, $data;
      $i++;
    }




reply via email to

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