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.27,1.28


From: Andrew Arensburger
Subject: [Koha-cvs] CVS: koha/C4 Acquisitions.pm,1.27,1.28
Date: Sat, 12 Oct 2002 22:52:48 -0700

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

Modified Files:
        Acquisitions.pm 
Log Message:
Added a partial POD.
Wrote some FIXME comments explaining why I'm not going to write any
more PODs.
Added some other FIXME comments.


Index: Acquisitions.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Acquisitions.pm,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -r1.27 -r1.28
*** Acquisitions.pm     10 Oct 2002 04:32:06 -0000      1.27
--- Acquisitions.pm     13 Oct 2002 05:52:46 -0000      1.28
***************
*** 648,652 ****
  # FIXME - This is in effect identical to &C4::Biblio::newbiblio.
  # Pick one and stick with it.
! # XXX - POD
  sub newbiblio {
    my ($biblio) = @_;
--- 648,654 ----
  # FIXME - This is in effect identical to &C4::Biblio::newbiblio.
  # Pick one and stick with it.
! 
! # FIXME - Never used (anything that uses &newbiblio uses
! # &C4::Biblio::newbiblio). Nuke this.
  sub newbiblio {
    my ($biblio) = @_;
***************
*** 684,690 ****
  }
  
  # FIXME - This is in effect the same as &C4::Biblio::modbiblio.
  # Pick one and stick with it.
- # XXX - POD
  sub modbiblio {
    my ($biblio) = @_;
--- 686,709 ----
  }
  
+ =item modbiblio
+ 
+   $biblionumber = &modbiblio($biblio);
+ 
+ Update a biblio record.
+ 
+ C<$biblio> is a reference-to-hash whose keys are the fields in the
+ biblio table in the Koha database. All fields must be present, not
+ just the ones you wish to change.
+ 
+ C<&modbiblio> updates the record defined by
+ C<$biblio-E<gt>{biblionumber}> with the values in C<$biblio>.
+ 
+ C<&modbiblio> returns C<$biblio-E<gt>{biblionumber}> whether it was
+ successful or not.
+ 
+ =cut
+ #'
  # FIXME - This is in effect the same as &C4::Biblio::modbiblio.
  # Pick one and stick with it.
  sub modbiblio {
    my ($biblio) = @_;
***************
*** 720,726 ****
  } # sub modbiblio
  
  # FIXME - This is in effect identical to &C4::Biblio::modsubtitle.
  # Pick one and stick with it.
- # XXX - POD
  sub modsubtitle {
    my ($bibnum, $subtitle) = @_;
--- 739,756 ----
  } # sub modbiblio
  
+ =item modsubtitle
+ 
+   &modsubtitle($biblionumber, $subtitle);
+ 
+ Sets the subtitle of a book.
+ 
+ C<$biblionumber> is the biblionumber of the book to modify.
+ 
+ C<$subtitle> is the new subtitle.
+ 
+ =cut
+ #'
  # FIXME - This is in effect identical to &C4::Biblio::modsubtitle.
  # Pick one and stick with it.
  sub modsubtitle {
    my ($bibnum, $subtitle) = @_;
***************
*** 735,744 ****
  } # sub modsubtitle
  
! # XXX - POD
  # FIXME - This is functionally identical to &C4::Biblio::modaddauthor
  # Pick one and stick with it.
  sub modaddauthor {
      my ($bibnum, $author) = @_;
      my $dbh   = C4::Context->dbh;
      my $query = "Delete from additionalauthors where biblionumber = $bibnum";
      my $sth = $dbh->prepare($query);
--- 765,786 ----
  } # sub modsubtitle
  
! =item modaddauthor
! 
!   &modaddauthor($biblionumber, $author);
! 
! Replaces all additional authors for the book with biblio number
! C<$biblionumber> with C<$author>. If C<$author> is the empty string,
! C<&modaddauthor> deletes all additional authors.
! 
! =cut
! #'
  # FIXME - This is functionally identical to &C4::Biblio::modaddauthor
  # Pick one and stick with it.
+ # FIXME - This API is bogus: you should be able to have more than 2
+ # authors on a book.
  sub modaddauthor {
      my ($bibnum, $author) = @_;
      my $dbh   = C4::Context->dbh;
+     # FIXME - Use $dbh->do()
      my $query = "Delete from additionalauthors where biblionumber = $bibnum";
      my $sth = $dbh->prepare($query);
***************
*** 759,765 ****
  } # sub modaddauthor
  
  # FIXME - This is in effect identical to &C4::Biblio::modsubject.
  # Pick one and stick with it.
! # XXX - POD
  sub modsubject {
    my ($bibnum, $force, @subject) = @_;
--- 801,819 ----
  } # sub modaddauthor
  
+ =item modsubject
+ 
+   $error = &modsubject($biblionumber, $force, @subjects);
+ 
+ $force - a subject to force
+ 
+ $error - Error message, or undef if successful.
+ 
+ =cut
+ #'
  # FIXME - This is in effect identical to &C4::Biblio::modsubject.
  # Pick one and stick with it.
! # FIXME - Bogus API: either $force should force all subjects to be
! # added to catalogueentry, or else you should be able to specify a
! # list of subjects to force.
  sub modsubject {
    my ($bibnum, $force, @subject) = @_;
***************
*** 767,773 ****
    my $count = @subject;
    my $error;
    for (my $i = 0; $i < $count; $i++) {
!     $subject[$i] =~ s/^ //g;
      $subject[$i] =~ s/ $//g;
      my $query = "select * from catalogueentry
  where entrytype = 's'
--- 821,832 ----
    my $count = @subject;
    my $error;
+ 
+   # Loop over list of subjects
+   # FIXME - Use foreach my $subject (@subjects)
    for (my $i = 0; $i < $count; $i++) {
!     $subject[$i] =~ s/^ //g;                  # Trim whitespace
      $subject[$i] =~ s/ $//g;
+ 
+     # Look up the subject in the authority file.
      my $query = "select * from catalogueentry
  where entrytype = 's'
***************
*** 777,780 ****
--- 836,840 ----
  
      if (my $data = $sth->fetchrow_hashref) {
+               # FIXME - Ick! Empty if-clauses suck. Use a "not" or something.
      } else {
        if ($force eq $subject[$i]) {
***************
*** 802,806 ****
          $sth2->execute;
          while (my $data = $sth2->fetchrow_hashref) {
!           $error = $error."<br>$data->{'catalogueentry'}";
          } # while
          $sth2->finish;
--- 862,866 ----
          $sth2->execute;
          while (my $data = $sth2->fetchrow_hashref) {
!           $error = $error."<br>$data->{'catalogueentry'}";    # FIXME - .=
          } # while
          $sth2->finish;
***************
*** 831,835 ****
  # FIXME - This is very similar to &C4::Biblio::modbibitem.
  # Pick one and stick with it.
! # XXX - POD
  sub modbibitem {
      my ($biblioitem) = @_;
--- 891,895 ----
  # FIXME - This is very similar to &C4::Biblio::modbibitem.
  # Pick one and stick with it.
! # If it's this one, it needs a POD.
  sub modbibitem {
      my ($biblioitem) = @_;
***************
*** 878,882 ****
  # FIXME - This is in effect identical to &C4::Biblio::modnote.
  # Pick one and stick with it.
! # XXX - POD
  sub modnote {
    my ($bibitemnum,$note)address@hidden;
--- 938,942 ----
  # FIXME - This is in effect identical to &C4::Biblio::modnote.
  # Pick one and stick with it.
! # If it's this one, it needs a POD.
  sub modnote {
    my ($bibitemnum,$note)address@hidden;
***************
*** 890,895 ****
  }
  
- # XXX - POD
  # FIXME - &C4::Biblio::newbiblioitem is quite similar to this
  sub newbiblioitem {
    my ($biblioitem) = @_;
--- 950,956 ----
  }
  
  # FIXME - &C4::Biblio::newbiblioitem is quite similar to this
+ # Pick one and stick with it.
+ # If it's this one, it needs a POD.
  sub newbiblioitem {
    my ($biblioitem) = @_;
***************
*** 960,964 ****
  # FIXME - This is in effect identical to &C4::Biblio::newsubject.
  # Pick one and stick with it.
! # XXX - POD
  sub newsubject {
    my ($bibnum)address@hidden;
--- 1021,1025 ----
  # FIXME - This is in effect identical to &C4::Biblio::newsubject.
  # Pick one and stick with it.
! # If it's this one, it needs a POD.
  sub newsubject {
    my ($bibnum)address@hidden;
***************
*** 972,978 ****
  }
  
- # XXX - POD
  # FIXME - This is in effect the same as &C4::Biblio::newsubtitle
  # Pick one and stick with it.
  sub newsubtitle {
    my ($bibnum, $subtitle) = @_;
--- 1033,1039 ----
  }
  
  # FIXME - This is in effect the same as &C4::Biblio::newsubtitle
  # Pick one and stick with it.
+ # If it's this one, it needs a POD.
  sub newsubtitle {
    my ($bibnum, $subtitle) = @_;
***************
*** 1245,1249 ****
      $cur=1;
    }
!   $price=$price / $cur;
    return($price);
  }
--- 1306,1310 ----
      $cur=1;
    }
!   $price=$price / $cur;               # FIXME - /=
    return($price);
  }
***************
*** 1347,1351 ****
  }
  
! # XXX - POD
  sub insertsup {
    my ($data)address@hidden;
--- 1408,1425 ----
  }
  
! =item insertsup
! 
!   $id = &insertsup($bookseller);
! 
! Creates a new bookseller. C<$bookseller> is a reference-to-hash whose
! keys are the fields of the aqbooksellers table in the Koha database.
! All fields must be present.
! 
! Returns the ID of the newly-created bookseller.
! 
! =cut
! #'
! # FIXME - This function also appears in C4::Catalogue. Pick one and
! # stick with it.
  sub insertsup {
    my ($data)address@hidden;
***************
*** 1364,1382 ****
  }
  
- =item insertsup
- 
-   $id = &insertsup($bookseller);
- 
- Creates a new bookseller. C<$bookseller> is a reference-to-hash whose
- keys are the fields of the aqbooksellers table in the Koha database.
- All fields must be present.
- 
- Returns the ID of the newly-created bookseller.
- 
- =cut
- #'
- # FIXME - This function appears in C4::Catalogue
  # FIXME - This is different from &C4::Biblio::newitems, though both
  # are exported.
  sub newitems {
    my ($item, @barcodes) = @_;
--- 1438,1445 ----
  }
  
  # FIXME - This is different from &C4::Biblio::newitems, though both
  # are exported.
+ # FIXME - Never used AFAICT. Obsolete.
+ # Otherwise, this needs a POD.
  sub newitems {
    my ($item, @barcodes) = @_;
***************
*** 1435,1439 ****
  # FIXME - This is the same as &C4::Biblio::Checkitems.
  # Pick one and stick with it.
! # XXX - POD
  sub checkitems{
    my ($count,@barcodes)address@hidden;
--- 1498,1502 ----
  # FIXME - This is the same as &C4::Biblio::Checkitems.
  # Pick one and stick with it.
! # If it's this one, it needs a POD.
  sub checkitems{
    my ($count,@barcodes)address@hidden;
***************
*** 1456,1460 ****
  # &C4::Biblio::moditem.
  # Pick one and stick with it.
! # XXX - POD
  sub moditem {
    my 
($loan,$itemnum,$bibitemnum,$barcode,$notes,$homebranch,$lost,$wthdrawn,$replacement)address@hidden;
--- 1519,1523 ----
  # &C4::Biblio::moditem.
  # Pick one and stick with it.
! # If it's this one, it needs a POD.
  sub moditem {
    my 
($loan,$itemnum,$bibitemnum,$barcode,$notes,$homebranch,$lost,$wthdrawn,$replacement)address@hidden;
***************
*** 1493,1497 ****
  # FIXME - This is identical to &C4::Biblio::countitems.
  # Pick one and stick with it.
! # XXX - POD
  sub countitems{
    my ($bibitemnum)address@hidden;
--- 1556,1560 ----
  # FIXME - This is identical to &C4::Biblio::countitems.
  # Pick one and stick with it.
! # If it's this one, it needs a POD.
  sub countitems{
    my ($bibitemnum)address@hidden;
***************
*** 1544,1548 ****
  # FIXME - A nearly-identical function, appears in C4::Biblio
  # Pick one and stick with it.
! # XXX - POD
  sub delitem{
    my ($itemnum)address@hidden;
--- 1607,1611 ----
  # FIXME - A nearly-identical function, appears in C4::Biblio
  # Pick one and stick with it.
! # If it's this one, it needs a POD.
  sub delitem{
    my ($itemnum)address@hidden;
***************
*** 1555,1559 ****
    $query="Insert into deleteditems values (";
    foreach my $temp (@data){
!     $query=$query."'$temp',";
    }
    $query=~ s/\,$/\)/;
--- 1618,1622 ----
    $query="Insert into deleteditems values (";
    foreach my $temp (@data){
!     $query=$query."'$temp',";         # FIXME - .=
    }
    $query=~ s/\,$/\)/;
***************
*** 1570,1574 ****
  # FIXME - This is functionally identical to &C4::Biblio::deletebiblioitem.
  # Pick one and stick with it.
! # XXX - POD
  sub deletebiblioitem {
      my ($biblioitemnumber) = @_;
--- 1633,1637 ----
  # FIXME - This is functionally identical to &C4::Biblio::deletebiblioitem.
  # Pick one and stick with it.
! # If it's this one, it needs a POD.
  sub deletebiblioitem {
      my ($biblioitemnumber) = @_;
***************
*** 1630,1634 ****
  # FIXME - This is functionally identical to &C4::Biblio::delbiblio.
  # Pick one and stick with it.
! # XXX - POD
  sub delbiblio{
    my ($biblio)address@hidden;
--- 1693,1697 ----
  # FIXME - This is functionally identical to &C4::Biblio::delbiblio.
  # Pick one and stick with it.
! # If it's this one, it needs a POD.
  sub delbiblio{
    my ($biblio)address@hidden;
***************
*** 1642,1646 ****
      foreach my $temp (@data){
        $temp=~ s/\'/\\\'/g;
!       $query=$query."'$temp',";
      }
      $query=~ s/\,$/\)/;
--- 1705,1709 ----
      foreach my $temp (@data){
        $temp=~ s/\'/\\\'/g;
!       $query=$query."'$temp',";               # FIXME - .=
      }
      $query=~ s/\,$/\)/;
***************
*** 1658,1662 ****
  }
  
! # XXX - POD
  sub getitemtypes {
    my $dbh   = C4::Context->dbh;
--- 1721,1727 ----
  }
  
! # FIXME - There's also a C4::Biblio::getitemtypes.
! # FIXME - Never used AFAICT. This function is obsolete.
! # If not, it needs a POD.
  sub getitemtypes {
    my $dbh   = C4::Context->dbh;
***************
*** 1680,1684 ****
  # FIXME - This is identical to &C4::Biblio::getitemtypes.
  # Pick one and stick with it.
! # XXX - POD
  sub getbiblio {
      my ($biblionumber) = @_;
--- 1745,1749 ----
  # FIXME - This is identical to &C4::Biblio::getitemtypes.
  # Pick one and stick with it.
! # If it's this one, it needs a POD.
  sub getbiblio {
      my ($biblionumber) = @_;
***************
*** 1701,1705 ****
  } # sub getbiblio
  
! # XXX - POD
  sub getbiblioitem {
      my ($biblioitemnum) = @_;
--- 1766,1772 ----
  } # sub getbiblio
  
! # FIXME - There's also a &C4::Biblio::getbiblioitem.
! # Pick one and stick with it.
! # If it's this one, it needs a POD.
  sub getbiblioitem {
      my ($biblioitemnum) = @_;
***************
*** 1724,1728 ****
  # FIXME - This is identical to &C4::Biblio::getbiblioitem.
  # Pick one and stick with it.
! # XXX - POD
  sub getbiblioitembybiblionumber {
      my ($biblionumber) = @_;
--- 1791,1795 ----
  # FIXME - This is identical to &C4::Biblio::getbiblioitem.
  # Pick one and stick with it.
! # If it's this one, it needs a POD.
  sub getbiblioitembybiblionumber {
      my ($biblionumber) = @_;
***************
*** 1748,1752 ****
  # &C4::Biblio::getbiblioitembybiblionumber.
  # Pick one and stick with it.
! # XXX - POD
  sub getitemsbybiblioitem {
      my ($biblioitemnum) = @_;
--- 1815,1819 ----
  # &C4::Biblio::getbiblioitembybiblionumber.
  # Pick one and stick with it.
! # If it's this one, it needs a POD.
  sub getitemsbybiblioitem {
      my ($biblioitemnum) = @_;
***************
*** 1773,1777 ****
  # FIXME - This is identical to &C4::Biblio::isbnsearch.
  # Pick one and stick with it.
! # XXX - POD
  sub isbnsearch {
      my ($isbn) = @_;
--- 1840,1844 ----
  # FIXME - This is identical to &C4::Biblio::isbnsearch.
  # Pick one and stick with it.
! # If it's this one, it needs a POD.
  sub isbnsearch {
      my ($isbn) = @_;




reply via email to

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