|
Lines 249-255
sub GetItemTypes {
Link Here
|
| 249 |
require C4::Languages; |
249 |
require C4::Languages; |
| 250 |
my $language = C4::Languages::getlanguage(); |
250 |
my $language = C4::Languages::getlanguage(); |
| 251 |
# returns a reference to a hash of references to itemtypes... |
251 |
# returns a reference to a hash of references to itemtypes... |
| 252 |
my %itemtypes; |
|
|
| 253 |
my $dbh = C4::Context->dbh; |
252 |
my $dbh = C4::Context->dbh; |
| 254 |
my $query = q| |
253 |
my $query = q| |
| 255 |
SELECT |
254 |
SELECT |
|
Lines 275-286
sub GetItemTypes {
Link Here
|
| 275 |
$sth->execute( $language ); |
274 |
$sth->execute( $language ); |
| 276 |
|
275 |
|
| 277 |
if ( $style eq 'hash' ) { |
276 |
if ( $style eq 'hash' ) { |
|
|
277 |
my %itemtypes; |
| 278 |
while ( my $IT = $sth->fetchrow_hashref ) { |
278 |
while ( my $IT = $sth->fetchrow_hashref ) { |
| 279 |
$itemtypes{ $IT->{'itemtype'} } = $IT; |
279 |
$itemtypes{ $IT->{'itemtype'} } = $IT; |
| 280 |
} |
280 |
} |
| 281 |
return ( \%itemtypes ); |
281 |
return ( \%itemtypes ); |
| 282 |
} else { |
282 |
} else { |
| 283 |
return $sth->fetchall_arrayref({}); |
283 |
return [ sort { lc $a->{translated_description} cmp lc $b->{translated_description} } @{ $sth->fetchall_arrayref( {} ) } ]; |
| 284 |
} |
284 |
} |
| 285 |
} |
285 |
} |
| 286 |
|
286 |
|
| 287 |
- |
|
|