Bug 2553: Fixes drop-down alphabetization in acquisitions - New order and Receive order.

Fixes alphabetization of library dropdown in New Order, and the shelf location, item type, and collection code in the Receive Items pages.  This patch takes care of Joann's original purpose of creating the bug enhancement.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
This commit is contained in:
Garry Collum 2009-07-17 20:24:56 -04:00 committed by Galen Charlton
parent 36e0248231
commit 7e49156687
2 changed files with 5 additions and 5 deletions

View file

@ -145,7 +145,7 @@ for ( my $i = 0 ; $i < $count ; $i++ ) {
my $itemtypes = GetItemTypes; my $itemtypes = GetItemTypes;
my @itemtypesloop; my @itemtypesloop;
foreach my $thisitemtype (sort keys %$itemtypes) { foreach my $thisitemtype (sort {$itemtypes->{$a}->{'description'} cmp $itemtypes->{$b}->{'description'}} keys %$itemtypes) {
push @itemtypesloop, { itemtype => $itemtypes->{$thisitemtype}->{'itemtype'} , desc => $itemtypes->{$thisitemtype}->{'description'} } ; push @itemtypesloop, { itemtype => $itemtypes->{$thisitemtype}->{'itemtype'} , desc => $itemtypes->{$thisitemtype}->{'description'} } ;
} }
@ -156,7 +156,7 @@ my $onlymine=C4::Context->preference('IndependantBranches') &&
C4::Context->userenv->{branch}; C4::Context->userenv->{branch};
my $branches = GetBranches($onlymine); my $branches = GetBranches($onlymine);
my @branchloop; my @branchloop;
foreach my $thisbranch ( sort keys %$branches ) { foreach my $thisbranch ( sort {$branches->{$a}->{'branchname'} cmp $branches->{$b}->{'branchname'}} keys %$branches ) {
my %row = ( my %row = (
value => $thisbranch, value => $thisbranch,
branchname => $branches->{$thisbranch}->{'branchname'}, branchname => $branches->{$thisbranch}->{'branchname'},

View file

@ -104,7 +104,7 @@ if ( $count == 1 ) {
my (@itemtypesloop,@locationloop,@ccodeloop); my (@itemtypesloop,@locationloop,@ccodeloop);
my $itemtypes = GetItemTypes; my $itemtypes = GetItemTypes;
foreach my $thisitemtype (sort keys %$itemtypes) { foreach my $thisitemtype (sort {$itemtypes->{$a}->{'description'} cmp $itemtypes->{$b}->{'description'}} keys %$itemtypes) {
push @itemtypesloop, { push @itemtypesloop, {
value => $thisitemtype, value => $thisitemtype,
description => $itemtypes->{$thisitemtype}->{'description'}, description => $itemtypes->{$thisitemtype}->{'description'},
@ -112,14 +112,14 @@ if ( $count == 1 ) {
}; };
} }
my $locs = GetKohaAuthorisedValues( 'items.location' ); my $locs = GetKohaAuthorisedValues( 'items.location' );
foreach my $thisloc (sort keys %$locs) { foreach my $thisloc (sort {$locs->{$a} cmp $locs->{$b}} keys %$locs) {
push @locationloop, { push @locationloop, {
value => $thisloc, value => $thisloc,
description => $locs->{$thisloc}, description => $locs->{$thisloc},
}; };
} }
my $ccodes = GetKohaAuthorisedValues( 'items.ccode' ); my $ccodes = GetKohaAuthorisedValues( 'items.ccode' );
foreach my $thisccode (sort keys %$ccodes) { foreach my $thisccode (sort {$ccodes->{$a} cmp $ccodes->{$b}} keys %$ccodes) {
push @ccodeloop, { push @ccodeloop, {
value => $thisccode, value => $thisccode,
description => $ccodes->{$thisccode}, description => $ccodes->{$thisccode},