Bug 23269: (RM follow-up) Add nonce to script tag and POD for _set_default_expirationdate

This commit is contained in:
Martin Renvoize 2026-03-21 20:14:36 +00:00
parent dd47bb82ca
commit 2af497f1eb
No known key found for this signature in database
GPG Key ID: 2D86E0EAEC83711B
2 changed files with 29 additions and 21 deletions

View File

@ -1232,6 +1232,16 @@ sub store {
$self = $self->SUPER::store;
}
=head3 _set_default_expirationdate
$hold->_set_default_expirationdate;
Internal method to set the default expiration date based on
C<DefaultHoldExpirationdatePeriod> and C<DefaultHoldExpirationdateUnitOfTime>
system preferences.
=cut
sub _set_default_expirationdate {
my $self = shift;

View File

@ -1539,7 +1539,7 @@
[% INCLUDE 'datatables.inc' %]
[% INCLUDE 'calendar.inc' %]
[% INCLUDE 'select2.inc' %]
<script>
<script nonce="[% Koha.CSPNonce | $raw %]">
hold_table_settings = [% TablesSettings.GetTableSettings( 'circ', 'holds', 'patron_holds_table', 'json' ) | $raw %];
</script>
[% Asset.js("js/holds.js") | $raw %]
@ -1609,36 +1609,36 @@
$.fn.select2.defaults.set("width", "100%");
$.fn.select2.defaults.set("dropdownAutoWidth", true);
$(document).ready(function() {
biblionumbers.forEach(function(biblionumber) {
$(document).ready(function () {
biblionumbers.forEach(function (biblionumber) {
let branches = hold_branches[biblionumber];
let itemtypes = hold_itemtypes[biblionumber];
switch (HoldsSplitQueue) {
case 'branch':
branches.forEach(function(branch) {
load_patron_holds_table(biblionumber, {name: HoldsSplitQueue, value: branch});
case "branch":
branches.forEach(function (branch) {
load_patron_holds_table(biblionumber, { name: HoldsSplitQueue, value: branch });
});
break;
case 'itemtype':
itemtypes.forEach(function(itemtype) {
load_patron_holds_table(biblionumber, {name: HoldsSplitQueue, value: itemtype});
case "itemtype":
itemtypes.forEach(function (itemtype) {
load_patron_holds_table(biblionumber, { name: HoldsSplitQueue, value: itemtype });
});
break;
case 'branch_itemtype':
branches.forEach(function(branch) {
itemtypes.forEach(function(itemtype) {
load_patron_holds_table(biblionumber, {name: HoldsSplitQueue, value: branch + '_' + itemtype});
case "branch_itemtype":
branches.forEach(function (branch) {
itemtypes.forEach(function (itemtype) {
load_patron_holds_table(biblionumber, { name: HoldsSplitQueue, value: branch + "_" + itemtype });
});
});
break;
default:
load_patron_holds_table(biblionumber, {name: 'any', value: 'any'});
load_patron_holds_table(biblionumber, { name: "any", value: "any" });
}
});
$('#cancellation-reason-div').hide();
$('.rank-request').on('change', function() {
if ( $(".rank-request option:selected[value='del']").length ) {
$('#cancellation-reason-div').show();
$("#cancellation-reason-div").hide();
$(".rank-request").on("change", function () {
if ($(".rank-request option:selected[value='del']").length) {
$("#cancellation-reason-div").show();
} else {
$("#cancellation-reason-div").hide();
}
@ -1995,11 +1995,9 @@
});
}
if(!localStorage.selectedHolds || document.referrer.replace(/\?.*/, '') !== document.location.origin+document.location.pathname) {
if (!localStorage.selectedHolds || document.referrer.replace(/\?.*/, "") !== document.location.origin + document.location.pathname) {
localStorage.selectedHolds = [];
}
});
</script>
<script nonce="[% Koha.CSPNonce | $raw %]">