koha-cvs
[Top][All Lists]
Advanced

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

[Koha-cvs] CVS: koha/C4 Acquisition.pm,1.10,1.11 Breeding.pm,1.7,1.8


From: Paul POULAIN
Subject: [Koha-cvs] CVS: koha/C4 Acquisition.pm,1.10,1.11 Breeding.pm,1.7,1.8
Date: Wed, 04 May 2005 08:39:22 -0700

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

Modified Files:
        Acquisition.pm Breeding.pm 
Log Message:
synch'ing 2.2 and head

Index: Acquisition.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Acquisition.pm,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** Acquisition.pm      1 Mar 2005 13:40:48 -0000       1.10
--- Acquisition.pm      4 May 2005 15:39:08 -0000       1.11
***************
*** 398,402 ****
                left join borrowers on 
aqbasket.authorisedby=borrowers.borrowernumber
                where booksellerid=? and (quantity > quantityreceived or
!               quantityreceived is NULL)
                group by basketno order by aqbasket.basketno");
        $sth->execute($supplierid);
--- 398,402 ----
                left join borrowers on 
aqbasket.authorisedby=borrowers.borrowernumber
                where booksellerid=? and (quantity > quantityreceived or
!               quantityreceived is NULL) and datecancellationprinted is NULL
                group by basketno order by aqbasket.basketno");
        $sth->execute($supplierid);

Index: Breeding.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Breeding.pm,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** Breeding.pm 8 Dec 2004 10:11:51 -0000       1.7
--- Breeding.pm 4 May 2005 15:39:08 -0000       1.8
***************
*** 53,57 ****
  
  @ISA = qw(Exporter);
! @EXPORT = qw(&ImportBreeding);
  
  sub  ImportBreeding {
--- 53,57 ----
  
  @ISA = qw(Exporter);
! @EXPORT = qw(&ImportBreeding &BreedingSearch);
  
  sub  ImportBreeding {
***************
*** 125,127 ****
--- 125,178 ----
  }
  
+ 
+ =item BreedingSearch
+ 
+   ($count, @results) = &BreedingSearch($title,$isbn,$random);
+ C<$title> contains the title,
+ C<$isbn> contains isbn or issn,
+ C<$random> contains the random seed from a z3950 search.
+ 
+ C<$count> is the number of items in C<@results>. C<@results> is an
+ array of references-to-hash; the keys are the items from the C<marc_breeding> 
table of the Koha database.
+ 
+ =cut
+ 
+ sub BreedingSearch {
+       my ($title,$isbn,$z3950random) = @_;
+       my $dbh   = C4::Context->dbh;
+       my $count = 0;
+       my ($query,@bind);
+       my $sth;
+       my @results;
+ 
+       $query = "Select id,file,isbn,title,author from marc_breeding where ";
+       if ($z3950random) {
+               $query .= "z3950random = ?";
+               @bind=($z3950random);
+       } else {
+           @bind=();
+               if ($title) {
+                       $query .= "title like ?";
+                       push(@bind,"$title%");
+               }
+               if ($title && $isbn) {
+                       $query .= " and ";
+               }
+               if ($isbn) {
+                       $query .= "isbn like ?";
+                       push(@bind,"$isbn%");
+               }
+       }
+       $sth   = $dbh->prepare($query);
+       $sth->execute(@bind);
+       while (my $data = $sth->fetchrow_hashref) {
+                       $results[$count] = $data;
+                       $count++;
+       } # while
+ 
+       $sth->finish;
+       return($count, @results);
+ } # sub breedingsearch
+ 
+ 
  END { }       # module clean-up code here (global destructor)




reply via email to

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