koha-cvs
[Top][All Lists]
Advanced

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

[Koha-cvs] koha/C4 Koha.pm


From: Antoine Farnault
Subject: [Koha-cvs] koha/C4 Koha.pm
Date: Wed, 12 Jul 2006 07:45:40 +0000

CVSROOT:        /sources/koha
Module name:    koha
Changes by:     Antoine Farnault <toins>        06/07/12 07:45:40

Modified files:
        C4             : Koha.pm 

Log message:
        Code cleaning :
        Sub renamed.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Koha.pm?cvsroot=koha&r1=1.37&r2=1.38

Patches:
Index: Koha.pm
===================================================================
RCS file: /sources/koha/koha/C4/Koha.pm,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -b -r1.37 -r1.38
--- Koha.pm     7 Jun 2006 07:50:04 -0000       1.37
+++ Koha.pm     12 Jul 2006 07:45:39 -0000      1.38
@@ -17,7 +17,7 @@
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-# $Id: Koha.pm,v 1.37 2006/06/07 07:50:04 btoumi Exp $
+# $Id: Koha.pm,v 1.38 2006/07/12 07:45:39 toins Exp $
 
 use strict;
 require Exporter;
@@ -25,7 +25,7 @@
 
 use vars qw($VERSION @ISA @EXPORT);
 
-$VERSION = do { my @v = '$Revision: 1.37 $' =~ /\d+/g; shift(@v) . "." . 
join("_", map {sprintf "%03d", $_ } @v); };
+$VERSION = do { my @v = '$Revision: 1.38 $' =~ /\d+/g; shift(@v) . "." . 
join("_", map {sprintf "%03d", $_ } @v); };
 
 =head1 NAME
 
@@ -51,7 +51,7 @@
                        &subfield_is_koha_internal_p
                        &getbranches &getbranch &getbranchdetail
                        &getprinters &getprinter
-                       &getitemtypes &getitemtypeinfo
+            &GetItemTypes &getitemtypeinfo
                         get_itemtypeinfos_of
                        &getframeworks &getframeworkinfo
                        &getauthtypes &getauthtype
@@ -285,9 +285,9 @@
        return ($count,\%letters);
 }
 
-=head2 getitemtypes
+=head2 GetItemTypes
 
-  $itemtypes = &getitemtypes();
+  $itemtypes = &GetItemTypes();
 
 Returns information about existing itemtypes.
 
@@ -295,7 +295,7 @@
 
 =head3 in PERL SCRIPT
 
-my $itemtypes = getitemtypes;
+my $itemtypes = GetItemTypes;
 my @itemtypesloop;
 foreach my $thisitemtype (sort keys %$itemtypes) {
        my $selected = 1 if $thisitemtype eq $itemtype;
@@ -323,11 +323,15 @@
 
 =cut
 
-sub getitemtypes {
+sub GetItemTypes {
 # returns a reference to a hash of references to branches...
        my %itemtypes;
        my $dbh = C4::Context->dbh;
-       my $sth=$dbh->prepare("select * from itemtypes");
+    my $query = qq|
+        SELECT *
+        FROM   itemtypes
+    |;
+    my $sth=$dbh->prepare($query);
        $sth->execute;
        while (my $IT=$sth->fetchrow_hashref) {
                        $itemtypes{$IT->{'itemtype'}}=$IT;
@@ -335,7 +339,7 @@
        return (\%itemtypes);
 }
 
-# FIXME this function is better and should replace getitemtypes everywhere
+# FIXME this function is better and should replace GetItemTypes everywhere
 sub get_itemtypeinfos_of {
     my @itemtypes = @_;
 




reply via email to

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