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