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 354-359 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
354
('OverduesBlockCirc','noblock','noblock|confirmation|block','When checking out an item should overdues block checkout, generate a confirmation dialogue, or allow checkout','Choice'),
354
('OverduesBlockCirc','noblock','noblock|confirmation|block','When checking out an item should overdues block checkout, generate a confirmation dialogue, or allow checkout','Choice'),
355
('OverduesBlockRenewing','allow','allow|blockitem|block','If any of patron checked out documents is late, should renewal be allowed, blocked only on overdue items or blocked on whatever checked out document','Choice'),
355
('OverduesBlockRenewing','allow','allow|blockitem|block','If any of patron checked out documents is late, should renewal be allowed, blocked only on overdue items or blocked on whatever checked out document','Choice'),
356
('patronimages','0',NULL,'Enable patron images for the Staff Client','YesNo'),
356
('patronimages','0',NULL,'Enable patron images for the Staff Client','YesNo'),
357
('PatronSelfModificationBorrowerUnwantedField','',NULL,'Name the fields you don\'t want to display when a patron is editing their information via the OPAC.','free'),
357
('PatronSelfRegistration','0',NULL,'If enabled, patrons will be able to register themselves via the OPAC.','YesNo'),
358
('PatronSelfRegistration','0',NULL,'If enabled, patrons will be able to register themselves via the OPAC.','YesNo'),
358
('PatronSelfRegistrationAdditionalInstructions','','','A free text field to display additional instructions to newly self registered patrons.','free'),
359
('PatronSelfRegistrationAdditionalInstructions','','','A free text field to display additional instructions to newly self registered patrons.','free'),
359
('PatronSelfRegistrationBorrowerMandatoryField','surname|firstname',NULL,'Choose the mandatory fields for a patron\'s account, when registering via the OPAC.','free'),
360
('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 665-671 OPAC: Link Here
665
              choices:
665
              choices:
666
                  yes: Allow
666
                  yes: Allow
667
                  no: "Don't allow"
667
                  no: "Don't allow"
668
            - "library patrons to register an account via the OPAC."
668
            - "library patrons to register or modify their account via the OPAC."
669
        -
669
        -
670
            - pref: PatronSelfRegistrationVerifyByEmail
670
            - pref: PatronSelfRegistrationVerifyByEmail
671
              choices:
671
              choices:
Lines 688-698 OPAC: Link Here
688
              class: multi
688
              class: multi
689
            - (separate columns with |)
689
            - (separate columns with |)
690
        -
690
        -
691
            - "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:"
691
            - "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:"
692
            - pref: PatronSelfRegistrationBorrowerUnwantedField
692
            - pref: PatronSelfRegistrationBorrowerUnwantedField
693
              class: multi
693
              class: multi
694
            - (separate columns with |)
694
            - (separate columns with |)
695
        -
695
        -
696
            - "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:"
697
            - pref: PatronSelfModificationBorrowerUnwantedField
698
              class: multi
699
            - (separate columns with |)
700
        -
696
            - "Display the following additional instructions for patrons who self register via the OPAC ( HTML is allowed ):"
701
            - "Display the following additional instructions for patrons who self register via the OPAC ( HTML is allowed ):"
697
            - pref: PatronSelfRegistrationAdditionalInstructions
702
            - pref: PatronSelfRegistrationAdditionalInstructions
698
              type: htmlarea
703
              type: htmlarea
(-)a/opac/opac-memberentry.pl (-5 / +4 lines)
Lines 61-71 if ( $action eq q{} ) { Link Here
61
}
61
}
62
62
63
my $mandatory = GetMandatoryFields($action);
63
my $mandatory = GetMandatoryFields($action);
64
my $hidden = GetHiddenFields($mandatory);
65
64
66
$template->param(
65
$template->param(
67
    action            => $action,
66
    action            => $action,
68
    hidden            => $hidden,
67
    hidden            => GetHiddenFields( $mandatory, 'registration' ),
69
    mandatory         => $mandatory,
68
    mandatory         => $mandatory,
70
    member_titles     => GetTitles() || undef,
69
    member_titles     => GetTitles() || undef,
71
    branches          => GetBranchesLoop(),
70
    branches          => GetBranchesLoop(),
Lines 228-233 elsif ( $action eq 'edit' ) { #Display logged in borrower's data Link Here
228
    $template->param(
227
    $template->param(
229
        borrower  => $borrower,
228
        borrower  => $borrower,
230
        guarantor => Koha::Borrowers->find($borrowernumber)->guarantor(),
229
        guarantor => Koha::Borrowers->find($borrowernumber)->guarantor(),
230
        hidden => GetHiddenFields( $mandatory, 'modification' ),
231
    );
231
    );
232
232
233
    if (C4::Context->preference('OPACpatronimages')) {
233
    if (C4::Context->preference('OPACpatronimages')) {
Lines 251-261 $template->param( Link Here
251
output_html_with_http_headers $cgi, $cookie, $template->output, undef, { force_no_caching => 1 };
251
output_html_with_http_headers $cgi, $cookie, $template->output, undef, { force_no_caching => 1 };
252
252
253
sub GetHiddenFields {
253
sub GetHiddenFields {
254
    my ($mandatory) = @_;
254
    my ( $mandatory, $action ) = @_;
255
    my %hidden_fields;
255
    my %hidden_fields;
256
256
257
    my $BorrowerUnwantedField =
257
    my $BorrowerUnwantedField =
258
      C4::Context->preference("PatronSelfRegistrationBorrowerUnwantedField");
258
      C4::Context->preference( "PatronSelf" . ucfirst($action) . "BorrowerUnwantedField" );
259
259
260
    my @fields = split( /\|/, $BorrowerUnwantedField );
260
    my @fields = split( /\|/, $BorrowerUnwantedField );
261
    foreach (@fields) {
261
    foreach (@fields) {
262
- 

Return to bug 14658