sort the branches alphebetically.

This commit is contained in:
joshferraro 2005-07-06 21:28:49 +00:00
parent d947a81b8d
commit d4e68b3d99
1 changed files with 9 additions and 3 deletions

View File

@ -57,6 +57,10 @@ my $branch = $query->param('branch');
$template->param(branch => $branch);
my $branches = getbranches();
if (!$branches->{$branch}) {
$branch='';
}
$template->param(branchname => $branches->{$branch}->{'branchname'});
# make branch selection options...
@ -69,14 +73,13 @@ my @CGIbranchlooparray;
foreach my $branch (keys %$branches) {
if ($branch) {
my %line;
$line{branch} = $branches->{$branch}->{'branchname'};
warn "here's a branch:".$line{branch};
$line{value} = $branch;
push @CGIbranchlooparray, \%line;
}
}
@CGIbranchlooparray = sort {$a->{branch} cmp $b->{branch}} @CGIbranchlooparray;
my $CGIbranchloop = \@CGIbranchlooparray;
$template->param( CGIbranch => $CGIbranchloop);
@ -207,10 +210,13 @@ if ($query->param('item_types_selected')) {
$fee = sprintf "%.02f", $fee;
$template->param(fee => $fee,istherefee => $fee>0?1:0);
$template->param(item_types_selected => 1);
warn "Branch is ==$branch==";
$template->param(no_branch_selected => 1) unless ($branch!='');
} else {
$template->param(message => 1);
$template->param(no_items_selected => 1) unless ($proceed);
$template->param(no_branch_selected =>1) unless ($branch);
$template->param(no_branch_selected => 1) unless ($branch);
warn "Branch is ==$branch==";
}
} elsif ($query->param('place_reserve')) {
# here we actually do the reserveration. Stage 3.