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)};      
 }
+...@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

_______________________________________________
Koha-patches mailing list
[email protected]
http://lists.koha.org/mailman/listinfo/koha-patches

Reply via email to