Code cleaning :
Sub renamed.
This commit is contained in:
parent
adb2fba8ad
commit
e94f7f5efd
1 changed files with 360 additions and 356 deletions
18
C4/Koha.pm
18
C4/Koha.pm
|
@ -51,7 +51,7 @@ Koha.pm provides many functions for Koha scripts.
|
|||
&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 @@ sub getletters {
|
|||
return ($count,\%letters);
|
||||
}
|
||||
|
||||
=head2 getitemtypes
|
||||
=head2 GetItemTypes
|
||||
|
||||
$itemtypes = &getitemtypes();
|
||||
$itemtypes = &GetItemTypes();
|
||||
|
||||
Returns information about existing itemtypes.
|
||||
|
||||
|
@ -295,7 +295,7 @@ build a HTML select with the following code :
|
|||
|
||||
=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 @@ $template->param(itemtypeloop => \@itemtypesloop);
|
|||
|
||||
=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 @@ sub getitemtypes {
|
|||
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 = @_;
|
||||
|
||||
|
|
Loading…
Reference in a new issue