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

(-)a/installer/data/mysql/atomicupdate/bug-34889-move-PatronSelfRegistrationAdditionalInstructions-to-additional-contents.pl (+32 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "34889",
5
    description => "Move PatronSelfRegistrationAdditionalInstructions to additional contents",
6
    up          => sub {
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
10
        # Get any existing value from the PatronSelfRegistrationAdditionalInstructions system preference
11
        my ($patronselfregistrationadditionalinstructions) = $dbh->selectrow_array(
12
            q|
13
            SELECT value FROM systempreferences WHERE variable='PatronSelfRegistrationAdditionalInstructions';
14
        |
15
        );
16
        if ($patronselfregistrationadditionalinstructions) {
17
18
            # Insert any values found from system preference into additional_contents
19
            foreach my $lang ('default') {
20
                $dbh->do(
21
                    "INSERT INTO additional_contents ( category, code, location, branchcode, title, content, lang, published_on ) VALUES ('html_customizations', 'PatronSelfRegistrationAdditionalInstructions', 'PatronSelfRegistrationAdditionalInstructions', NULL, ?, ?, ?, CAST(NOW() AS date) )",
22
                    undef,                                         "PatronSelfRegistrationAdditionalInstructions $lang",
23
                    $patronselfregistrationadditionalinstructions, $lang
24
                );
25
            }
26
27
            # Remove old system preference
28
            $dbh->do("DELETE FROM systempreferences WHERE variable='PatronSelfRegistrationAdditionalInstructions'");
29
            say $out "Bug 34889 update done";
30
        }
31
    }
32
    }
(-)a/installer/data/mysql/mandatory/sysprefs.sql (-1 lines)
Lines 567-573 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
567
('PatronSelfModificationBorrowerUnwantedField','',NULL,'Name the fields you don\'t want to display when a patron is editing their information via the OPAC.','free'),
567
('PatronSelfModificationBorrowerUnwantedField','',NULL,'Name the fields you don\'t want to display when a patron is editing their information via the OPAC.','free'),
568
('PatronSelfModificationMandatoryField','',NULL,'Define the required fields when a patron is editing their information via the OPAC','free'),
568
('PatronSelfModificationMandatoryField','',NULL,'Define the required fields when a patron is editing their information via the OPAC','free'),
569
('PatronSelfRegistration','0',NULL,'If enabled, patrons will be able to register themselves via the OPAC.','YesNo'),
569
('PatronSelfRegistration','0',NULL,'If enabled, patrons will be able to register themselves via the OPAC.','YesNo'),
570
('PatronSelfRegistrationAdditionalInstructions','','','A free text field to display additional instructions to newly self registered patrons.','free'),
571
('PatronSelfRegistrationBorrowerMandatoryField','surname|firstname',NULL,'Choose the mandatory fields for a patron\'s account, when registering via the OPAC.','free'),
570
('PatronSelfRegistrationBorrowerMandatoryField','surname|firstname',NULL,'Choose the mandatory fields for a patron\'s account, when registering via the OPAC.','free'),
572
('PatronSelfRegistrationBorrowerUnwantedField','',NULL,'Name the fields you don\'t want to display when registering a new patron via the OPAC.','free'),
571
('PatronSelfRegistrationBorrowerUnwantedField','',NULL,'Name the fields you don\'t want to display when registering a new patron via the OPAC.','free'),
573
('PatronSelfRegistrationConfirmEmail', '0', NULL, 'Require users to confirm their email address by entering it twice.', 'YesNo'),
572
('PatronSelfRegistrationConfirmEmail', '0', NULL, 'Require users to confirm their email address by entering it twice.', 'YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-6 lines)
Lines 799-810 OPAC: Link Here
799
              type: modalselect
799
              type: modalselect
800
              source: borrowers
800
              source: borrowers
801
              exclusions: sort1|sort2|gonenoaddress|lost|flags
801
              exclusions: sort1|sort2|gonenoaddress|lost|flags
802
        -
803
            - "Display the following additional instructions for patrons who self register via the OPAC ( HTML is allowed ):"
804
            - pref: PatronSelfRegistrationAdditionalInstructions
805
              type: textarea
806
              syntax: text/html
807
              class: html
808
        -
802
        -
809
            - pref: PatronSelfRegistrationEmailMustBeUnique
803
            - pref: PatronSelfRegistrationEmailMustBeUnique
810
              choices:
804
              choices:
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt (-1 / +1 lines)
Lines 524-530 Link Here
524
            [% END %]
524
            [% END %]
525
        [% END %]
525
        [% END %]
526
    [% ELSE %]
526
    [% ELSE %]
527
        [% SET opac_available_options = [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'OpacLibraryInfo', 'OpacMaintenanceNotice', 'OPACResultsSidebar', 'CatalogConcernHelp', 'CatalogConcernTemplate', 'CookieConsentBar', 'CookieConsentPopup' ] %]
527
        [% SET opac_available_options = [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'OpacLibraryInfo', 'OpacMaintenanceNotice', 'OPACResultsSidebar', 'CatalogConcernHelp', 'CatalogConcernTemplate', 'CookieConsentBar', 'CookieConsentPopup', 'PatronSelfRegistrationAdditionalInstructions' ] %]
528
        <optgroup label="OPAC">
528
        <optgroup label="OPAC">
529
            [% FOREACH l IN opac_available_options.sort %]
529
            [% FOREACH l IN opac_available_options.sort %]
530
                [% IF l == location %]
530
                [% IF l == location %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-registration-confirmation.tt (-2 / +6 lines)
Lines 4-9 Link Here
4
[% SET OpacNavRight = AdditionalContents.get( location => "OpacNavRight", lang => news_lang, library => logged_in_user.branchcode || default_branch ) %]
4
[% SET OpacNavRight = AdditionalContents.get( location => "OpacNavRight", lang => news_lang, library => logged_in_user.branchcode || default_branch ) %]
5
[% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
5
[% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
6
[% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
6
[% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
7
[% SET PatronSelfRegistrationAdditionalInstructions = AdditionalContents.get( location => "PatronSelfRegistrationAdditionalInstructions", lang => lang, library => branchcode || default_branch ) %]
7
[% INCLUDE 'doc-head-open.inc' %]
8
[% INCLUDE 'doc-head-open.inc' %]
8
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
9
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
9
[% INCLUDE 'doc-head-close.inc' %]
10
[% INCLUDE 'doc-head-close.inc' %]
Lines 74-80 Link Here
74
                            </p>
75
                            </p>
75
                        [% END %]
76
                        [% END %]
76
77
77
                        <div id="PatronSelfRegistrationAdditionalInstructions">[% PatronSelfRegistrationAdditionalInstructions | $raw %]</div>
78
                        [% IF ( PatronSelfRegistrationAdditionalInstructions ) %]
79
                            <div id="PatronSelfRegistrationAdditionalInstructions">
80
                                [% PROCESS koha_news_block news => PatronSelfRegistrationAdditionalInstructions %]
81
                            </div>
82
                        [% END %]
78
                    </div> <!-- /#registration-complete -->
83
                    </div> <!-- /#registration-complete -->
79
                </div> <!-- / .col-7/9 -->
84
                </div> <!-- / .col-7/9 -->
80
85
81
- 

Return to bug 34889