From a3bdf666f9b55cca33d9f945763f01b39192574d Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Tue, 1 Jul 2008 11:53:20 -0500 Subject: [PATCH] bug 2291: sort branches and letter types The drop-down lists of branches and letter templates in the overdue notice/status triggers tool are now sorted in ascending alphabetical order. No documentation change. Signed-off-by: Joshua Ferraro --- tools/overduerules.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/overduerules.pl b/tools/overduerules.pl index 668a69ef03..82a8ea3183 100755 --- a/tools/overduerules.pl +++ b/tools/overduerules.pl @@ -121,7 +121,7 @@ if ($op eq 'save') { } my $branches = GetBranches(); my @branchloop; -foreach my $thisbranch (keys %$branches) { +foreach my $thisbranch (sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } keys %$branches) { my $selected = 1 if $thisbranch eq $branch; my %row =(value => $thisbranch, selected => $selected, @@ -155,7 +155,7 @@ while (my $data=$sth->fetchrow_hashref){ $row{"debarred$i"}=$temphash{$data->{'categorycode'}}->{"debarred$i"}; if ($countletters){ my @letterloop; - foreach my $thisletter (keys %$letters) { + foreach my $thisletter (sort { $letters->{$a} cmp $letters->{$b} } keys %$letters) { my $selected = 1 if $thisletter eq $temphash{$data->{'categorycode'}}->{"letter$i"}; my %letterrow =(value => $thisletter, selected => $selected, @@ -177,7 +177,7 @@ while (my $data=$sth->fetchrow_hashref){ for (my $i=1;$i<=3;$i++){ if ($countletters){ my @letterloop; - foreach my $thisletter (keys %$letters) { + foreach my $thisletter (sort { $letters->{$a} cmp $letters->{$b} } keys %$letters) { my $selected = 1 if $thisletter eq $dat->{"letter$i"}; my %letterrow =(value => $thisletter, selected => $selected, -- 2.39.5