View | Details | Raw Unified | Return to bug 27604
Collapse All | Expand All

(-)a/opac/opac-memberentry.pl (-9 / +13 lines)
Lines 76-90 if ( $action eq q{} ) { Link Here
76
my $mandatory = GetMandatoryFields($action);
76
my $mandatory = GetMandatoryFields($action);
77
77
78
my @libraries = Koha::Libraries->search;
78
my @libraries = Koha::Libraries->search;
79
if ( $action eq 'new'
79
if ( $action eq 'create' || $action eq 'new' ) {
80
    && ( my @libraries_to_display = split '\|', C4::Context->preference('PatronSelfRegistrationLibraryList') )
80
    my @PatronSelfRegistrationLibraryList = split '\|', C4::Context->preference('PatronSelfRegistrationLibraryList');
81
) {
81
    if (@PatronSelfRegistrationLibraryList) {
82
    @libraries = map {
82
        @libraries = map {
83
        my $b          = $_;
83
            my $l = $_;
84
        my $branchcode = $_->branchcode;
84
            ( grep { $l->branchcode eq $_ } @PatronSelfRegistrationLibraryList )
85
        ( grep { $_ eq $branchcode } @libraries_to_display ) ? $b : ()
85
              ? $l
86
    } @libraries;
86
              : ()
87
        } @libraries;
88
    }
87
}
89
}
90
88
my ( $min, $max ) = C4::Members::get_cardnumber_length();
91
my ( $min, $max ) = C4::Members::get_cardnumber_length();
89
if ( defined $min ) {
92
if ( defined $min ) {
90
     $template->param(
93
     $template->param(
Lines 159-164 if ( $action eq 'create' ) { Link Here
159
            borrower       => \%borrower
162
            borrower       => \%borrower
160
        );
163
        );
161
        $template->param( patron_attribute_classes => GeneratePatronAttributesForm( undef, $attributes ) );
164
        $template->param( patron_attribute_classes => GeneratePatronAttributesForm( undef, $attributes ) );
165
    } elsif ( ! grep { $borrower{branchcode} eq $_->branchcode } @libraries ) {
166
        die "Branchcode not allowed"; # They hack the form
162
    }
167
    }
163
    else {
168
    else {
164
        if (
169
        if (
165
- 

Return to bug 27604