-# Set all the branches.
-my $onlymine=(C4::Context->preference('IndependantBranches') &&
- C4::Context->userenv &&
- C4::Context->userenv->{flags} % 2 !=1 &&
- C4::Context->userenv->{branch}?1:0);
-if ( $onlymine ) {
- $branch = C4::Context->userenv->{'branch'};
-}
-my $branchname = GetBranchName($branch);
-my $branches = GetBranches($onlymine);
-my @branchloop;
-for my $thisbranch (
- sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} }
- keys %{$branches} ) {
- push @branchloop,
- { value => $thisbranch,
- selected => $thisbranch eq $branch,
- branchname => $branches->{$thisbranch}->{'branchname'},
- };
-}
-
-# branches calculated - put branch codes in a single string so they can be passed in a form
-my $branchcodes = join '|', keys %{$branches};