Lines 75-84
if ( $action eq q{} ) {
Link Here
|
75 |
|
75 |
|
76 |
my $mandatory = GetMandatoryFields($action); |
76 |
my $mandatory = GetMandatoryFields($action); |
77 |
|
77 |
|
78 |
my @libraries = Koha::Libraries->search; |
78 |
my $params = {}; |
79 |
if ( my @libraries_to_display = split '\|', C4::Context->preference('PatronSelfRegistrationLibraryList') ) { |
79 |
if ( $action eq 'create' || $action eq 'new' ) { |
80 |
@libraries = map { my $b = $_; my $branchcode = $_->branchcode; grep( /^$branchcode$/, @libraries_to_display ) ? $b : () } @libraries; |
80 |
my @PatronSelfRegistrationLibraryList = split '\|', C4::Context->preference('PatronSelfRegistrationLibraryList'); |
|
|
81 |
$params = { branchcode => { -in => \@PatronSelfRegistrationLibraryList } } |
82 |
if @PatronSelfRegistrationLibraryList; |
81 |
} |
83 |
} |
|
|
84 |
my @libraries = Koha::Libraries->search($params); |
85 |
|
82 |
my ( $min, $max ) = C4::Members::get_cardnumber_length(); |
86 |
my ( $min, $max ) = C4::Members::get_cardnumber_length(); |
83 |
if ( defined $min ) { |
87 |
if ( defined $min ) { |
84 |
$template->param( |
88 |
$template->param( |
Lines 148-153
if ( $action eq 'create' ) {
Link Here
|
148 |
borrower => \%borrower |
152 |
borrower => \%borrower |
149 |
); |
153 |
); |
150 |
$template->param( patron_attribute_classes => GeneratePatronAttributesForm( undef, $attributes ) ); |
154 |
$template->param( patron_attribute_classes => GeneratePatronAttributesForm( undef, $attributes ) ); |
|
|
155 |
} elsif ( ! grep { $borrower{branchcode} eq $_->branchcode } @libraries ) { |
156 |
die "Branchcode not allowed"; # They hack the form |
151 |
} |
157 |
} |
152 |
else { |
158 |
else { |
153 |
if ( |
159 |
if ( |
154 |
- |
|
|