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

(-)a/opac/opac-memberentry.pl (-5 / +10 lines)
Lines 58-64 if ( $action eq q{} ) { Link Here
58
58
59
$template->param(
59
$template->param(
60
    action            => $action,
60
    action            => $action,
61
    hidden            => GetHiddenFields(),
61
    hidden            => GetHiddenFields($action),
62
    mandatory         => GetMandatoryFields($action),
62
    mandatory         => GetMandatoryFields($action),
63
    member_titles     => GetTitles() || undef,
63
    member_titles     => GetTitles() || undef,
64
    branches          => GetBranchesLoop(),
64
    branches          => GetBranchesLoop(),
Lines 229-243 $template->param( Link Here
229
output_html_with_http_headers $cgi, $cookie, $template->output;
229
output_html_with_http_headers $cgi, $cookie, $template->output;
230
230
231
sub GetHiddenFields {
231
sub GetHiddenFields {
232
    my ($action) = @_;
232
    my %hidden_fields;
233
    my %hidden_fields;
233
234
234
    my $BorrowerUnwantedField =
235
    my $BorrowerUnwantedField =
235
      C4::Context->preference("PatronSelfRegistrationBorrowerUnwantedField");
236
      C4::Context->preference("PatronSelfRegistrationBorrowerUnwantedField");
236
237
238
    #Fetch the mandatory fields to compare against hidden fields
239
    my @mandatory_fields = keys %{GetMandatoryFields($action)};
240
237
    my @fields = split( /\|/, $BorrowerUnwantedField );
241
    my @fields = split( /\|/, $BorrowerUnwantedField );
238
    foreach (@fields) {
242
    foreach my $field (@fields) {
239
        next unless m/\w/o;
243
        next unless $field =~ m/\w/o;
240
        $hidden_fields{$_} = 1;
244
        #Don't hide mandatory fields
245
        next if grep { $_ eq $field } @mandatory_fields;
246
        $hidden_fields{$field} = 1;
241
    }
247
    }
242
248
243
    return \%hidden_fields;
249
    return \%hidden_fields;
244
- 

Return to bug 13526