[Koha-cvs] CVS: koha/C4 BookShelves.pm,1.13,1.14

Paul POULAIN tipaul at users.sourceforge.net
Wed Dec 15 18:28:57 CET 2004


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

Modified Files:
	BookShelves.pm 
Log Message:
adding bookshelf features :
* create bookshelf on the fly
* modify a bookshelf (this being not finished, will commit the rest soon)

Index: BookShelves.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/BookShelves.pm,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** BookShelves.pm	11 Mar 2004 16:06:20 -0000	1.13
--- BookShelves.pm	15 Dec 2004 17:28:23 -0000	1.14
***************
*** 54,58 ****
  
  @ISA = qw(Exporter);
! @EXPORT = qw(&GetShelfList &GetShelfContents &AddToShelf &AddToShelfFromBiblio
  				&RemoveFromShelf &AddShelf &RemoveShelf
  				&ShelfPossibleAction);
--- 54,59 ----
  
  @ISA = qw(Exporter);
! @EXPORT = qw(&GetShelfList &GetShelfContents &GetShelf
! 				&AddToShelf &AddToShelfFromBiblio
  				&RemoveFromShelf &AddShelf &RemoveShelf
  				&ShelfPossibleAction);
***************
*** 135,138 ****
--- 136,145 ----
  }
  
+ sub GetShelf {
+ 	my ($shelfnumber) = @_;
+ 	my $sth=$dbh->prepare("select shelfnumber,shelfname,owner,category from bookshelf where shelfnumber=?");
+ 	$sth->execute($shelfnumber);
+ 	return $sth->fetchrow;
+ }
  =item GetShelfContents
  
***************
*** 240,248 ****
  	$sth->execute($shelfname);
      if ($sth->rows) {
! 	return(1, "Shelf \"$shelfname\" already exists");
      } else {
! 	$sth=$dbh->prepare("insert into bookshelf (shelfname,owner,category) values (?,?,?)");
! 	$sth->execute($shelfname,$owner,$category);
! 	return (0, "Done");
      }
  }
--- 247,256 ----
  	$sth->execute($shelfname);
      if ($sth->rows) {
! 		return(1, "Shelf \"$shelfname\" already exists");
      } else {
! 		$sth=$dbh->prepare("insert into bookshelf (shelfname,owner,category) values (?,?,?)");
! 		$sth->execute($shelfname,$owner,$category);
! 		my $shelfnumber = $dbh->{'mysql_insertid'};
! 		return (0, "Done",$shelfnumber);
      }
  }
***************
*** 283,286 ****
--- 291,299 ----
  #
  # $Log$
+ # Revision 1.14  2004/12/15 17:28:23  tipaul
+ # adding bookshelf features :
+ # * create bookshelf on the fly
+ # * modify a bookshelf (this being not finished, will commit the rest soon)
+ #
  # Revision 1.13  2004/03/11 16:06:20  tipaul
  # *** empty log message ***





More information about the Koha-cvs mailing list