+
+ my $branches = GetBranches;
+ my @branches_loop;
+ my $selected_branches = $attr_type->branches;
+ foreach my $branch (sort keys %$branches) {
+ my $selected = ( grep {$$_{branchcode} eq $branch} @$selected_branches ) ? 1 : 0;
+ push @branches_loop, {
+ branchcode => $branches->{$branch}{branchcode},
+ branchname => $branches->{$branch}{branchname},
+ selected => $selected,
+ };
+ }
+ $template->param( branches_loop => \@branches_loop );
+