Bug 39567: Remove form-submit includes from tt files

Now that the form-submit code has been added to the global js-includes
files for both the staff interface and OPAC, it no longer needs to be
included directly in each template file.

To test:
1. Apply patch
2. Clear browser cache
3. git grep "form-submit.js"
--> Confirm that all imports of the form-submit.js asset have been
    removed, and the only results are the comment in global.js and
    staff-global.js

4. Test OPAC > Account page > Renew a checkout to confirm the link
    submission still works as expected in the OPAC
    i. Check out an item to a patron
    ii. Set a known password for that patron
    iii. Log into that patron's account in the OPAC
    iv. Click the "Renew" link next to that checkout in the checkouts
        table on the patron's OPAC account page
    --> Confirm the item is renewed as expected

5. Test some of the following buttons to confirm the link submission
   still works as expected in the staff interface:
    - Bib record > Holds > Revert transit/waiting status on a hold
    - Acquisitions > Basket > Create EDIFACT order
    - Acquisitions > Invoices > detail for a specific invoice > Delete
    - Acquisitions > Invoices > perform actions on invoices using the
                                action drop-down
    - Acquisitions > Invoices > open/close invoices by selecting the
                                checkboxes
    - Administration > Additional fields > Delete an additional field
    - Administration > Background jobs > Cancel a background job
    - Edit an item > scroll up > Actions drop-down > Print label
    - Cataloging > Label creator > Manage label batches > Edit a batch
        > Delete batch
    - Cataloging > Label creator > Manage label batches > Delete a batch
    - Patron account > holds > delete a hold
    - Tools > Patron lists > delete a list from the Actions drop-down
    - Reports > Saved reports > Preview SQL on a report > Delete
    - Reports > Saved reports > Delete a report from the actions drop-down
    - Rotating collections > Delete a collection from the actions drop-down
    - Stock rotations > move item to the next stage
    - Stock rotations > remove item from a rota
    - Stock rotations > Add/remove "In demand"
    - More > Lists > edit a specific list > Edit drop-down > Delete

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Emily Lamancusa 2025-04-04 13:25:43 -04:00 committed by Katrin Fischer
parent 984cf190a7
commit 3478e09d41
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
20 changed files with 1 additions and 22 deletions

View File

