Bug 2553: Fixes drop-down alphabetization for Circulation Statistics report form.
authorGarry Collum <gcollum@gmail.com>
Fri, 17 Jul 2009 23:31:55 +0000 (19:31 -0400)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Wed, 16 Sep 2009 21:19:20 +0000 (23:19 +0200)
Fixes alphabetization for the item type, library and collection drop-down lists in the Checkout Statistics wizard form.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Henri-Damien LAURENT <henridamien.laurent@biblibre.com>
reports/issues_stats.pl

index df848bd..a497564 100755 (executable)
@@ -133,13 +133,13 @@ my %select;
 
 # create itemtype arrayref for <select>.
 my @itemtypeloop;
-for my $itype ( keys(%$itemtypes)) {
+for my $itype ( sort {$itemtypes->{$a}->{description} cmp $itemtypes->{$b}->{description}} keys(%$itemtypes)) {
        push @itemtypeloop, { code => $itype , description => $itemtypes->{$itype}->{description} } ;
 }
 
 my $branches=GetBranches();
 my @branchloop;
-foreach (keys %$branches) {
+foreach (sort {$branches->{$a}->{'branchname'} cmp $branches->{$b}->{'branchname'}} keys %$branches) {
        my $thisbranch = ''; # FIXME 
        my %row = (
                branchcode => $_,
@@ -157,7 +157,7 @@ foreach (sort keys %$locations) {
 }
     
 my @ccodes;
-foreach (keys %$ccodes) {
+foreach (sort {$ccodes->{$a} cmp $ccodes->{$b}} keys %$ccodes) {
        push @ccodes, { code => $_, description => $ccodes->{$_} };
 }