[Koha-cvs] CVS: koha/C4 BookShelves.pm,1.14,1.15
Paul POULAIN
tipaul at users.sourceforge.net
Thu Dec 16 12:31:00 CET 2004
Update of /cvsroot/koha/koha/C4
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7514/C4
Modified Files:
BookShelves.pm
Log Message:
adding bookshelf features :
* create bookshelf on the fly
* modify a bookshelf name & status
Index: BookShelves.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/BookShelves.pm,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** BookShelves.pm 15 Dec 2004 17:28:23 -0000 1.14
--- BookShelves.pm 16 Dec 2004 11:30:58 -0000 1.15
***************
*** 54,61 ****
@ISA = qw(Exporter);
! @EXPORT = qw(&GetShelfList &GetShelfContents &GetShelf
! &AddToShelf &AddToShelfFromBiblio
! &RemoveFromShelf &AddShelf &RemoveShelf
! &ShelfPossibleAction);
my $dbh = C4::Context->dbh;
--- 54,62 ----
@ISA = qw(Exporter);
! @EXPORT = qw(&GetShelfList &GetShelfContents &GetShelf
! &AddToShelf &AddToShelfFromBiblio
! &RemoveFromShelf &AddShelf &ModifShelf
! &RemoveShelf &ShelfPossibleAction
! );
my $dbh = C4::Context->dbh;
***************
*** 116,120 ****
# mincategory : 2 if the list is for "look". 3 if the list is for "Select bookshelf for adding a book".
# bookshelves of the owner are always selected, whatever the category
! my $sth=$dbh->prepare("SELECT bookshelf.shelfnumber, bookshelf.shelfname,owner,surname,firstname,
count(shelfcontents.itemnumber) as count
FROM bookshelf
--- 117,121 ----
# mincategory : 2 if the list is for "look". 3 if the list is for "Select bookshelf for adding a book".
# bookshelves of the owner are always selected, whatever the category
! my $sth=$dbh->prepare("SELECT bookshelf.shelfnumber, bookshelf.shelfname,owner,surname,firstname,category,
count(shelfcontents.itemnumber) as count
FROM bookshelf
***************
*** 126,132 ****
$sth->execute($owner,$mincategory);
my %shelflist;
! while (my ($shelfnumber, $shelfname,$owner,$surname,$firstname,$count) = $sth->fetchrow) {
$shelflist{$shelfnumber}->{'shelfname'}=$shelfname;
$shelflist{$shelfnumber}->{'count'}=$count;
$shelflist{$shelfnumber}->{'owner'}=$owner;
$shelflist{$shelfnumber}->{surname} = $surname;
--- 127,134 ----
$sth->execute($owner,$mincategory);
my %shelflist;
! while (my ($shelfnumber, $shelfname,$owner,$surname,$firstname,$category,$count) = $sth->fetchrow) {
$shelflist{$shelfnumber}->{'shelfname'}=$shelfname;
$shelflist{$shelfnumber}->{'count'}=$count;
+ $shelflist{$shelfnumber}->{'category'}=$category;
$shelflist{$shelfnumber}->{'owner'}=$owner;
$shelflist{$shelfnumber}->{surname} = $surname;
***************
*** 239,247 ****
=cut
! #'
! # FIXME - Perhaps this could/should return the number of the new bookshelf
! # as well?
sub AddShelf {
! my ($env, $shelfname,$owner,$category) = @_;
my $sth=$dbh->prepare("select * from bookshelf where shelfname=?");
$sth->execute($shelfname);
--- 241,247 ----
=cut
!
sub AddShelf {
! my ($env, $shelfname, $owner, $category) = @_;
my $sth=$dbh->prepare("select * from bookshelf where shelfname=?");
$sth->execute($shelfname);
***************
*** 256,259 ****
--- 256,265 ----
}
+ sub ModifShelf {
+ my ($shelfnumber, $shelfname, $owner, $category) = @_;
+ my $sth = $dbh->prepare("update bookshelf set shelfname=?,owner=?,category=? where shelfnumber=?");
+ $sth->execute($shelfname,$owner,$category,$shelfnumber);
+ }
+
=item RemoveShelf
***************
*** 291,294 ****
--- 297,305 ----
#
# $Log$
+ # Revision 1.15 2004/12/16 11:30:58 tipaul
+ # adding bookshelf features :
+ # * create bookshelf on the fly
+ # * modify a bookshelf name & status
+ #
# Revision 1.14 2004/12/15 17:28:23 tipaul
# adding bookshelf features :
More information about the Koha-cvs
mailing list