@ -2,9 +2,6 @@
[% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
[% USE AuthorisedValues %]
[%#This include depends on the asset js/form-submit.js. Any template making use of this include must import form-submit.js as well. %]
[%#FIXME can form-submit.js be imported into this file directly? %]
<table id="patron_holds_table" class="holds_table">
<thead>
<tr>

View File

@ -1100,7 +1100,6 @@
[% MACRO jsinclude BLOCK %]
[% Asset.js("js/acquisitions-menu.js") | $raw %]
[% Asset.js("js/form-submit.js") | $raw %]
[% INCLUDE 'datatables.inc' %]
[% Asset.js("js/acq.js") | $raw %]
[% INCLUDE 'calendar.inc' %]

View File

@ -540,7 +540,6 @@
[% MACRO jsinclude BLOCK %]
[% Asset.js("js/acquisitions-menu.js") | $raw %]
[% Asset.js("js/form-submit.js") | $raw %]
[% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
[% Asset.js("js/acq.js") | $raw %]
[% Asset.js("js/additional-fields-entry.js") | $raw %]

View File

@ -474,7 +474,6 @@
[% MACRO jsinclude BLOCK %]
[% Asset.js("js/acquisitions-menu.js") | $raw %]
[% Asset.js("js/form-submit.js") | $raw %]
[% INCLUDE 'datatables.inc' %]
[% INCLUDE 'calendar.inc' %]
[% INCLUDE 'select2.inc' %]

View File

@ -306,7 +306,6 @@
[% MACRO jsinclude BLOCK %]
[% INCLUDE "datatables.inc" %]
[% Asset.js("js/form-submit.js") | $raw %]
<script>
$(document).ready(function () {
$("#selecttable").find(":submit").hide();

View File

@ -142,7 +142,6 @@
[% MACRO jsinclude BLOCK %]
[% Asset.js("js/admin-menu.js") | $raw %]
[% Asset.js("js/form-submit.js") | $raw %]
[% INCLUDE 'js-date-format.inc' %]
[% INCLUDE 'datatables.inc' %]
<script>

View File

@ -154,7 +154,6 @@
[% MACRO jsinclude BLOCK %]
[% Asset.js("js/admin-menu.js") | $raw %]
[% Asset.js("js/form-submit.js") | $raw %]
[% INCLUDE 'datatables.inc' %]
[% END %]

View File

@ -36,7 +36,6 @@
[% INCLUDE 'calendar.inc' %]
[% INCLUDE 'str/cataloging_additem.inc' %]
[% Asset.js("js/cataloging_additem.js") | $raw %]
[% Asset.js("js/form-submit.js") | $raw %]
<script>
var has_item_groups = "[% item_groups.size | html %]";
</script>

View File

@ -1242,7 +1242,6 @@
[% Asset.js("js/checkouts.js") | $raw %]
[% Asset.js("js/tables/bookings.js") | $raw %]
[% Asset.js("js/recalls.js") | $raw %]
[% Asset.js("js/form-submit.js") | $raw %]
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]

View File

@ -231,7 +231,6 @@
[% MACRO jsinclude BLOCK %]
[% INCLUDE 'greybox.inc' %]
[% INCLUDE 'datatables.inc' %]
[% Asset.js("js/form-submit.js") | $raw %]
[% Asset.js("js/labels-menu.js") | $raw %]
<script>
function dofocus() { // named function req'd for body onload event by some FF and IE7 security models

View File

@ -158,7 +158,6 @@
[% MACRO jsinclude BLOCK %]
[% INCLUDE 'greybox.inc' %]
[% INCLUDE 'datatables.inc' %]
[% Asset.js("js/form-submit.js") | $raw %]
<script>
function Xport() {
batches= new Array;

View File

@ -792,7 +792,6 @@
[% INCLUDE 'str/members-menu.inc' %]
[% Asset.js("js/members-menu.js") | $raw %]
[% Asset.js("js/recalls.js") | $raw %]
[% Asset.js("js/form-submit.js") | $raw %]
<script>
const LoadCheckoutsTableDelay = 0;
const AlwaysLoadCheckoutsTable = [% Koha.Preference('AlwaysLoadCheckoutsTable') | html %];

View File

@ -162,7 +162,6 @@
[% MACRO jsinclude BLOCK %]
[% Asset.js("js/tools-menu.js") | $raw %]
[% Asset.js("js/form-submit.js") | $raw %]
[% INCLUDE 'datatables.inc' %]
<script>
$(document).ready(function() {

View File

@ -1713,7 +1713,6 @@
[% Asset.js( "lib/codemirror/highlight.js" ) | $raw %]
[% Asset.css("lib/codemirror/highlight.css") | $raw %]
[% Asset.js( "js/mana.js" ) | $raw %]
[% Asset.js("js/form-submit.js") | $raw %]
[% INCLUDE 'select2.inc' %]
<script>
// if the report param form has multiselects override default form submission

View File

@ -1425,7 +1425,6 @@
[% INCLUDE 'calendar.inc' %]
[% INCLUDE 'select2.inc' %]
[% Asset.js("js/holds.js") | $raw %]
[% Asset.js("js/form-submit.js") | $raw %]
[% SET url_biblio_params = "biblionumber=" _ biblionumbers.join("&amp;biblionumber=") %]
[% IF multi_hold %]

View File

@ -98,7 +98,6 @@
[% INCLUDE 'datatables.inc' %]
[% Asset.js("js/tools-menu.js") | $raw %]
[% Asset.js("js/rotating-collections.js") | $raw %]
[% Asset.js("js/form-submit.js") | $raw %]
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]

View File

@ -719,7 +719,6 @@
[% INCLUDE 'datatables.inc' %]
[% Asset.js( "lib/sortable/Sortable.min.js" ) | $raw %]
[% Asset.js("js/pages/stockrotation.js") | $raw %]
[% Asset.js("js/form-submit.js") | $raw %]
<script>
var stock_rotation_items_table_settings = [% TablesSettings.GetTableSettings( 'tools', 'stockrotation', 'stock_rotation_manage_items', 'json' ) | $raw %];
var stock_rotation_table_settings = [% TablesSettings.GetTableSettings( 'tools', 'stockrotation', 'stock_rotation', 'json' ) | $raw %];

View File

@ -632,7 +632,6 @@
[% MACRO jsinclude BLOCK %]
[% INCLUDE 'datatables.inc' %]
[% Asset.js("js/form-submit.js") | $raw %]
[% IF print %]
<script>
$(document).ready(function () {

View File

@ -103,7 +103,7 @@
</script>
[% Asset.js("js/global.js") | $raw %]
<script type="module">
import { submit_form } from "/bootstrap/js/form-submit.js";
import { submit_form } from "/opac-tmpl/bootstrap/js/form-submit.js";
$("body").on("click", ".submit-form-link", function (e) {
e.preventDefault();
submit_form(this);

View File

@ -1076,7 +1076,6 @@
[% INCLUDE 'opac-bottom.inc' %]
[% BLOCK jsinclude %]
[% Asset.js("js/form-submit.js") | $raw %]
[% INCLUDE 'calendar.inc' %]
[% INCLUDE 'datatables.inc' %]
<script>