From 05ca641611b9d4df9ae56095fccc39b3b59d04a1 Mon Sep 17 00:00:00 2001 From: Joe Atzberger Date: Tue, 30 Dec 2008 13:50:15 -0600 Subject: [PATCH] Libraries (branches) should be sorted by branchname. The display sorted by code, resulting in nonsensical order for the users, who don't know or see the codes. Note, this data should come from GetBranchesLoop, when that function is availabled (from a separate patch). Signed-off-by: Galen Charlton Signed-off-by: Henri-Damien LAURENT --- opac/opac-search.pl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/opac/opac-search.pl b/opac/opac-search.pl index fa26b57cb0..67997267f7 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -116,11 +116,12 @@ if (C4::Context->preference('TagsEnabled')) { # load the branches my $branches = GetBranches(); -my @branch_loop; - -for my $branch_hash (sort keys %$branches) { - push @branch_loop, {value => "$branch_hash" , branchname => $branches->{$branch_hash}->{'branchname'}, }; -} +# FIXME: next line duplicates GetBranchesLoop(0,0); +my @branch_loop = map { + {value => $_, branchname => $branches->{$_}->{branchname}} + } sort { + $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} + } keys %$branches; my $categories = GetBranchCategories(undef,'searchdomain'); -- 2.39.5