Bug 34711: Remove use of onclick for opac-privacy.pl
This change removes the "onclick" attribute for the buttons on opac-privacy.pl. Note: The Javascript is placed in a separate file, which is the preferred way for Javascript to be handled by Content-Security-Policy Test plan: 0. Apply the patch 1. Go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OPACPrivacy 2. Set syspref to "Allow" 3. Go to http://localhost:8080/cgi-bin/koha/opac-privacy.pl 4. The confirmation modal appears and "OK" and "Cancel" buttons work as expected Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
bc8a062001
commit
c997fe863f
2 changed files with 11 additions and 4 deletions
|
@ -175,7 +175,7 @@
|
|||
<td colspan=7>Immediately delete my checkout history. This action cannot be undone.</td>
|
||||
<td colspan=1>
|
||||
<fieldset class="action">
|
||||
<input type="submit" value="Delete checkout history" form="opac-privacy-delete-checkouts" class="btn btn-danger btn-block" onclick="return confirmDelete(MSG_CONFIRM_AGAIN);" />
|
||||
<input type="submit" value="Delete checkout history" form="opac-privacy-delete-checkouts" class="btn btn-danger btn-block privacy-confirm-delete" />
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -183,7 +183,7 @@
|
|||
<td colspan=7>Immediately delete my hold history. This action cannot be undone.</td>
|
||||
<td colspan=1>
|
||||
<fieldset class="action">
|
||||
<input type="submit" value="Delete hold history" form="opac-privacy-delete-holds" class="btn btn-danger btn-block" onclick="return confirmDelete(MSG_CONFIRM_AGAIN);" />
|
||||
<input type="submit" value="Delete hold history" form="opac-privacy-delete-holds" class="btn btn-danger btn-block privacy-confirm-delete" />
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -191,7 +191,7 @@
|
|||
<td colspan=7>Immediately delete my checkout history & my hold history. This action cannot be undone.</td>
|
||||
<td colspan=1>
|
||||
<fieldset class="action">
|
||||
<input type="submit" value="Delete checkout and hold history" form="opac-privacy-delete-all" class="btn btn-danger btn-block" onclick="return confirmDelete(MSG_CONFIRM_AGAIN);" />
|
||||
<input type="submit" value="Delete checkout and hold history" form="opac-privacy-delete-all" class="btn btn-danger btn-block privacy-confirm-delete" />
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -208,4 +208,6 @@
|
|||
</div> <!-- / .main -->
|
||||
|
||||
[% INCLUDE 'opac-bottom.inc' %]
|
||||
[% BLOCK jsinclude %][% END %]
|
||||
[% BLOCK jsinclude %]
|
||||
[% Asset.js('js/privacy.js') | $raw %]
|
||||
[% END %]
|
||||
|
|
5
koha-tmpl/opac-tmpl/bootstrap/js/privacy.js
Normal file
5
koha-tmpl/opac-tmpl/bootstrap/js/privacy.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
$(document).ready(function(){
|
||||
$('.privacy-confirm-delete').on('click',function(){
|
||||
return confirmDelete(MSG_CONFIRM_AGAIN);
|
||||
});
|
||||
});
|
Loading…
Reference in a new issue