Bug 20819: Add your consents tab to opac-user
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-patron-consent.tt
1 [% USE Koha %]
2 [% SET consentview = 1 %]
3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Your consents</title>
5 [% INCLUDE 'doc-head-close.inc' %]
6 [% BLOCK cssinclude %][% END %]
7 </head>
8 [% INCLUDE 'bodytag.inc' bodyid='opac-patron-consent' %]
9 [% INCLUDE 'masthead.inc' %]
10
11 <div class="main">
12     <ul class="breadcrumb">
13         <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
14         <li><a href="/cgi-bin/koha/opac-user.pl">[% patron.firstname %] [% patron.surname %]</a> <span class="divider">&rsaquo;</span></li>
15         <li><a href="#">Your consents</a></li>
16     </ul>
17
18     <div class="container-fluid">
19         <div class="row-fluid">
20             <div class="span2">
21                 <div id="navigation">
22                     [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
23                 </div>
24             </div>
25             <div class="span10">
26                 <div id="patronconsents">
27
28                     [% IF Koha.Preference('GDPR_Policy') %]
29                     <div class="alert">
30                             <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>
31                             <p>Please save your consent below or log out. Thank you!</p>
32                     </div>
33                     [% END %]
34
35                     <h3>Your consents</h3>
36
37                     <form action="/cgi-bin/koha/opac-patron-consent.pl" method="post">
38                         [% IF Koha.Preference('GDPR_Policy') %]
39                             <h5>GDPR consents</h5>
40                             <input type="hidden" name="op" value="gdpr_proc_save"/>
41                             <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber %]"/>
42                             <fieldset>
43                                 <ul><li>
44                                     <p>I have read the <a target="_blank" href="[% Koha.Preference('PrivacyPolicyURL') %]">privacy policy</a> and agree with your processing of my personal data as outlined therein.</p>
45                                     <p><input type="radio" name="gdpr_processing" value="agreed"> Yes, I agree.<br>
46                                     <input type="radio" name="gdpr_processing" value="disagreed"> No, I do not agree. Please remove my account within a reasonable time.</p>
47                                     [% IF gdpr_proc_consent %]
48                                         <p>Your consent was registered on [% gdpr_proc_consent %].</p>
49                                     [% END %]
50                                 </li></ul>
51                             </fieldset>
52                             <fieldset class="action"><input id="saveconsent" type="submit" value="Save" class="btn" /></fieldset>
53                         [% END %]
54
55                     </form>
56
57                 </div> <!-- / #userpasswd -->
58             </div> <!-- / .span10 -->
59         </div> <!-- / .row-fluid -->
60     </div> <!-- / .container-fluid -->
61 </div> <!-- / .main -->
62
63 [% INCLUDE 'opac-bottom.inc' %]
64 [% BLOCK jsinclude %]
65 <script type="text/javascript">
66     var consent = null;
67     $(document).ready(function() {
68         [% IF gdpr_proc_consent %]
69             consent=1;
70             $("input[type='radio'][value='agreed']").prop('checked',true);
71             $(".alert").hide();
72         [% ELSIF gdpr_proc_refusal %]
73             consent=0;
74             $("input[type='radio'][value='disagreed']").prop('checked',true);
75         [% ELSE %]
76         [% END %]
77         $("#saveconsent").prop('disabled', true);
78
79         $("input[type='radio']").click(function() {
80             var radio = $(this).val();
81             if(radio=='agreed' && (consent==null || consent==0)) $("#saveconsent").prop('disabled', false);
82             if(radio=='disagreed' && (consent==null || consent==1)) $("#saveconsent").prop('disabled', false);
83             if(radio=='agreed') $(".alert").hide();
84             if(radio=='disagreed') $(".alert").show();
85         });
86
87     });
88 </script>
89 [% END %]