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 811-822 OPAC: Link Here
811
              type: modalselect
811
              type: modalselect
812
              source: borrowers
812
              source: borrowers
813
              exclusions: sort1|sort2|gonenoaddress|lost|flags
813
              exclusions: sort1|sort2|gonenoaddress|lost|flags
814
        -
815
            - "Display the following additional instructions for patrons who self register via the OPAC ( HTML is allowed ):"
816
            - pref: PatronSelfRegistrationAdditionalInstructions
817
              type: textarea
818
              syntax: text/html
819
              class: html
820
        -
814
        -
821
            - pref: PatronSelfRegistrationEmailMustBeUnique
815
            - pref: PatronSelfRegistrationEmailMustBeUnique
822
              choices:
816
              choices:
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt (-1 / +1 lines)
Lines 520-526 Link Here
520
            [% END %]
520
            [% END %]
521
        [% END %]
521
        [% END %]
522
    [% ELSE %]
522
    [% ELSE %]
523
        [% SET opac_available_options = [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'OpacLibraryInfo',  ] %]
523
        [% SET opac_available_options = [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'OpacLibraryInfo', 'PatronSelfRegistrationAdditionalInstructions' ] %]
524
        <optgroup label="OPAC">
524
        <optgroup label="OPAC">
525
            [% FOREACH l IN opac_available_options.sort %]
525
            [% FOREACH l IN opac_available_options.sort %]
526
                [% IF l == location %]
526
                [% 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