[Koha-patches] [PATCH] Bug 4307: Fixes branch order in inventory form.

Garry Collum gcollum at gmail.com
Sat Mar 20 15:02:52 CET 2010


Sorts branch drop-down alphabetically.
---
 tools/inventory.pl |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/tools/inventory.pl b/tools/inventory.pl
index 56f0bcb..dafba4f 100755
--- a/tools/inventory.pl
+++ b/tools/inventory.pl
@@ -65,12 +65,14 @@ my ($template, $borrowernumber, $cookie)
 
 my $branches = GetBranches();
 my @branch_loop;
-push @branch_loop, {value => "", branchname => "All Locations", };
 for my $branch_hash (keys %$branches) {
 	push @branch_loop, {value => "$branch_hash",
 	                   branchname => $branches->{$branch_hash}->{'branchname'}, 
 	                   selected => ($branch_hash eq $branchcode?1:0)};	
 }
+ at branch_loop = sort {$a->{branchname} cmp $b->{branchname}} @branch_loop;
+unshift @branch_loop, {value => "", branchname => "All Locations", };
+ 
 
 my @authorised_value_list;
 my $authorisedvalue_categories;
-- 
1.5.6.5




More information about the Koha-patches mailing list