$newdata{'contactname'} = $guarantordata->{'surname'};
$newdata{'contacttitle'} = $guarantordata->{'title'};
foreach (qw(streetnumber address streettype address2
- zipcode city phone phonepro mobile fax email emailpro branchcode)) {
+ zipcode country city phone phonepro mobile fax email emailpro branchcode)) {
$newdata{$_} = $guarantordata->{$_};
}
}
}
}
-###############test to take the right zipcode and city name ##############
+###############test to take the right zipcode, country and city name ##############
if (!defined($guarantorid) or $guarantorid eq '' or $guarantorid eq '0') {
# set only if parameter was passed from the form
$newdata{'city'} = $input->param('city') if defined($input->param('city'));
$newdata{'zipcode'} = $input->param('zipcode') if defined($input->param('zipcode'));
+ $newdata{'country'} = $input->param('country') if defined($input->param('country'));
}
#builds default userid
}
}
if (C4::Context->preference("IndependantBranches")) {
- if ($userenv && $userenv->{flags} != 1){
+ if ($userenv && $userenv->{flags} % 2 != 1){
$debug and print STDERR " $newdata{'branchcode'} : ".$userenv->{flags}.":".$userenv->{branch};
unless (!$newdata{'branchcode'} || $userenv->{branch} eq $newdata{'branchcode'}){
push @errors, "ERROR_branch";
}
if (C4::Context->preference("IndependantBranches")) {
my $userenv = C4::Context->userenv;
- if ($userenv->{flags} != 1 && $data{branchcode}){
+ if ($userenv->{flags} % 2 != 1 && $data{branchcode}){
unless ($userenv->{branch} eq $data{'branchcode'}){
print $input->redirect("/cgi-bin/koha/members/members-home.pl");
exit;
my $onlymine=(C4::Context->preference('IndependantBranches') &&
C4::Context->userenv &&
- C4::Context->userenv->{flags} !=1 &&
+ C4::Context->userenv->{flags} % 2 !=1 &&
C4::Context->userenv->{branch}?1:0);
my $branches=GetBranches($onlymine);