Lines 48-72
Link Here
|
48 |
<form action="/cgi-bin/koha/opac-patron-consent.pl" method="post"> |
48 |
<form action="/cgi-bin/koha/opac-patron-consent.pl" method="post"> |
49 |
[% IF Koha.Preference('GDPR_Policy') %] |
49 |
[% IF Koha.Preference('GDPR_Policy') %] |
50 |
<legend><h2 id="GDPR_consents">GDPR consents</h2></legend> |
50 |
<legend><h2 id="GDPR_consents">GDPR consents</h2></legend> |
51 |
<input type="hidden" name="op" value="gdpr_proc_save"/> |
51 |
<input type="hidden" name="op" value="save"/> |
52 |
<input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]"/> |
52 |
<input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]"/> |
53 |
<fieldset> |
53 |
<fieldset> |
54 |
<ul><li> |
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> |
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> |
56 |
<p><input type="radio" name="gdpr_processing" value="1"> 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> |
57 |
<input type="radio" name="gdpr_processing" value="0"> No, I do not agree. Please remove my account within a reasonable time.</p> |
58 |
[% IF gdpr_proc_consent %] |
58 |
[% IF gdpr_proc_consent.given_on %] |
59 |
<p>Your consent was registered on [% gdpr_proc_consent | html %].</p> |
59 |
<p class="consent_info">Your consent was registered on [% gdpr_proc_consent.given_on | html %].</p> |
60 |
[% ELSIF gdpr_proc_refusal %] |
60 |
[% ELSIF gdpr_proc_consent.refused_on %] |
61 |
<p>You indicated recently that you do not consent, and we will process your request soon.</p> |
61 |
<p class="consent_info">You indicated recently that you do not consent, and we will process your request soon.</p> |
62 |
[% END %] |
62 |
[% END %] |
63 |
</li></ul> |
63 |
</li></ul> |
64 |
</fieldset> |
64 |
</fieldset> |
65 |
<fieldset class="action"> |
|
|
66 |
<input id="saveconsent" type="submit" value="Save" class="btn btn-primary" /> |
67 |
</fieldset> |
68 |
[% END %] |
65 |
[% END %] |
69 |
|
66 |
|
|
|
67 |
<fieldset class="action"> |
68 |
<input id="saveconsent" type="submit" value="Save" class="btn btn-primary" /> |
69 |
</fieldset> |
70 |
</form> |
70 |
</form> |
71 |
|
71 |
|
72 |
</div> <!-- / #userpasswd --> |
72 |
</div> <!-- / #userpasswd --> |
Lines 80-102
Link Here
|
80 |
<script> |
80 |
<script> |
81 |
var consent = null; |
81 |
var consent = null; |
82 |
$(document).ready(function() { |
82 |
$(document).ready(function() { |
83 |
[% IF gdpr_proc_consent %] |
83 |
[% IF Koha.Preference('GDPR_Policy') %] |
84 |
consent=1; |
84 |
[% IF gdpr_proc_consent.given_on %] |
85 |
$("input[type='radio'][value='agreed']").prop('checked',true); |
85 |
consent=1; |
86 |
$(".alert").hide(); |
86 |
$("input[type='radio'][value='1']").prop('checked',true); |
87 |
[% ELSIF gdpr_proc_refusal %] |
87 |
$(".alert").hide(); |
88 |
consent=0; |
88 |
[% ELSIF gdpr_proc_consent.refused_on %] |
89 |
$("input[type='radio'][value='disagreed']").prop('checked',true); |
89 |
consent=0; |
90 |
[% ELSE %] |
90 |
$("input[type='radio'][value='0']").prop('checked',true); |
|
|
91 |
[% ELSE %] |
92 |
[% END %] |
91 |
[% END %] |
93 |
[% END %] |
|
|
94 |
// Initially no choice is made or no change, so disable button |
92 |
$("#saveconsent").prop('disabled', true); |
95 |
$("#saveconsent").prop('disabled', true); |
93 |
|
96 |
|
94 |
$("input[type='radio']").click(function() { |
97 |
$("input[type='radio']").click(function() { |
95 |
var radio = $(this).val(); |
98 |
var radio = $(this).val(); |
96 |
if(radio=='agreed' && (consent==null || consent==0)) $("#saveconsent").prop('disabled', false); |
99 |
if( radio=='1' && (consent==null || consent==0) ) { |
97 |
if(radio=='disagreed' && (consent==null || consent==1)) $("#saveconsent").prop('disabled', false); |
100 |
$("#saveconsent").prop('disabled', false); |
98 |
if(radio=='agreed') $(".alert").hide(); |
101 |
$(".consent_info").hide(); |
99 |
if(radio=='disagreed') $(".alert").show(); |
102 |
} else if( radio=='0' && (consent==null || consent==1) ) { |
|
|
103 |
$("#saveconsent").prop('disabled', false); |
104 |
$(".consent_info").hide(); |
105 |
} |
106 |
if( radio=='1' ) $(".alert").hide(); |
107 |
if( radio=='0' ) $(".alert").show(); |
100 |
}); |
108 |
}); |
101 |
|
109 |
|
102 |
}); |
110 |
}); |