From d4e68b3d998caf3e945f7eb81ff06fbc2035d233 Mon Sep 17 00:00:00 2001 From: joshferraro Date: Wed, 6 Jul 2005 21:28:49 +0000 Subject: [PATCH] sort the branches alphebetically. --- opac/opac-reserve.pl | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl index 554b8b2589..c7a2a8fd59 100755 --- a/opac/opac-reserve.pl +++ b/opac/opac-reserve.pl @@ -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.