Bug 24223: Convert OpacNav system preference to additional content
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-patron-consent.tt
1 [% USE Koha %]
2 [% USE AdditionalContents %]
3 [% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode, blocktitle => 0 ) %]
4 [% SET consentview = 1 %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Your consents &rsaquo; [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 [% BLOCK cssinclude %][% END %]
9 </head>
10 [% INCLUDE 'bodytag.inc' bodyid='opac-patron-consent' %]
11 [% INCLUDE 'masthead.inc' %]
12
13 <div class="main">
14     <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumbs">
15         <ol class="breadcrumb">
16             <li class="breadcrumb-item">
17                 <a href="/cgi-bin/koha/opac-main.pl">Home</a>
18             </li>
19             <li class="breadcrumb-item">
20                 <a href="/cgi-bin/koha/opac-user.pl">[% patron.firstname | html %] [% patron.surname | html %]</a>
21             </li>
22             <li class="breadcrumb-item active">
23                 <a href="#" aria-current="page">Your consents</a>
24             </li>
25         </ol>
26     </nav> <!-- /#breadcrumbs -->
27
28     <div class="container-fluid">
29         <div class="row">
30             <div class="col-lg-2">
31                 <div id="navigation">
32                     [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
33                 </div>
34             </div>
35             <div class="col-lg-10 order-first order-md-first order-lg-2">
36                 <div id="patronconsents" class="maincontent">
37
38                     [% IF Koha.Preference('GDPR_Policy') %]
39                     <div class="alert alert-warning">
40                             <p>In order to keep you logged in, we need your consent to process personal data as specified in the EU General Data Protection Regulation of May 25, 2018.</p>
41                             <p>Please save your consent below or log out. Thank you!</p>
42                     </div>
43                     [% END %]
44
45                     <h1>Your consents</h1>
46
47                     <form action="/cgi-bin/koha/opac-patron-consent.pl" method="post">
48                         [% IF Koha.Preference('GDPR_Policy') %]
49                         <legend><h2 id="GDPR_consents">GDPR consents</h2></legend>
50                             <input type="hidden" name="op" value="gdpr_proc_save"/>
51                             <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]"/>
52                             <fieldset>
53                                 <ul><li>
54                                     <p>I have read the <a target="_blank" href="[% Koha.Preference('PrivacyPolicyURL') | url %]">privacy policy</a> and agree with your processing of my personal data as outlined therein.</p>
55                                     <p><input type="radio" name="gdpr_processing" value="agreed"> Yes, I agree.<br>
56                                     <input type="radio" name="gdpr_processing" value="disagreed"> No, I do not agree. Please remove my account within a reasonable time.</p>
57                                     [% IF gdpr_proc_consent %]
58                                         <p>Your consent was registered on [% gdpr_proc_consent | html %].</p>
59                                     [% ELSIF gdpr_proc_refusal %]
60                                         <p>You indicated recently that you do not consent, and we will process your request soon.</p>
61                                     [% END %]
62                                 </li></ul>
63                             </fieldset>
64                             <fieldset class="action">
65                                 <input id="saveconsent" type="submit" value="Save" class="btn btn-primary" />
66                             </fieldset>
67                         [% END %]
68
69                     </form>
70
71                 </div> <!-- / #userpasswd -->
72             </div> <!-- / .col-lg-10 -->
73         </div> <!-- / .row -->
74     </div> <!-- / .container-fluid -->
75 </div> <!-- / .main -->
76
77 [% INCLUDE 'opac-bottom.inc' %]
78 [% BLOCK jsinclude %]
79     <script>
80         var consent = null;
81         $(document).ready(function() {
82             [% IF gdpr_proc_consent %]
83                 consent=1;
84                 $("input[type='radio'][value='agreed']").prop('checked',true);
85                 $(".alert").hide();
86             [% ELSIF gdpr_proc_refusal %]
87                 consent=0;
88                 $("input[type='radio'][value='disagreed']").prop('checked',true);
89             [% ELSE %]
90             [% END %]
91             $("#saveconsent").prop('disabled', true);
92
93             $("input[type='radio']").click(function() {
94                 var radio = $(this).val();
95                 if(radio=='agreed' && (consent==null || consent==0)) $("#saveconsent").prop('disabled', false);
96                 if(radio=='disagreed' && (consent==null || consent==1)) $("#saveconsent").prop('disabled', false);
97                 if(radio=='agreed') $(".alert").hide();
98                 if(radio=='disagreed') $(".alert").show();
99             });
100
101         });
102     </script>
103 [% END %]