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

(-)a/Koha/AdditionalContents.pm (+2 lines)
Lines 63-68 location is one of this: Link Here
63
- OpacLoginInstructions
63
- OpacLoginInstructions
64
- OpacSuggestionInstructions
64
- OpacSuggestionInstructions
65
- ArticleRequestsDisclaimerText
65
- ArticleRequestsDisclaimerText
66
- CookieConsentBar
67
- CookieConsentPopup
66
68
67
=cut
69
=cut
68
70
(-)a/installer/data/mysql/atomicupdate/bug_27378-add_cookie_consents.pl (-6 lines)
Lines 12-22 return { Link Here
12
12
13
        $dbh->do( q| INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type) VALUES ('CookieConsent', '0', 'Require cookie consent to be displayed', '', 'YesNo'); | );
13
        $dbh->do( q| INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type) VALUES ('CookieConsent', '0', 'Require cookie consent to be displayed', '', 'YesNo'); | );
14
        say $out "Added new system preference 'CookieConsent'";
14
        say $out "Added new system preference 'CookieConsent'";
15
16
        $dbh->do( q{ INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type) VALUES ('CookieConsentBar', '', 'Show the following HTML in the cookie consent bar that is displayed at the bottom of the screen', '70|10', 'Textarea'); } );
17
        say $out "Added new system preference 'CookieConsentBar'";
18
19
        $dbh->do( q{INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type) VALUES ('CookieConsentPopup', '', 'Show the following HTML in the cookie consent popup', '70|10', 'Textarea');} );
20
        say $out "Added new system preference 'CookieConsentPopup'";
21
    },
15
    },
