[Koha-cvs] koha/C4 BookShelves.pm [rel_3_0]

Antoine Farnault antoine at koha-fr.org
Thu Aug 31 18:03:52 CEST 2006


CVSROOT:	/sources/koha
Module name:	koha
Branch:		rel_3_0
Changes by:	Antoine Farnault <toins>	06/08/31 16:03:52

Modified files:
	C4             : BookShelves.pm 

Log message:
	Add Pod to DelShelf

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/BookShelves.pm?cvsroot=koha&only_with_tag=rel_3_0&r1=1.15.8.1&r2=1.15.8.2

Patches:
Index: BookShelves.pm
===================================================================
RCS file: /sources/koha/koha/C4/BookShelves.pm,v
retrieving revision 1.15.8.1
retrieving revision 1.15.8.2
diff -u -b -r1.15.8.1 -r1.15.8.2
--- BookShelves.pm	30 Aug 2006 15:59:14 -0000	1.15.8.1
+++ BookShelves.pm	31 Aug 2006 16:03:52 -0000	1.15.8.2
@@ -3,7 +3,7 @@
 
 package C4::BookShelves;
 
-# $Id: BookShelves.pm,v 1.15.8.1 2006/08/30 15:59:14 toins Exp $
+# $Id: BookShelves.pm,v 1.15.8.2 2006/08/31 16:03:52 toins Exp $
 
 # Copyright 2000-2002 Katipo Communications
 #
@@ -30,7 +30,7 @@
 use vars qw($VERSION @ISA @EXPORT);
 
 # set the version for version checking
-$VERSION = do { my @v = '$Revision: 1.15.8.1 $' =~ /\d+/g; shift(@v) . "." . join( "_", map { sprintf "%03d", $_ } @v ); };
+$VERSION = do { my @v = '$Revision: 1.15.8.2 $' =~ /\d+/g; shift(@v) . "." . join( "_", map { sprintf "%03d", $_ } @v ); };
 
 =head1 NAME
 
@@ -380,11 +380,22 @@
         DELETE FROM shelfcontents
         WHERE  shelfnumber=? AND itemnumber=?
     );
-    my $sth =
-      $dbh->prepare($query);
+    my $sth = $dbh->prepare($query);
     $sth->execute( $shelfnumber, $itemnumber );
 }
 
+=item DelShelf
+
+  $Number = DelShelf($shelfnumber);
+
+    this function delete the shelf number $shelfnumber only if
+    it is empty.
+    
+    it returns the number of item already present in the shelf.
+    (So, if 0 returns => deletion is successful).
+
+=cut
+
 #'
 sub DelShelf {
     my ( $shelfnumber ) = @_;
@@ -397,7 +408,7 @@
     $sth->execute($shelfnumber);
     my ($count) = $sth->fetchrow;
     if ($count) {
-        return (1,$count);
+        return $count;
     }
     else {
         my $query = qq(
@@ -406,7 +417,7 @@
         );
         $sth = $dbh->prepare($query);
         $sth->execute($shelfnumber);
-        return ( 0, $count);
+        return 0;
     }
 }
 
@@ -416,6 +427,9 @@
 
 #
 # $Log: BookShelves.pm,v $
+# Revision 1.15.8.2  2006/08/31 16:03:52  toins
+# Add Pod to DelShelf
+#
 # Revision 1.15.8.1  2006/08/30 15:59:14  toins
 # Code cleaned according to coding guide lines.
 #





More information about the Koha-cvs mailing list