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.85.2.6,1.85.2.7


From: Paul POULAIN
Subject: [Koha-cvs] CVS: koha/C4 Search.pm,1.85.2.6,1.85.2.7
Date: Mon, 15 Mar 2004 09:05:38 -0800

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

Modified Files:
      Tag: rel_2_0
        Search.pm 
Log Message:
bugfixes in opac new acquisitions

Index: Search.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Search.pm,v
retrieving revision 1.85.2.6
retrieving revision 1.85.2.7
diff -C2 -r1.85.2.6 -r1.85.2.7
*** Search.pm   11 Mar 2004 08:21:07 -0000      1.85.2.6
--- Search.pm   15 Mar 2004 17:05:35 -0000      1.85.2.7
***************
*** 86,96 ****
        my $i=0;
        my @result;
!       while (my $line = $sth->fetchrow_hashref) {
!               if ($i>=$offset && $i+$offset<$num) {
!                       push @result,$line;
                }
                $i++
        }
!       return(@result);
  
  }
--- 86,155 ----
        my $i=0;
        my @result;
!       while (my $data = $sth->fetchrow_hashref) {
!               if ($i>=$offset && $i<$num+$offset) {
!                       my ($counts) = itemcount2("", $data->{'biblionumber'}, 
'intra');
!                       my $subject2=$data->{'subject'};
!                       $subject2=~ s/ /%20/g;
!                       $data->{'itemcount'}=$counts->{'total'};
!                       my $totalitemcounts=0;
!                       foreach my $key (keys %$counts){
!                               if ($key ne 'total'){   # FIXME - Should ignore 
'order', too.
!                                       #$data->{'location'}.="$key 
$counts->{$key} ";
!                                       $totalitemcounts+=$counts->{$key};
!                                       
$data->{'locationhash'}->{$key}=$counts->{$key};
!                               }
!                       }
!                       my $locationtext='';
!                       my $locationtextonly='';
!                       my $notavailabletext='';
!                       foreach (sort keys %{$data->{'locationhash'}}) {
!                               if ($_ eq 'notavailable') {
!                                       $notavailabletext="Not available";
!                                       my $c=$data->{'locationhash'}->{$_};
!                                       
$data->{'not-available-p'}=$totalitemcounts;
!                                       if ($totalitemcounts>1) {
!                                       $notavailabletext.=" ($c)";
!                                       $data->{'not-available-plural-p'}=1;
!                                       }
!                               } else {
!                                       $locationtext.="$_ ";
!                                       my $c=$data->{'locationhash'}->{$_};
!                                       if ($_ eq 'Item Lost') {
!                                       $data->{'lost-p'}=$totalitemcounts;
!                                       $data->{'lost-plural-p'}=1
!                                                       if $totalitemcounts > 1;
!                                       } elsif ($_ eq 'Withdrawn') {
!                                       $data->{'withdrawn-p'}=$totalitemcounts;
!                                       $data->{'withdrawn-plural-p'}=1
!                                                       if $totalitemcounts > 1;
!                                       } elsif ($_ eq 'On Loan') {
!                                       $data->{'on-loan-p'}=$totalitemcounts;
!                                       $data->{'on-loan-plural-p'}=1
!                                                       if $totalitemcounts > 1;
!                                       } else {
!                                       $locationtextonly.=$_;
!                                       $locationtextonly.=" ($c), "
!                                                       if $totalitemcounts>1;
!                                       }
!                                       if ($totalitemcounts>1) {
!                                       $locationtext.=" ($c), ";
!                                       }
!                               }
!                       }
!                       if ($notavailabletext) {
!                               $locationtext.=$notavailabletext;
!                       } else {
!                               $locationtext=~s/, $//;
!                       }
!                       $data->{'location'}=$locationtext;
!                       $data->{'location-only'}=$locationtextonly;
!                       $data->{'subject2'}=$subject2;
!                       $data->{'use-location-flags-p'}=1; # XXX
! 
!                       push @result,$data;
                }
                $i++
        }
!       return($i,@result);
  
  }




reply via email to

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