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 565-571 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
565
('PatronSelfModificationBorrowerUnwantedField','',NULL,'Name the fields you don\'t want to display when a patron is editing their information via the OPAC.','free'),
565
('PatronSelfModificationBorrowerUnwantedField','',NULL,'Name the fields you don\'t want to display when a patron is editing their information via the OPAC.','free'),
566
('PatronSelfModificationMandatoryField','',NULL,'Define the required fields when a patron is editing their information via the OPAC','free'),
566
('PatronSelfModificationMandatoryField','',NULL,'Define the required fields when a patron is editing their information via the OPAC','free'),
567
('PatronSelfRegistration','0',NULL,'If enabled, patrons will be able to register themselves via the OPAC.','YesNo'),
567
('PatronSelfRegistration','0',NULL,'If enabled, patrons will be able to register themselves via the OPAC.','YesNo'),
568
('PatronSelfRegistrationAdditionalInstructions','','','A free text field to display additional instructions to newly self registered patrons.','free'),
569
('PatronSelfRegistrationBorrowerMandatoryField','surname|firstname',NULL,'Choose the mandatory fields for a patron\'s account, when registering via the OPAC.','free'),
568
('PatronSelfRegistrationBorrowerMandatoryField','surname|firstname',NULL,'Choose the mandatory fields for a patron\'s account, when registering via the OPAC.','free'),
570
('PatronSelfRegistrationBorrowerUnwantedField','',NULL,'Name the fields you don\'t want to display when registering a new patron via the OPAC.','free'),
569
('PatronSelfRegistrationBorrowerUnwantedField','',NULL,'Name the fields you don\'t want to display when registering a new patron via the OPAC.','free'),
571
('PatronSelfRegistrationConfirmEmail', '0', NULL, 'Require users to confirm their email address by entering it twice.', 'YesNo'),
570
('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 809-820 OPAC: Link Here
809
              type: modalselect
809
              type: modalselect
810
              source: borrowers
810
              source: borrowers
811
              exclusions: sort1|sort2|gonenoaddress|lost|flags
811
              exclusions: sort1|sort2|gonenoaddress|lost|flags
812
        -
813
            - "Display the following additional instructions for patrons who self register via the OPAC ( HTML is allowed ):"
814
            - pref: PatronSelfRegistrationAdditionalInstructions
815
              type: textarea
816
              syntax: text/html
817
              class: html
818
        -
812
        -
819
            - pref: PatronSelfRegistrationEmailMustBeUnique
813
            - pref: PatronSelfRegistrationEmailMustBeUnique
820
              choices:
814
              choices:
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt (-1 / +1 lines)
Lines 494-500 Link Here
494
            [% END %]
494
            [% END %]
495
        [% END %]
495
        [% END %]
496
    [% ELSE %]
496
    [% ELSE %]
497
        [% SET available_options = [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'OpacLibraryInfo', 'CatalogConcernHelp', 'CatalogConcernTemplate', 'CookieConsentBar', 'CookieConsentPopup' ] %]
497
        [% SET available_options = [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'OpacLibraryInfo', 'CatalogConcernHelp', 'CatalogConcernTemplate', 'CookieConsentBar', 'CookieConsentPopup', 'PatronSelfRegistrationAdditionalInstructions' ] %]
498
        [% FOREACH l IN available_options.sort %]
498
        [% FOREACH l IN available_options.sort %]
499
            [% IF l == location %]
499
            [% IF l == location %]
500
                <option value="[% l | html %]" selected="selected">[% l | html %]</option>
500
                <option value="[% l | html %]" selected="selected">[% l | html %]</option>
(-)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