|
Lines 207-222
if (C4::Context->preference("marcflavour") eq "UNIMARC" ) {
Link Here
|
| 207 |
|
207 |
|
| 208 |
# load the branches |
208 |
# load the branches |
| 209 |
my $branches = GetBranches(); |
209 |
my $branches = GetBranches(); |
| 210 |
my @branch_loop; |
|
|
| 211 |
|
210 |
|
| 212 |
# we need to know the borrower branch code to set a default branch |
211 |
# Populate branch_loop with all branches sorted by their name. If |
| 213 |
my $borrowerbranchcode = C4::Context->userenv->{'branch'}; |
212 |
# independantbranches is activated, set the default branch to the borrower |
| 214 |
|
213 |
# branch, except for superlibrarian who need to search all libraries. |
| 215 |
for my $branch_hash (sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } keys %$branches) { |
214 |
my $user = C4::Context->userenv; |
| 216 |
# if independantbranches is activated, set the default branch to the borrower branch |
215 |
my @branch_loop = map { |
| 217 |
my $selected = (C4::Context->preference("independantbranches") and ($borrowerbranchcode eq $branch_hash)) ? 1 : undef; |
216 |
{ |
| 218 |
push @branch_loop, {value => "$branch_hash" , branchname => $branches->{$branch_hash}->{'branchname'}, selected => $selected}; |
217 |
value => $_, |
| 219 |
} |
218 |
branchname => $branches->{$_}->{branchname}, |
|
|
219 |
selected => $user->{branch} eq $_ && C4::Branch::onlymine(), |
| 220 |
} |
| 221 |
} sort { |
| 222 |
$branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} |
| 223 |
} keys %$branches; |
| 220 |
|
224 |
|
| 221 |
my $categories = GetBranchCategories(undef,'searchdomain'); |
225 |
my $categories = GetBranchCategories(undef,'searchdomain'); |
| 222 |
|
226 |
|
| 223 |
- |
|
|