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.33,1.34


From: Chris Cormack
Subject: [Koha-cvs] CVS: koha/C4 Search.pm,1.33,1.34
Date: Wed, 14 Aug 2002 19:02:43 -0700

Update of /cvsroot/koha/koha/C4
In directory usw-pr-cvs1:/tmp/cvs-serv6628/C4

Modified Files:
        Search.pm 
Log Message:
Fix for last borrower for the moredetail.pl page
sCVS: 


Index: Search.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Search.pm,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -r1.33 -r1.34
*** Search.pm   14 Aug 2002 18:12:51 -0000      1.33
--- Search.pm   15 Aug 2002 02:02:40 -0000      1.34
***************
*** 123,127 ****
      }
    }
!   if ($env->{itemcount}) {
      foreach my $data (@results){
        my ($counts) = itemcount2($env, $data->{'biblionumber'}, 'intra');
--- 123,127 ----
      }
    }
!   if ($env->{itemcount} eq '1') {
      foreach my $data (@results){
        my ($counts) = itemcount2($env, $data->{'biblionumber'}, 'intra');
***************
*** 337,340 ****
--- 337,341 ----
          $sth->finish;                                             
        $data2->{'dewey'}=$dewey;
+       
        $res2[$i]=$data2;
  #     
$res2[$i]="$data2->{'author'}\t$data2->{'title'}\t$data2->{'biblionumber'}\t$data2->{'copyrightdate'}\t$dewey";
***************
*** 561,565 ****
            $query.= " and (abstract like '%$search->{'abstract'}%')";
         }
!        
  
         $query.=" group by biblio.biblionumber";
--- 562,568 ----
            $query.= " and (abstract like '%$search->{'abstract'}%')";
         }
!        if ($search->{'date-before'} ne ''){
!           $query.= " and (copyrightdate like '%$search->{'date-before'}%')";
!          }
  
         $query.=" group by biblio.biblionumber";
***************
*** 608,611 ****
--- 611,617 ----
            $query.= " and (abstract like '%$search->{'abstract'}%')";
           }
+          if ($search->{'date-before'} ne ''){
+           $query.= " and (copyrightdate like '%$search->{'date-before'}%')";
+          }
          } elsif ($search->{'class'} ne ''){
             $query="select * from biblioitems,biblio where 
biblio.biblionumber=biblioitems.biblionumber";
***************
*** 636,639 ****
--- 642,648 ----
          } elsif ($search->{'abstract'} ne ''){
            $query.= "Select * from biblio where abstract like 
'%$search->{'abstract'}%'";
+         
+         } elsif ($search->{'date-before'} ne ''){
+           $query.= "Select * from biblio where copyrightdate like 
'%$search->{'date-before'}%'";
          }
            $query .=" group by biblio.biblionumber";    
***************
*** 716,720 ****
  my $limit= $num+$offset;
  while (my $data=$sth->fetchrow_hashref){
!   my $query="select dewey,subclass from biblioitems where 
biblionumber=$data->{'biblionumber'}";
            if ($search->{'class'} ne ''){
              my @temp=split(/\|/,$search->{'class'});
--- 725,729 ----
  my $limit= $num+$offset;
  while (my $data=$sth->fetchrow_hashref){
!   my $query="select dewey,subclass,publishercode from biblioitems where 
biblionumber=$data->{'biblionumber'}";
            if ($search->{'class'} ne ''){
              my @temp=split(/\|/,$search->{'class'});
***************
*** 735,739 ****
            $query.= " and (publishercode like '%$search->{'publisher'}%')";
            }
! #print STDERR "$query\n";
    my $sti=$dbh->prepare($query);
    $sti->execute;
--- 744,748 ----
            $query.= " and (publishercode like '%$search->{'publisher'}%')";
            }
! 
    my $sti=$dbh->prepare($query);
    $sti->execute;
***************
*** 741,751 ****
    my $subclass;
    my $true=0;
!   if (($dewey, $subclass) = $sti->fetchrow || $type eq 'subject'){
      $true=1;
    }
    $dewey=~s/\.*0*$//;
    ($dewey == 0) && ($dewey='');
    ($dewey) && ($dewey.=" $subclass");
    $data->{'dewey'}=$dewey;
    $sti->finish;
    if ($true == 1){
--- 750,767 ----
    my $subclass;
    my $true=0;
!   my $publishercode;
!   my $bibitemdata;
!   if ($bibitemdata = $sti->fetchrow_hashref() || $type eq 'subject'){
      $true=1;
+     $dewey=$bibitemdata->{'dewey'};
+     $subclass=$bibitemdata->{'subclass'};
+     $publishercode=$bibitemdata->{'publishercode'};
    }
+   print STDERR "$dewey $subclass $publishercode\n";
    $dewey=~s/\.*0*$//;
    ($dewey == 0) && ($dewey='');
    ($dewey) && ($dewey.=" $subclass");
    $data->{'dewey'}=$dewey;
+   $data->{'publishercode'}=$publishercode;
    $sti->finish;
    if ($true == 1){
***************
*** 968,972 ****
      $sth->execute;
      while (my $dat = $sth->fetchrow_hashref){
!         $data->{'subject'} .= " | $dat->{'subject'}";
      } # while
  
--- 984,988 ----
      $sth->execute;
      while (my $dat = $sth->fetchrow_hashref){
!         $data->{'subject'} .= " , $dat->{'subject'}";
      } # while
  
***************
*** 1086,1090 ****
  where itemnumber = '$data->{'itemnumber'}'
  and issues.borrowernumber = borrowers.borrowernumber 
! order by date_due desc";
          $sth2 = $dbh->prepare($query2)
            || die $dbh->errstr;
--- 1102,1107 ----
  where itemnumber = '$data->{'itemnumber'}'
  and issues.borrowernumber = borrowers.borrowernumber 
! and returndate is not NULL
! order by returndate desc,timestamp desc";
          $sth2 = $dbh->prepare($query2)
            || die $dbh->errstr;
***************
*** 1385,1389 ****
      $sth2->execute;         
      if (my $data2=$sth2->fetchrow_hashref){         
!        $counts{'notavailable'}++;         
      } else {         
         $counts{$data->{'branchname'}}++;
--- 1402,1406 ----
      $sth2->execute;         
      if (my $data2=$sth2->fetchrow_hashref){         
!        $counts{'not available'}++;         
      } else {         
         $counts{$data->{'branchname'}}++;




reply via email to

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