[Koha-cvs] CVS: koha/C4 Acquisitions.pm,1.16,1.17

Gynn Lomax truth_nz at users.sourceforge.net
Wed May 22 20:35:27 CEST 2002


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

Modified Files:
	Acquisitions.pm 
Log Message:
Update to acqui.simple system. Hopefully this is a lot more user friendly.
Probably a few bug fixes to come still.


Index: Acquisitions.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Acquisitions.pm,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -r1.16 -r1.17
*** Acquisitions.pm	21 May 2002 06:19:48 -0000	1.16
--- Acquisitions.pm	22 May 2002 18:35:25 -0000	1.17
***************
*** 19,23 ****
  &getallorders &getrecorders &updatecurrencies &getorder &getcurrency &updaterecorder
  &updatecost &checkitems &modnote &getitemtypes &getbiblio
! &getbiblioitem &getitemsbybiblioitem &isbnsearch &keywordsearch
  &websitesearch &addwebsite &updatewebsite &deletewebsite);
  %EXPORT_TAGS = ( );     # eg: TAG => [ qw!name1 name2! ],
--- 19,24 ----
  &getallorders &getrecorders &updatecurrencies &getorder &getcurrency &updaterecorder
  &updatecost &checkitems &modnote &getitemtypes &getbiblio
! &getbiblioitembybiblionumber
! &getbiblioitem &getitemsbybiblioitem &isbnsearch
  &websitesearch &addwebsite &updatewebsite &deletewebsite);
  %EXPORT_TAGS = ( );     # eg: TAG => [ qw!name1 name2! ],
***************
*** 960,963 ****
--- 961,965 ----
    foreach my $barcode (@barcodes) {
      $barcode = uc($barcode);
+     $barcode = $dbh->quote($barcode);
      $query   = "Insert into items set
  itemnumber           = $itemnumber,
***************
*** 1202,1205 ****
--- 1204,1208 ----
  }
  
+ 
  sub getitemtypes {
    my $dbh   = C4Connect;
***************
*** 1267,1270 ****
--- 1270,1295 ----
  
  
+ sub getbiblioitembybiblionumber {
+     my ($biblionumber) = @_;
+     my $dbh   = C4Connect;
+     my $query = "Select * from biblioitems where biblionumber =
+ $biblionumber";
+     my $sth   = $dbh->prepare($query);
+     my $count = 0;
+     my @results;
+ 
+     $sth->execute;
+ 
+     while (my $data = $sth->fetchrow_hashref) {
+         $results[$count] = $data;
+ 	$count++;
+     } # while
+ 
+     $sth->finish;
+     $dbh->disconnect;
+     return($count, @results);
+ } # sub
+ 
+ 
  sub getitemsbybiblioitem {
      my ($biblioitemnum) = @_;
***************
*** 1300,1304 ****
      
      $isbn  = $dbh->quote($isbn);
!     $query = "Select * from biblioitems where isbn = $isbn";
      $sth   = $dbh->prepare($query);
      
--- 1325,1331 ----
      
      $isbn  = $dbh->quote($isbn);
!     $query = "Select biblio.* from biblio, biblioitems where
! biblio.biblionumber = biblioitems.biblionumber
! and isbn = $isbn";
      $sth   = $dbh->prepare($query);
      
***************
*** 1313,1360 ****
      return($count, @results);
  } # sub isbnsearch
- 
- 
- sub keywordsearch {
-   my ($keywordlist) = @_;
-   my $dbh   = C4Connect;
-   my $query = "Select * from biblio where";
-   my $count = 0;
-   my $sth;
-   my @results;
-   my @keywords = split(/ +/, $keywordlist);
-   my $keyword = shift(@keywords);
- 
-   $keyword =~ s/%/\\%/g;
-   $keyword =~ s/_/\\_/;
-   $keyword = "%" . $keyword . "%";
-   $keyword = $dbh->quote($keyword);
-   $query  .= " (author like $keyword) or
- (title like $keyword) or (unititle like $keyword) or
- (notes like $keyword) or (seriestitle like $keyword) or
- (abstract like $keyword)";
- 
-   foreach $keyword (@keywords) {
-     $keyword =~ s/%/\\%/;
-     $keyword =~ s/_/\\_/;
-     $keyword = "%" . $keyword . "%";
-     $keyword = $dbh->quote($keyword);
-     $query  .= " or (author like $keyword) or
- (title like $keyword) or (unititle like $keyword) or 
- (notes like $keyword) or (seriestitle like $keyword) or
- (abstract like $keyword)";
-   } # foreach
-   
-   $sth = $dbh->prepare($query);
-   $sth->execute;
-   
-   while (my $data = $sth->fetchrow_hashref) {
-     $results[$count] = $data;
-     $count++;
-   } # while
-   
-   $sth->finish;
-   $dbh->disconnect;
-   return($count, @results);
- } # sub keywordsearch
  
  
--- 1340,1343 ----





More information about the Koha-cvs mailing list