Bug 4307: Sorts library locations in inventory drop-down list.

Replacement patch for previous patch submitted.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
This commit is contained in:
Garry Collum 2010-04-23 22:25:10 -04:00 committed by Galen Charlton
parent 86c82d0aaa
commit a8927736dc
2 changed files with 2 additions and 1 deletions

View File

@ -77,6 +77,7 @@ $(document).ready(function(){
<legend>Select items you want to check</legend>
<ol><li>
<label for="branchloop">Library</label><select id="branchloop" name="branchcode" style="width:12em;">
<option value="">All Locations</option>
<!-- TMPL_LOOP NAME="branchloop" -->
<!-- TMPL_IF name="selected" -->
<option value="<!-- TMPL_VAR NAME="value" -->" selected="selected"><!-- TMPL_VAR NAME="branchname" --></option>

View File

@ -65,13 +65,13 @@ 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;
my @authorised_value_list;
my $authorisedvalue_categories;