22
};
16
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (-2 lines)
Lines 160-167 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
160
('ConsiderOnSiteCheckoutsAsNormalCheckouts','1',NULL,'Consider on-site checkouts as normal checkouts','YesNo'),
160
('ConsiderOnSiteCheckoutsAsNormalCheckouts','1',NULL,'Consider on-site checkouts as normal checkouts','YesNo'),
161
('ContentWarningField', '', NULL, 'MARC field to use for content warnings', 'Free'),
161
('ContentWarningField', '', NULL, 'MARC field to use for content warnings', 'Free'),
162
('CookieConsent', '0', NULL, 'Require cookie consent to be displayed', 'YesNo'),
162
('CookieConsent', '0', NULL, 'Require cookie consent to be displayed', 'YesNo'),
163
('CookieConsentBar', '', '70|10', 'Show the following HTML in the cookie consent bar that is displayed at the bottom of the screen', 'Textarea'),
164
('CookieConsentPopup', '', '70|10', 'Show the following HTML in the cookie consent popup', 'Textarea'),
165
('CreateAVFromCataloguing', '1', '', 'Ability to create authorized values from the cataloguing module', 'YesNo'),
163
('CreateAVFromCataloguing', '1', '', 'Ability to create authorized values from the cataloguing module', 'YesNo'),
166
('CronjobLog','0',NULL,'If ON, log information from cron jobs.','YesNo'),
164
('CronjobLog','0',NULL,'If ON, log information from cron jobs.','YesNo'),
167
('CumulativeRestrictionPeriods',0,NULL,'Cumulate the restriction periods instead of keeping the highest','YesNo'),
165
('CumulativeRestrictionPeriods',0,NULL,'Cumulate the restriction periods instead of keeping the highest','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc (-3 / +14 lines)
Lines 2-8 Link Here
2
[% USE Koha %]
2
[% USE Koha %]
3
[% USE KohaPlugins %]
3
[% USE KohaPlugins %]
4
[% USE Asset %]
4
[% USE Asset %]
5
[% USE AdditionalContents %]
5
[% IF Koha.Preference( 'CookieConsent' ) %]
6
[% IF Koha.Preference( 'CookieConsent' ) %]
7
    [% SET CookieConsentBar = AdditionalContents.get( location => "CookieConsentBar", lang => lang, library => branchcode || default_branch ) %]
8
    [% SET CookieConsentPopup = AdditionalContents.get( location => "CookieConsentPopup", lang => lang, library => branchcode || default_branch ) %]
6
    [% USE JSConsents %]
9
    [% USE JSConsents %]
7
[% END %]
10
[% END %]
8
        </div>
11
        </div>
Lines 82-88 Link Here
82
    [% IF Koha.Preference( 'CookieConsent' ) %]
85
    [% IF Koha.Preference( 'CookieConsent' ) %]
83
        <!-- Cookie consent bar -->
86
        <!-- Cookie consent bar -->
84
        <div id="cookieConsentBar" aria-hidden="true">
87
        <div id="cookieConsentBar" aria-hidden="true">
85
            [% Koha.Preference( 'CookieConsentBar' ) | $raw %]
88
            [% IF ( CookieConsentBar && CookieConsentBar.content && CookieConsentBar.content.count >0 ) %]
89
                <div id="cookieConsentBarText">
90
                    [%- FOREACH item IN CookieConsentBar.content -%]
91
                        [%- item.content | $raw -%]
92
                    [%- END -%]
93
                </div>
94
            [% END %]
86
            <div id="consentButtons">
95
            <div id="consentButtons">
87
                <button type="button" class="btn btn-primary consentAcceptAll">Accept all cookies</button>
96
                <button type="button" class="btn btn-primary consentAcceptAll">Accept all cookies</button>
88
                [% IF ( Koha.Preference( 'CookieConsentedJS' ).length > 0 ) %]
97
                [% IF ( Koha.Preference( 'CookieConsentedJS' ).length > 0 ) %]
Lines 99-107 Link Here
99
                        <h2 class="modal-title" id="cookieConsentModalLabel">Cookie consent</h2>
108
                        <h2 class="modal-title" id="cookieConsentModalLabel">Cookie consent</h2>
100
                    </div>
109
                    </div>
101
                    <div class="modal-body">
110
                    <div class="modal-body">
102
                        [% IF Koha.Preference( 'CookieConsentPopup' ) %]
111
                        [% IF ( CookieConsentPopup && CookieConsentPopup.content && CookieConsentPopup.content.count >0 ) %]
103
                            <div id="cookieConsentPopupText">
112
                            <div id="cookieConsentPopupText">
104
                                [% Koha.Preference( 'CookieConsentPopup' ) | $raw %]
113
                                [%- FOREACH item IN CookieConsentPopup.content -%]
114
                                    [%- item.content | $raw -%]
115
                                [%- END -%]
105
                            </div>
116
                            </div>
106
                        [% END %]
117
                        [% END %]
107
                        <div id="consentCookieList">
118
                        <div id="consentCookieList">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref (-12 lines)
Lines 400-417 Patrons: Link Here
400
           type: modaljs
400
           type: modaljs
401
           initiator: populateCookieConsentedJS
401
           initiator: populateCookieConsentedJS
402
           processor: prepareCookieConsentedJS
402
           processor: prepareCookieConsentedJS
403
     -
404
         - Show the following HTML in the cookie consent bar that is displayed at the bottom of the screen
405
         - pref: CookieConsentBar
406
           type: textarea
407
           syntax: text/html
408
           class: code
409
     -
410
         - Show the following HTML in the cookie consent popup
411
         - pref: CookieConsentPopup
412
           type: textarea
413
           syntax: text/html
414
           class: code
415
    Security:
403
    Security:
416
     -
404
     -
417
         - Login passwords for staff and patrons must be at least
405
         - Login passwords for staff and patrons must be at least
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt (-1 / +1 lines)
Lines 492-498 Link Here
492
            [% END %]
492
            [% END %]
493
        [% END %]
493
        [% END %]
494
    [% ELSE %]
494
    [% ELSE %]
495
        [% SET available_options = [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'OpacLibraryInfo', 'CatalogConcernHelp', 'CatalogConcernTemplate' ] %]
495
        [% SET available_options = [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'OpacLibraryInfo', 'CatalogConcernHelp', 'CatalogConcernTemplate', 'CookieConsentBar', 'CookieConsentPopup' ] %]
496
        [% FOREACH l IN available_options.sort %]
496
        [% FOREACH l IN available_options.sort %]
497
            [% IF l == location %]
497
            [% IF l == location %]
498
                <option value="[% l | html %]" selected="selected">[% l | html %]</option>
498
                <option value="[% l | html %]" selected="selected">[% l | html %]</option>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc (-13 / +16 lines)
Lines 13-18 Link Here
13
[% SET OpacCustomSearch = AdditionalContents.get( location => "OpacCustomSearch", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
13
[% SET OpacCustomSearch = AdditionalContents.get( location => "OpacCustomSearch", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
14
[% SET OpacLoginInstructions = AdditionalContents.get( location => "OpacLoginInstructions", lang => lang, library => branchcode || default_branch ) %]
14
[% SET OpacLoginInstructions = AdditionalContents.get( location => "OpacLoginInstructions", lang => lang, library => branchcode || default_branch ) %]
15
[% SET OpacMoreSearches = AdditionalContents.get( location => "OpacMoreSearches", lang => lang, library => branchcode || default_branch ) %]
15
[% SET OpacMoreSearches = AdditionalContents.get( location => "OpacMoreSearches", lang => lang, library => branchcode || default_branch ) %]
16
[% SET CookieConsentBar = AdditionalContents.get( location => "CookieConsentBar", lang => lang, library => branchcode || default_branch ) %]
17
[% SET CookieConsentPopup = AdditionalContents.get( location => "CookieConsentPopup", lang => lang, library => branchcode || default_branch ) %]
16
18
17
<button id="scrolltocontent">Skip to main content</button>
19
<button id="scrolltocontent">Skip to main content</button>
18
<div id="wrapper">
20
<div id="wrapper">
Lines 446-462 Link Here
446
        </div> <!-- /.modal-dialog -->
448
        </div> <!-- /.modal-dialog -->
447
    </div>  <!-- /#modalAuth  -->
449
    </div>  <!-- /#modalAuth  -->
448
    [% IF Koha.Preference( 'CookieConsent' ) %]
450
    [% IF Koha.Preference( 'CookieConsent' ) %]
449
        <!-- Cookie consent bar -->
451
            <!-- Cookie consent bar -->
450
        <div id="cookieConsentBar" aria-hidden="true">
452
            <div id="cookieConsentBar" aria-hidden="true">
451
            [% Koha.Preference( 'CookieConsentBar' ) | $raw %]
453
                [% IF ( CookieConsentBar ) %]
452
            <div id="consentButtons">
454
                    [% PROCESS koha_news_block news => CookieConsentBar %]
453
                <button type="button" class="btn btn-primary consentAcceptAll">Accept all cookies</button>
454
                [% IF ( Koha.Preference( 'CookieConsentedJS' ).length > 0 ) %]
455
                    <button type="button" class="btn btn-primary consentAcceptEssential">Accept only essential cookies</button>
456
                    <button type="button" class="btn btn-info" id="consentMoreInfo" aria-label="Click to view more information about your cookie consents">More information</button>
457
                [% END %]
455
                [% END %]
458
            </div>
456
                <div id="consentButtons">
459
        </div> <!-- /#cookieConsentBar -->
457
                    <button type="button" class="btn btn-primary consentAcceptAll">Accept all cookies</button>
458
                    [% IF ( Koha.Preference( 'CookieConsentedJS' ).length > 0 ) %]
459
                        <button type="button" class="btn btn-primary consentAcceptEssential">Accept only essential cookies</button>
460
                        <button type="button" class="btn btn-info" id="consentMoreInfo" aria-label="Click to view more information about your cookie consents">More information</button>
461
                    [% END %]
462
                </div>
463
            </div> <!-- /#cookieConsentBar -->
460
        <!-- Cookie consent modal -->
464
        <!-- Cookie consent modal -->
461
        <div id="cookieConsentModal" class="modal" tabindex="-1" role="dialog" aria-labelledby="cookieConsentModalLabel" aria-hidden="true">
465
        <div id="cookieConsentModal" class="modal" tabindex="-1" role="dialog" aria-labelledby="cookieConsentModalLabel" aria-hidden="true">
462
            <div class="modal-dialog">
466
            <div class="modal-dialog">
Lines 465-473 Link Here
465
                        <h2 class="modal-title" id="cookieConsentModalLabel">Cookie consent</h2>
469
                        <h2 class="modal-title" id="cookieConsentModalLabel">Cookie consent</h2>
466
                    </div>
470
                    </div>
467
                    <div class="modal-body">
471
                    <div class="modal-body">
468
                        [% IF Koha.Preference( 'CookieConsentPopup' ) %]
472
                        [% IF ( CookieConsentPopup ) %]
469
                            <div id="cookieConsentPopupText">
473
                            <div id="cookieConsentPopupText">
470
                                [% Koha.Preference( 'CookieConsentPopup' ) | $raw %]
474
                                [% PROCESS koha_news_block news => CookieConsentPopup %]
471
                            </div>
475
                            </div>
472
                        [% END %]
476
                        [% END %]
473
                        <div id="consentCookieList">
477
                        <div id="consentCookieList">
474
- 

Return to bug 27378