koha-cvs
[Top][All Lists]
Advanced

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

[Koha-cvs] CVS: koha/C4 Acquisitions.pm,1.5.2.5,1.5.2.6


From: Alan Millar
Subject: [Koha-cvs] CVS: koha/C4 Acquisitions.pm,1.5.2.5,1.5.2.6
Date: Wed, 29 May 2002 08:06:18 -0700

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

Modified Files:
      Tag: rel-1-2
        Acquisitions.pm 
Log Message:
fixes to catalog maint from mainline rel 1.8


Index: Acquisitions.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Acquisitions.pm,v
retrieving revision 1.5.2.5
retrieving revision 1.5.2.6
diff -C2 -r1.5.2.5 -r1.5.2.6
*** Acquisitions.pm     29 May 2002 14:59:11 -0000      1.5.2.5
--- Acquisitions.pm     29 May 2002 15:06:16 -0000      1.5.2.6
***************
*** 343,357 ****
    my $query="Select * from branches";
    my $sth=$dbh->prepare($query);
-   $sth->execute;
-   my @results;
    my $i=0;
    while (my $data=$sth->fetchrow_hashref){
      $results[$i]=$data;
      $i++;
!   }
    $sth->finish;
    $dbh->disconnect;
    return($i,@results);
! }
  
  sub bookfundbreakdown {
--- 343,359 ----
    my $query="Select * from branches";
    my $sth=$dbh->prepare($query);
    my $i=0;
+     my @results;
+ 
+     $sth->execute;
    while (my $data=$sth->fetchrow_hashref){
      $results[$i]=$data;
      $i++;
!     } # while
! 
    $sth->finish;
    $dbh->disconnect;
    return($i,@results);
! } # sub branches
  
  sub bookfundbreakdown {
***************
*** 486,540 ****
      $subject[$i]=~ s/^ //g;
      $subject[$i]=~ s/ $//g;
!     my $query="select * from catalogueentry where entrytype='s' and
!     catalogueentry='$subject[$i]'";
      my $sth=$dbh->prepare($query);
      $sth->execute;
-     if (my $data=$sth->fetchrow_hashref){
        
      } else {
        if ($force eq $subject[$i]){
           #subject not in aut, chosen to force anway
         #so insert into cataloguentry so its in auth file
!        $query="Insert into catalogueentry (entrytype,catalogueentry)
         values ('s','$subject[$i]')";
         my $sth2=$dbh->prepare($query);
! #      print $query;
         $sth2->execute;
         $sth2->finish;
        } else {      
          $error="$subject[$i]\n does not exist in the subject authority file";
!         $query= "Select * from catalogueentry where
!         entrytype='s' and (catalogueentry like '$subject[$i] %' or 
!         catalogueentry like '% $subject[$i] %' or catalogueentry like
!         '% $subject[$i]')";
          my $sth2=$dbh->prepare($query);
! #        print $query;
          $sth2->execute;
          while (my $data=$sth2->fetchrow_hashref){
            $error=$error."<br>$data->{'catalogueentry'}";
!         }
          $sth2->finish;
! #       $error=$error."<br>$query";
!      }
!    }
      $sth->finish;
!   }
    if ($error eq ''){  
      my $query="Delete from bibliosubject where biblionumber=$bibnum";
- #  print $query;
      my $sth=$dbh->prepare($query);
! #  print $query;
      $sth->execute;
      $sth->finish;
      for (my $i=0;$i<$count;$i++){
!       $sth=$dbh->prepare("Insert into bibliosubject values 
('$subject[$i]',$bibnum)");
! #     print $subject[$i];
        $sth->execute;
        $sth->finish;
!     }
!   }
    $dbh->disconnect;
    return($error);
! }
  
  sub modbibitem {
--- 488,550 ----
      $subject[$i]=~ s/^ //g;
      $subject[$i]=~ s/ $//g;
!     my $query = "select * from catalogueentry
! where entrytype = 's'
! and catalogueentry = '$subject[$i]'";
      my $sth=$dbh->prepare($query);
      $sth->execute;
        
+     if (my $data = $sth->fetchrow_hashref) {
      } else {
        if ($force eq $subject[$i]){
+ 
           #subject not in aut, chosen to force anway
         #so insert into cataloguentry so its in auth file
!        $query = "Insert into catalogueentry
! (entrytype,catalogueentry)
         values ('s','$subject[$i]')";
         my $sth2=$dbh->prepare($query);
! 
         $sth2->execute;
         $sth2->finish;
+ 
        } else {      
+ 
          $error="$subject[$i]\n does not exist in the subject authority file";
!         $query = "Select * from catalogueentry
! where entrytype = 's'
! and (catalogueentry like '$subject[$i] %'
! or catalogueentry like '% $subject[$i] %'
! or catalogueentry like '% $subject[$i]')";
          my $sth2=$dbh->prepare($query);
! 
          $sth2->execute;
          while (my $data=$sth2->fetchrow_hashref){
            $error=$error."<br>$data->{'catalogueentry'}";
!         } # while
          $sth2->finish;
!       } # else
!     } # else
      $sth->finish;
!   } # else
! 
    if ($error eq ''){  
      my $query="Delete from bibliosubject where biblionumber=$bibnum";
      my $sth=$dbh->prepare($query);
! 
      $sth->execute;
      $sth->finish;
+ 
      for (my $i=0;$i<$count;$i++){
!       $sth = $dbh->prepare("Insert into bibliosubject
! values ('$subject[$i]', $bibnum)");
! 
        $sth->execute;
        $sth->finish;
!     } # for
!   } # if
! 
    $dbh->disconnect;
    return($error);
! } # sub modsubject
  
  sub modbibitem {




reply via email to

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