foreach my $thisbranch (@$branches) {
push @authorised_values, $thisbranch->{value};
$authorised_lib{$thisbranch->{value}} = $thisbranch->{branchname};
- $value = $thisbranch->{value} if $thisbranch->{selected};
+ $value = $thisbranch->{value} if $thisbranch->{selected} && !$value;
}
}
elsif ( $subfieldlib->{authorised_value} eq "itemtypes" ) {
C4::Context->userenv &&
C4::Context->userenv->{flags}!=1 &&
C4::Context->userenv->{branch};
-my $branches = GetBranchesLoop(undef,$onlymine); # build once ahead of time, instead of multiple times later.
+my $branches = GetBranchesLoop(C4::Context->userenv->{branch},$onlymine); # build once ahead of time, instead of multiple times later.
# We generate form, from actuel record
my @fields;
}
}
}
+@loop_data = sort {$a->{subfield} cmp $b->{subfield} } @loop_data;
# what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit.
$template->param( title => $record->title() ) if ($record ne "-1");