Bug 42293: Tidy all script tags - serials
In order to tidy all the script tags of the .tt files we isolate the interpolation of Template::Toolkit variables in a separate script tag. This patch focuses on the serials module. The 3 main changes are in the following files: * routing.tt * serials-search.tt * subscription-detail.tt Changes are trivial. Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Jan Kissig <bibliothek@th-wildau.de> Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
parent
8d9d749c53
commit
2ecbac6060
|
|
@ -217,7 +217,7 @@
|
|||
[% MACRO jsinclude BLOCK %]
|
||||
[% INCLUDE 'calendar.inc' %]
|
||||
[% INCLUDE 'datatables.inc' %]
|
||||
<script nonce="[% Koha.CSPNonce | $raw %]">
|
||||
<script nonce="[% Koha.CSPNonce | $raw %]" data-tt-allowed="true">
|
||||
var table_settings = [% TablesSettings.GetTableSettings( "serials", "claims", "claimst", "json" ) | $raw %];
|
||||
const vendor_id = "[% supplierid | html %]";
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -135,6 +135,9 @@
|
|||
[% END %]
|
||||
|
||||
[% MACRO jsinclude BLOCK %]
|
||||
<script nonce="[% Koha.CSPNonce | $raw %]" data-tt-allowed="true">
|
||||
var subscriptionid = [% subscriptionid || 0 | html %];
|
||||
</script>
|
||||
<script nonce="[% Koha.CSPNonce | $raw %]">
|
||||
$(document).ready(function () {
|
||||
$(".itemrank").on("change", function () {
|
||||
|
|
@ -184,7 +187,7 @@
|
|||
}
|
||||
$.ajax({
|
||||
data: {
|
||||
subscriptionid: [% subscriptionid | html %],
|
||||
subscriptionid,
|
||||
borrowernumbers,
|
||||
op: 'cud-add_new_recipients',
|
||||
csrf_token: $('meta[name="csrf-token"]').attr('content'),
|
||||
|
|
@ -192,7 +195,7 @@
|
|||
type: 'POST',
|
||||
url: '/cgi-bin/koha/serials/routing.pl',
|
||||
success: function (data) {
|
||||
document.location.href = '/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscriptionid | uri %]';
|
||||
document.location.href = `/cgi-bin/koha/serials/routing.pl?subscriptionid=${subscriptionid}`;
|
||||
return false;
|
||||
},
|
||||
error: function (data) {
|
||||
|
|
|
|||
|
|
@ -341,8 +341,9 @@
|
|||
|
||||
[% MACRO jsinclude BLOCK %]
|
||||
[% INCLUDE 'datatables.inc' %]
|
||||
<script nonce="[% Koha.CSPNonce | $raw %]">
|
||||
<script nonce="[% Koha.CSPNonce | $raw %]" data-tt-allowed="true">
|
||||
var subscriptionid = "[% subscriptionid | html %]";
|
||||
var subscriptionidlist = "[% subscriptionidlist | html %]";
|
||||
</script>
|
||||
[% Asset.js("js/serials-toolbar.js") | $raw %]
|
||||
<script nonce="[% Koha.CSPNonce | $raw %]">
|
||||
|
|
@ -420,7 +421,7 @@
|
|||
$(document).ready(function() {
|
||||
$(".delete-issues").on("click", function(e){
|
||||
e.preventDefault();
|
||||
deleteIssues("[% subscriptionidlist | html %]");
|
||||
deleteIssues(subscriptionidlist);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
[% Asset.js("js/cataloging.js") | $raw %]
|
||||
[% INCLUDE 'calendar.inc' %]
|
||||
<script nonce="[% Koha.CSPNonce | $raw %]">
|
||||
//<![CDATA[
|
||||
$(document).ready(function () {
|
||||
$("#multi_receiving").on("show", function () {
|
||||
$(this).find(".modal-body").html($(".serials_multi_receiving")[0].outerHTML);
|
||||
|
|
@ -88,7 +87,6 @@
|
|||
}
|
||||
});
|
||||
});
|
||||
//]]>
|
||||
</script>
|
||||
<style nonce="[% Koha.CSPNonce | $raw %]">
|
||||
#serials_edit fieldset.rows label,
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@
|
|||
[% MACRO jsinclude BLOCK %]
|
||||
[% INCLUDE 'calendar.inc' %]
|
||||
[% Asset.js("js/serials-toolbar.js") | $raw %]
|
||||
<script nonce="[% Koha.CSPNonce | $raw %]">
|
||||
<script nonce="[% Koha.CSPNonce | $raw %]" data-tt-allowed="true">
|
||||
var subscriptionid = "[% subscriptionid | html %]";
|
||||
</script>
|
||||
[% END %]
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
[% USE raw %]
|
||||
[% USE To %]
|
||||
[% USE Asset %]
|
||||
[% USE AuthorisedValues %]
|
||||
[% USE Branches %]
|
||||
|
|
@ -281,9 +282,13 @@
|
|||
[% MACRO jsinclude BLOCK %]
|
||||
[% INCLUDE 'calendar.inc' %]
|
||||
[% INCLUDE 'datatables.inc' %]
|
||||
<script nonce="[% Koha.CSPNonce | $raw %]">
|
||||
<script nonce="[% Koha.CSPNonce | $raw %]" data-tt-allowed="true">
|
||||
var subscriptionid = "[% subscriptionid | html %]";
|
||||
const edit_action_link = "[% edit_action_link | html %]";
|
||||
|
||||
[% IF mana %]
|
||||
const additional_fields_for_subscription = [% To.json(additional_fields_for_subscription) | $raw %];
|
||||
[% END %]
|
||||
</script>
|
||||
[% Asset.js("js/serials-toolbar.js") | $raw %]
|
||||
<script nonce="[% Koha.CSPNonce | $raw %]">
|
||||
|
|
@ -367,9 +372,9 @@
|
|||
<script nonce="[% Koha.CSPNonce | $raw %]">
|
||||
$(document).ready(function() {
|
||||
$(".local").hide();
|
||||
[% FOR field IN additional_fields_for_subscription %]
|
||||
$("label[for=additional_field_[% field.id | $raw %]], input#additional_field_[% field.id | $raw %]").hide();
|
||||
[% END %]
|
||||
additional_fields_for_subscription.forEach(f => {
|
||||
$(`label[for=additional_field_${f.id}], input#additional_field_${f.id}`).hide();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
[% END %]
|
||||
|
|
|
|||
|
|
@ -596,7 +596,7 @@
|
|||
[% INCLUDE 'calendar.inc' %]
|
||||
[% INCLUDE 'datatables.inc' %]
|
||||
[% Asset.js("js/mana.js") | $raw %]
|
||||
<script nonce="[% Koha.CSPNonce | $raw %]">
|
||||
<script nonce="[% Koha.CSPNonce | $raw %]" data-tt-allowed="true">
|
||||
var subscriptionid = "[% subscriptionid | html %]";
|
||||
var irregularity = "[% irregularity | html %]";
|
||||
var more_than_one_serial = "[% more_than_one_serial | html %]";
|
||||
|
|
|
|||
|
|
@ -447,18 +447,17 @@
|
|||
[% END %]
|
||||
|
||||
[% MACRO jsinclude BLOCK %]
|
||||
<script nonce="[% Koha.CSPNonce | $raw %]">
|
||||
<script nonce="[% Koha.CSPNonce | $raw %]" data-tt-allowed="true">
|
||||
var subscriptionid = "[% subscriptionid | html %]";
|
||||
|
||||
var table_settings = [% TablesSettings.GetTableSettings( 'serials', 'subscription-detail', 'orders', 'json' ) | $raw %];
|
||||
const has_orders = [% orders_grouped.size ? 1 : 0 | html %];
|
||||
const print_routing_list_issue = "[% print_routing_list_issue | uri %]";
|
||||
</script>
|
||||
[% Asset.js("js/serials-toolbar.js") | $raw %]
|
||||
[% Asset.js("js/mana.js") | $raw %]
|
||||
[% INCLUDE 'datatables.inc' %]
|
||||
[% Asset.js("lib/jquery/plugins/treetable/jquery.treetable.js") | $raw %]
|
||||
<script nonce="[% Koha.CSPNonce | $raw %]">
|
||||
var table_settings = [% TablesSettings.GetTableSettings( 'serials', 'subscription-detail', 'orders', 'json' ) | $raw %];
|
||||
const has_orders = [% orders_grouped.size ? 1 : 0 | html %];
|
||||
const print_routing_list_issue = "[% print_routing_list_issue | uri %]";
|
||||
</script>
|
||||
<script nonce="[% Koha.CSPNonce | $raw %]">
|
||||
// the english words used in display purposes
|
||||
var text = new Array(
|
||||
|
|
|
|||
Loading…
Reference in New Issue