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

(-)a/installer/data/mysql/atomicupdate/bug_14658-add_PatronSelfModificationBorrowerUnwantedField_syspref.sql (+1 lines)
Line 0 Link Here
1
INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) SELECT 'PatronSelfModificationBorrowerUnwantedField',value,NULL,'Name the fields you don\'t want to display when a patron is editing their information via the OPAC.','free' FROM systempreferences WHERE variable = 'PatronSelfRegistrationBorrowerUnwantedField';
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 335-340 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
335
('OverdueNoticeCalendar',0,NULL,'Take the calendar into consideration when generating overdue notices','YesNo'),
335
('OverdueNoticeCalendar',0,NULL,'Take the calendar into consideration when generating overdue notices','YesNo'),
336
('OverduesBlockCirc','noblock','noblock|confirmation|block','When checking out an item should overdues block checkout, generate a confirmation dialogue, or allow checkout','Choice'),
336
('OverduesBlockCirc','noblock','noblock|confirmation|block','When checking out an item should overdues block checkout, generate a confirmation dialogue, or allow checkout','Choice'),
337
('patronimages','0',NULL,'Enable patron images for the Staff Client','YesNo'),
337
('patronimages','0',NULL,'Enable patron images for the Staff Client','YesNo'),
338
('PatronSelfModificationBorrowerUnwantedField','',NULL,'Name the fields you don\'t want to display when a patron is editing their information via the OPAC.','free'),
338
('PatronSelfRegistration','0',NULL,'If enabled, patrons will be able to register themselves via the OPAC.','YesNo'),
339
('PatronSelfRegistration','0',NULL,'If enabled, patrons will be able to register themselves via the OPAC.','YesNo'),
339
('PatronSelfRegistrationAdditionalInstructions','','','A free text field to display additional instructions to newly self registered patrons.','free'),
340
('PatronSelfRegistrationAdditionalInstructions','','','A free text field to display additional instructions to newly self registered patrons.','free'),
340
('PatronSelfRegistrationBorrowerMandatoryField','surname|firstname',NULL,'Choose the mandatory fields for a patron\'s account, when registering via the OPAC.','free'),
341
('PatronSelfRegistrationBorrowerMandatoryField','surname|firstname',NULL,'Choose the mandatory fields for a patron\'s account, when registering via the OPAC.','free'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-2 / +7 lines)
Lines 652-658 OPAC: Link Here
652
              choices:
652
              choices:
653
                  yes: Allow
653
                  yes: Allow
654
                  no: "Don't allow"
654
                  no: "Don't allow"
655
            - "library patrons to register an account via the OPAC."
655
            - "library patrons to register or modify their account via the OPAC."
656
        -
656
        -
657
            - pref: PatronSelfRegistrationVerifyByEmail
657
            - pref: PatronSelfRegistrationVerifyByEmail
658
              choices:
658
              choices:
Lines 675-685 OPAC: Link Here
675
              class: multi
675
              class: multi
676
            - (separate columns with |)
676
            - (separate columns with |)
677
        -
677
        -
678
            - "The following <a href='http://schema.koha-community.org/tables/borrowers.html' target='blank'>database columns</a> will not appear on the patron entry screen:"
678
            - "The following <a href='http://schema.koha-community.org/tables/borrowers.html' target='blank'>database columns</a> will not appear on the patron self-registration screen:"
679
            - pref: PatronSelfRegistrationBorrowerUnwantedField
679
            - pref: PatronSelfRegistrationBorrowerUnwantedField
680
              class: multi
680
              class: multi
681
            - (separate columns with |)
681
            - (separate columns with |)
682
        -
682
        -
683
            - "The following <a href='http://schema.koha-community.org/tables/borrowers.html' target='blank'>database columns</a> will not appear on the patron self-modification screen:"
684
            - pref: PatronSelfModificationBorrowerUnwantedField
685
              class: multi
686
            - (separate columns with |)
687
        -
683
            - "Display the following additional instructions for patrons who self register via the OPAC ( HTML is allowed ):"
688
            - "Display the following additional instructions for patrons who self register via the OPAC ( HTML is allowed ):"
684
            - pref: PatronSelfRegistrationAdditionalInstructions
689
            - pref: PatronSelfRegistrationAdditionalInstructions
685
              type: htmlarea
690
              type: htmlarea
(-)a/opac/opac-memberentry.pl (-6 / +6 lines)
Lines 59-69 if ( $action eq q{} ) { Link Here
59
}
59
}
60
60
61
my $mandatory = GetMandatoryFields($action);
61
my $mandatory = GetMandatoryFields($action);
62
my $hidden = GetHiddenFields($mandatory);
63
62
64
$template->param(
63
$template->param(
65
    action            => $action,
64
    action            => $action,
66
    hidden            => $hidden,
65
    hidden            => GetHiddenFields( $mandatory, 'registration' ),
67
    mandatory         => $mandatory,
66
    mandatory         => $mandatory,
68
    member_titles     => GetTitles() || undef,
67
    member_titles     => GetTitles() || undef,
69
    branches          => GetBranchesLoop(),
68
    branches          => GetBranchesLoop(),
Lines 224-230 elsif ( $action eq 'edit' ) { #Display logged in borrower's data Link Here
224
    }
223
    }
225
224
226
    $template->param(
225
    $template->param(
227
        borrower => $borrower, );
226
        borrower => $borrower,
227
        hidden => GetHiddenFields( $mandatory, 'modification' ),
228
    );
228
229
229
    if (C4::Context->preference('OPACpatronimages')) {
230
    if (C4::Context->preference('OPACpatronimages')) {
230
        my ($image, $dberror) = GetPatronImage($borrower->{borrowernumber});
231
        my ($image, $dberror) = GetPatronImage($borrower->{borrowernumber});
Lines 247-257 $template->param( Link Here
247
output_html_with_http_headers $cgi, $cookie, $template->output;
248
output_html_with_http_headers $cgi, $cookie, $template->output;
248
249
249
sub GetHiddenFields {
250
sub GetHiddenFields {
250
    my ($mandatory) = @_;
251
    my ( $mandatory, $action ) = @_;
251
    my %hidden_fields;
252
    my %hidden_fields;
252
253
253
    my $BorrowerUnwantedField =
254
    my $BorrowerUnwantedField =
254
      C4::Context->preference("PatronSelfRegistrationBorrowerUnwantedField");
255
      C4::Context->preference( "PatronSelf" . ucfirst($action) . "BorrowerUnwantedField" );
255
256
256
    my @fields = split( /\|/, $BorrowerUnwantedField );
257
    my @fields = split( /\|/, $BorrowerUnwantedField );
257
    foreach (@fields) {
258
    foreach (@fields) {
258
- 

Return to bug 14658