View | Details | Raw Unified | Return to bug 39567
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc (-3 lines)
Lines 2-10 Link Here
2
[% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
2
[% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
3
[% USE AuthorisedValues %]
3
[% USE AuthorisedValues %]
4
4
5
[%#This include depends on the asset js/form-submit.js. Any template making use of this include must import form-submit.js as well. %]
6
[%#FIXME can form-submit.js be imported into this file directly? %]
7
8
<table id="patron_holds_table" class="holds_table">
5
<table id="patron_holds_table" class="holds_table">
9
    <thead>
6
    <thead>
10
        <tr>
7
        <tr>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt (-1 lines)
Lines 1093-1099 Link Here
1093
1093
1094
[% MACRO jsinclude BLOCK %]
1094
[% MACRO jsinclude BLOCK %]
1095
    [% Asset.js("js/acquisitions-menu.js") | $raw %]
1095
    [% Asset.js("js/acquisitions-menu.js") | $raw %]
1096
    [% Asset.js("js/form-submit.js") | $raw %]
1097
    [% INCLUDE 'datatables.inc' %]
1096
    [% INCLUDE 'datatables.inc' %]
1098
    [% Asset.js("js/acq.js") | $raw %]
1097
    [% Asset.js("js/acq.js") | $raw %]
1099
    [% INCLUDE 'calendar.inc' %]
1098
    [% INCLUDE 'calendar.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt (-1 lines)
Lines 540-546 Link Here
540
540
541
[% MACRO jsinclude BLOCK %]
541
[% MACRO jsinclude BLOCK %]
542
    [% Asset.js("js/acquisitions-menu.js") | $raw %]
542
    [% Asset.js("js/acquisitions-menu.js") | $raw %]
543
    [% Asset.js("js/form-submit.js") | $raw %]
544
    [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
543
    [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
545
    [% Asset.js("js/acq.js") | $raw %]
544
    [% Asset.js("js/acq.js") | $raw %]
546
    [% Asset.js("js/additional-fields-entry.js") | $raw %]
545
    [% Asset.js("js/additional-fields-entry.js") | $raw %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt (-1 lines)
Lines 474-480 Link Here
474
474
475
[% MACRO jsinclude BLOCK %]
475
[% MACRO jsinclude BLOCK %]
476
    [% Asset.js("js/acquisitions-menu.js") | $raw %]
476
    [% Asset.js("js/acquisitions-menu.js") | $raw %]
477
    [% Asset.js("js/form-submit.js") | $raw %]
478
    [% INCLUDE 'datatables.inc' %]
477
    [% INCLUDE 'datatables.inc' %]
479
    [% INCLUDE 'calendar.inc' %]
478
    [% INCLUDE 'calendar.inc' %]
480
    [% INCLUDE 'select2.inc' %]
479
    [% INCLUDE 'select2.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/additional-fields.tt (-1 lines)
Lines 306-312 Link Here
306
306
307
[% MACRO jsinclude BLOCK %]
307
[% MACRO jsinclude BLOCK %]
308
    [% INCLUDE "datatables.inc" %]
308
    [% INCLUDE "datatables.inc" %]
309
    [% Asset.js("js/form-submit.js") | $raw %]
310
    <script>
309
    <script>
311
        $(document).ready(function () {
310
        $(document).ready(function () {
312
            $("#selecttable").find(":submit").hide();
311
            $("#selecttable").find(":submit").hide();
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/background_jobs.tt (-1 lines)
Lines 142-148 Link Here
142
142
143
[% MACRO jsinclude BLOCK %]
143
[% MACRO jsinclude BLOCK %]
144
    [% Asset.js("js/admin-menu.js") | $raw %]
144
    [% Asset.js("js/admin-menu.js") | $raw %]
145
    [% Asset.js("js/form-submit.js") | $raw %]
146
    [% INCLUDE 'js-date-format.inc' %]
145
    [% INCLUDE 'js-date-format.inc' %]
147
    [% INCLUDE 'datatables.inc' %]
146
    [% INCLUDE 'datatables.inc' %]
148
    <script>
147
    <script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/ill_batch_statuses.tt (-1 lines)
Lines 154-160 Link Here
154
154
155
[% MACRO jsinclude BLOCK %]
155
[% MACRO jsinclude BLOCK %]
156
    [% Asset.js("js/admin-menu.js") | $raw %]
156
    [% Asset.js("js/admin-menu.js") | $raw %]
157
    [% Asset.js("js/form-submit.js") | $raw %]
158
    [% INCLUDE 'datatables.inc' %]
157
    [% INCLUDE 'datatables.inc' %]
159
[% END %]
158
[% END %]
160
159
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt (-1 lines)
Lines 36-42 Link Here
36
[% INCLUDE 'calendar.inc' %]
36
[% INCLUDE 'calendar.inc' %]
37
[% INCLUDE 'str/cataloging_additem.inc' %]
37
[% INCLUDE 'str/cataloging_additem.inc' %]
38
[% Asset.js("js/cataloging_additem.js") | $raw %]
38
[% Asset.js("js/cataloging_additem.js") | $raw %]
39
[% Asset.js("js/form-submit.js") | $raw %]
40
<script>
39
<script>
41
    var has_item_groups = "[% item_groups.size | html %]";
40
    var has_item_groups = "[% item_groups.size | html %]";
42
</script>
41
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-1 lines)
Lines 1228-1234 Link Here
1228
    [% Asset.js("js/checkouts.js") | $raw %]
1228
    [% Asset.js("js/checkouts.js") | $raw %]
1229
    [% Asset.js("js/tables/bookings.js") | $raw %]
1229
    [% Asset.js("js/tables/bookings.js") | $raw %]
1230
    [% Asset.js("js/recalls.js") | $raw %]
1230
    [% Asset.js("js/recalls.js") | $raw %]
1231
    [% Asset.js("js/form-submit.js") | $raw %]
1232
[% END %]
1231
[% END %]
1233
1232
1234
[% INCLUDE 'intranet-bottom.inc' %]
1233
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt (-1 lines)
Lines 230-236 Link Here
230
[% MACRO jsinclude BLOCK %]
230
[% MACRO jsinclude BLOCK %]
231
    [% INCLUDE 'greybox.inc' %]
231
    [% INCLUDE 'greybox.inc' %]
232
    [% INCLUDE 'datatables.inc' %]
232
    [% INCLUDE 'datatables.inc' %]
233
    [% Asset.js("js/form-submit.js") | $raw %]
234
    [% Asset.js("js/labels-menu.js") | $raw %]
233
    [% Asset.js("js/labels-menu.js") | $raw %]
235
    <script>
234
    <script>
236
        function dofocus() {    // named function req'd for body onload event by some FF and IE7 security models
235
        function dofocus() {    // named function req'd for body onload event by some FF and IE7 security models
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manage.tt (-1 lines)
Lines 158-164 Link Here
158
[% MACRO jsinclude BLOCK %]
158
[% MACRO jsinclude BLOCK %]
159
    [% INCLUDE 'greybox.inc' %]
159
    [% INCLUDE 'greybox.inc' %]
160
    [% INCLUDE 'datatables.inc' %]
160
    [% INCLUDE 'datatables.inc' %]
161
    [% Asset.js("js/form-submit.js") | $raw %]
162
    <script>
161
    <script>
163
        function Xport() {
162
        function Xport() {
164
            batches= new Array;
163
            batches= new Array;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (-1 lines)
Lines 786-792 Link Here
786
    [% INCLUDE 'str/members-menu.inc' %]
786
    [% INCLUDE 'str/members-menu.inc' %]
787
    [% Asset.js("js/members-menu.js") | $raw %]
787
    [% Asset.js("js/members-menu.js") | $raw %]
788
    [% Asset.js("js/recalls.js") | $raw %]
788
    [% Asset.js("js/recalls.js") | $raw %]
789
    [% Asset.js("js/form-submit.js") | $raw %]
790
    <script>
789
    <script>
791
        const LoadCheckoutsTableDelay = 0;
790
        const LoadCheckoutsTableDelay = 0;
792
        const AlwaysLoadCheckoutsTable = [% Koha.Preference('AlwaysLoadCheckoutsTable') | html %];
791
        const AlwaysLoadCheckoutsTable = [% Koha.Preference('AlwaysLoadCheckoutsTable') | html %];
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/lists.tt (-1 lines)
Lines 162-168 Link Here
162
162
163
[% MACRO jsinclude BLOCK %]
163
[% MACRO jsinclude BLOCK %]
164
    [% Asset.js("js/tools-menu.js") | $raw %]
164
    [% Asset.js("js/tools-menu.js") | $raw %]
165
    [% Asset.js("js/form-submit.js") | $raw %]
166
    [% INCLUDE 'datatables.inc' %]
165
    [% INCLUDE 'datatables.inc' %]
167
    <script>
166
    <script>
168
        $(document).ready(function() {
167
        $(document).ready(function() {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt (-1 lines)
Lines 1710-1716 Link Here
1710
    [% Asset.js( "lib/codemirror/highlight.js" ) | $raw %]
1710
    [% Asset.js( "lib/codemirror/highlight.js" ) | $raw %]
1711
    [% Asset.css("lib/codemirror/highlight.css") | $raw %]
1711
    [% Asset.css("lib/codemirror/highlight.css") | $raw %]
1712
    [% Asset.js( "js/mana.js" ) | $raw %]
1712
    [% Asset.js( "js/mana.js" ) | $raw %]
1713
    [% Asset.js("js/form-submit.js") | $raw %]
1714
    <script>
1713
    <script>
1715
        //  if the report param form has multiselects override default form submission
1714
        //  if the report param form has multiselects override default form submission
1716
        if( $('#report_param_form').find('select[multiple]').length ) {
1715
        if( $('#report_param_form').find('select[multiple]').length ) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-1 lines)
Lines 1425-1431 Link Here
1425
    [% INCLUDE 'calendar.inc' %]
1425
    [% INCLUDE 'calendar.inc' %]
1426
    [% INCLUDE 'select2.inc' %]
1426
    [% INCLUDE 'select2.inc' %]
1427
    [% Asset.js("js/holds.js") | $raw %]
1427
    [% Asset.js("js/holds.js") | $raw %]
1428
    [% Asset.js("js/form-submit.js") | $raw %]
1429
1428
1430
    [% SET url_biblio_params = "biblionumber=" _ biblionumbers.join("&amp;biblionumber=") %]
1429
    [% SET url_biblio_params = "biblionumber=" _ biblionumbers.join("&amp;biblionumber=") %]
1431
    [% IF multi_hold %]
1430
    [% IF multi_hold %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/rotatingCollections.tt (-1 lines)
Lines 98-104 Link Here
98
    [% INCLUDE 'datatables.inc' %]
98
    [% INCLUDE 'datatables.inc' %]
99
    [% Asset.js("js/tools-menu.js") | $raw %]
99
    [% Asset.js("js/tools-menu.js") | $raw %]
100
    [% Asset.js("js/rotating-collections.js") | $raw %]
100
    [% Asset.js("js/rotating-collections.js") | $raw %]
101
    [% Asset.js("js/form-submit.js") | $raw %]
102
[% END %]
101
[% END %]
103
102
104
[% INCLUDE 'intranet-bottom.inc' %]
103
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stockrotation.tt (-1 lines)
Lines 719-725 Link Here
719
    [% INCLUDE 'datatables.inc' %]
719
    [% INCLUDE 'datatables.inc' %]
720
    [% Asset.js( "lib/sortable/Sortable.min.js" ) | $raw %]
720
    [% Asset.js( "lib/sortable/Sortable.min.js" ) | $raw %]
721
    [% Asset.js("js/pages/stockrotation.js") | $raw %]
721
    [% Asset.js("js/pages/stockrotation.js") | $raw %]
722
    [% Asset.js("js/form-submit.js") | $raw %]
723
    <script>
722
    <script>
724
        var stock_rotation_items_table_settings = [% TablesSettings.GetTableSettings( 'tools', 'stockrotation', 'stock_rotation_manage_items', 'json' ) | $raw %];
723
        var stock_rotation_items_table_settings = [% TablesSettings.GetTableSettings( 'tools', 'stockrotation', 'stock_rotation_manage_items', 'json' ) | $raw %];
725
        var stock_rotation_table_settings = [% TablesSettings.GetTableSettings( 'tools', 'stockrotation', 'stock_rotation', 'json' ) | $raw %];
724
        var stock_rotation_table_settings = [% TablesSettings.GetTableSettings( 'tools', 'stockrotation', 'stock_rotation', 'json' ) | $raw %];
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt (-1 lines)
Lines 632-638 Link Here
632
632
633
[% MACRO jsinclude BLOCK %]
633
[% MACRO jsinclude BLOCK %]
634
    [% INCLUDE 'datatables.inc' %]
634
    [% INCLUDE 'datatables.inc' %]
635
    [% Asset.js("js/form-submit.js") | $raw %]
636
    [% IF print %]
635
    [% IF print %]
637
        <script>
636
        <script>
638
            $(document).ready(function () {
637
            $(document).ready(function () {
(-)a/koha-tmpl/intranet-tmpl/prog/js/form-submit.js (-38 lines)
Lines 1-38 Link Here
1
$(document).ready(function () {
2
    $("body").on("click", ".submit-form-link", function (e) {
3
        e.preventDefault();
4
        let form_data = $(this).data();
5
6
        let confirm_msg = form_data.confirmationMsg;
7
        if (confirm_msg) {
8
            let confirmation = confirm(confirm_msg);
9
            if (!confirmation) {
10
                return false;
11
            }
12
            delete form_data.confirmationMsg;
13
        }
14
15
        let the_form = $("<form/>");
16
        if (form_data.method === "post") {
17
            form_data.csrf_token = $('meta[name="csrf-token"]').attr("content");
18
        }
19
        the_form.attr("method", form_data.method);
20
        the_form.attr("action", form_data.action);
21
        delete form_data.method;
22
        delete form_data.action;
23
        $.each(form_data, function (key, value) {
24
            the_form.append(
25
                $("<input/>", {
26
                    type: "hidden",
27
                    name: key,
28
                    value: value,
29
                })
30
            );
31
        });
32
        if (form_data.new_tab) {
33
            the_form.attr("target", "_blank");
34
        }
35
        $("body").append(the_form);
36
        the_form.submit();
37
    });
38
});
(-)a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js (+38 lines)
Lines 99-104 $(document).ready(function () { Link Here
99
        }
99
        }
100
    );
100
    );
101
101
102
    // form-submit js
103
    $("body").on("click", ".submit-form-link", function (e) {
104
        e.preventDefault();
105
        let form_data = $(this).data();
106
107
        let confirm_msg = form_data.confirmationMsg;
108
        if (confirm_msg) {
109
            let confirmation = confirm(confirm_msg);
110
            if (!confirmation) {
111
                return false;
112
            }
113
            delete form_data.confirmationMsg;
114
        }
115
116
        let the_form = $("<form/>");
117
        if (form_data.method === "post") {
118
            form_data.csrf_token = $('meta[name="csrf-token"]').attr("content");
119
        }
120
        the_form.attr("method", form_data.method);
121
        the_form.attr("action", form_data.action);
122
        delete form_data.method;
123
        delete form_data.action;
124
        $.each(form_data, function (key, value) {
125
            the_form.append(
126
                $("<input/>", {
127
                    type: "hidden",
128
                    name: key,
129
                    value: value,
130
                })
131
            );
132
        });
133
        if (form_data.new_tab) {
134
            the_form.attr("target", "_blank");
135
        }
136
        $("body").append(the_form);
137
        the_form.submit();
138
    });
139
102
    $(".close, .close_window").on("click", function (e) {
140
    $(".close, .close_window").on("click", function (e) {
103
        e.preventDefault();
141
        e.preventDefault();
104
        window.close();
142
        window.close();
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt (-1 lines)
Lines 1073-1079 Link Here
1073
1073
1074
[% INCLUDE 'opac-bottom.inc' %]
1074
[% INCLUDE 'opac-bottom.inc' %]
1075
[% BLOCK jsinclude %]
1075
[% BLOCK jsinclude %]
1076
    [% Asset.js("js/form-submit.js") | $raw %]
1077
    [% INCLUDE 'calendar.inc' %]
1076
    [% INCLUDE 'calendar.inc' %]
1078
    [% INCLUDE 'datatables.inc' %]
1077
    [% INCLUDE 'datatables.inc' %]
1079
    <script>
1078
    <script>
(-)a/koha-tmpl/opac-tmpl/bootstrap/js/form-submit.js (-35 lines)
Lines 1-35 Link Here
1
$(document).ready(function () {
2
    $(".submit-form-link").click(function (e) {
3
        e.preventDefault();
4
        let form_data = $(this).data();
5
6
        let confirm_msg = form_data.confirmationMsg;
7
        if (confirm_msg) {
8
            let confirmation = confirm(confirm_msg);
9
            if (!confirmation) {
10
                return false;
11
            }
12
            delete form_data.confirmationMsg;
13
        }
14
15
        let the_form = $("<form/>");
16
        if (form_data.method === "post") {
17
            form_data.csrf_token = $('meta[name="csrf-token"]').attr("content");
18
        }
19
        the_form.attr("method", form_data.method);
20
        the_form.attr("action", form_data.action);
21
        delete form_data.method;
22
        delete form_data.action;
23
        $.each(form_data, function (key, value) {
24
            the_form.append(
25
                $("<input/>", {
26
                    type: "hidden",
27
                    name: key,
28
                    value: value,
29
                })
30
            );
31
        });
32
        $("body").append(the_form);
33
        the_form.submit();
34
    });
35
});
(-)a/koha-tmpl/opac-tmpl/bootstrap/js/global.js (-1 / +39 lines)
Lines 267-272 $(document).ready(function () { Link Here
267
267
268
        observer.observe(document.querySelector(".sticky"));
268
        observer.observe(document.querySelector(".sticky"));
269
    }
269
    }
270
271
    // form-submit js
272
    $("body").on("click", ".submit-form-link", function (e) {
273
        e.preventDefault();
274
        let form_data = $(this).data();
275
276
        let confirm_msg = form_data.confirmationMsg;
277
        if (confirm_msg) {
278
            let confirmation = confirm(confirm_msg);
279
            if (!confirmation) {
280
                return false;
281
            }
282
            delete form_data.confirmationMsg;
283
        }
284
285
        let the_form = $("<form/>");
286
        if (form_data.method === "post") {
287
            form_data.csrf_token = $('meta[name="csrf-token"]').attr("content");
288
        }
289
        the_form.attr("method", form_data.method);
290
        the_form.attr("action", form_data.action);
291
        delete form_data.method;
292
        delete form_data.action;
293
        $.each(form_data, function (key, value) {
294
            the_form.append(
295
                $("<input/>", {
296
                    type: "hidden",
297
                    name: key,
298
                    value: value,
299
                })
300
            );
301
        });
302
        if (form_data.new_tab) {
303
            the_form.attr("target", "_blank");
304
        }
305
        $("body").append(the_form);
306
        the_form.submit();
307
    });
308
270
    $("html").removeClass("no-js").addClass("js");
309
    $("html").removeClass("no-js").addClass("js");
271
    $(".close").click(function () {
310
    $(".close").click(function () {
272
        window.close();
311
        window.close();
273
- 

Return to bug 39567